summaryrefslogtreecommitdiff
path: root/lib/yaml/tag.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-09-27 22:57:53 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-09-27 22:57:53 +0000
commit7567345876e063a9d65d259dcc86516a43be090c (patch)
tree8a03ff51a1a169fc5a3db91b2506d1ee6695a38d /lib/yaml/tag.rb
parentf307fa8513db4793c406e8070b6294f3a920cfdd (diff)
* 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/branches/ruby_1_8@9323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/yaml/tag.rb')
-rw-r--r--lib/yaml/tag.rb9
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.