diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-09-27 22:57:53 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-09-27 22:57:53 +0000 |
commit | 462fd870d70a13713e13f78bb058ee0e06b0e31c (patch) | |
tree | 2339f84b7c7351b2e328960d7bad906bc0f2d8c2 /lib/yaml/tag.rb | |
parent | 63e58214602bba961af15dac35e160427ffd5c12 (diff) | |
download | ruby-462fd870d70a13713e13f78bb058ee0e06b0e31c.tar.gz |
* lib/yaml/basenode.rb (YAML::BaseNode::match_segment): fix typo.
[ruby-dev:27237], [ruby-core:05854]
* lib/yaml/tag.rb (Module#yaml_as): suppress warnings.
* lib/yaml/types.rb (YAML::PrivateType, YAML::DomainType): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/yaml/tag.rb')
-rw-r--r-- | lib/yaml/tag.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/yaml/tag.rb b/lib/yaml/tag.rb index 0e25e1f85a..e51677230f 100644 --- a/lib/yaml/tag.rb +++ b/lib/yaml/tag.rb @@ -55,13 +55,14 @@ class Module # :nodoc: all # in YAML. See YAML::tag_class for detailed information on typing and # taguris. def yaml_as( tag, sc = true ) - class_eval <<-"end;" - attr_accessor :taguri + verbose, $VERBOSE = $VERBOSE, nil + class_eval <<-"end;", __FILE__, __LINE__+1 + attr_writer :taguri def taguri if respond_to? :to_yaml_type YAML::tagurize( to_yaml_type[1..-1] ) else - return @taguri if @taguri + return @taguri if defined?(@taguri) and @taguri tag = #{ tag.dump } if self.class.yaml_tag_subclasses? and self.class != YAML::tagged_classes[tag] tag = "\#{ tag }:\#{ self.class.yaml_tag_class_name }" @@ -72,6 +73,8 @@ class Module # :nodoc: all def self.yaml_tag_subclasses?; #{ sc ? 'true' : 'false' }; end end; YAML::tag_class tag, self + ensure + $VERBOSE = verbose end # Transforms the subclass name into a name suitable for display # in a subclassed tag. |