- Timestamp:
- 09/21/2005 22:50:44 (3 years ago)
- Location:
- trunk/ext/ruby
- Files:
-
- 3 modified
-
lib/yaml/basenode.rb (modified) (1 diff)
-
lib/yaml/types.rb (modified) (2 diffs)
-
tests/basic.rb (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ext/ruby/lib/yaml/basenode.rb
r224 r230 188 188 v[1] if v 189 189 elsif Array === @value 190 @value.[]( *k )190 @value.[]( *key ) 191 191 end 192 192 end -
trunk/ext/ruby/lib/yaml/types.rb
r216 r230 11 11 class PrivateType 12 12 def self.tag_subclasses?; false; end 13 attr_accessor :type_id, :value 14 def initialize( type, val ) 15 @type_id = type; @value = val 13 old_init = instance_method(:initialize) 14 define_method(:initialize) do |*args| 15 old_init.call(*args) 16 16 @value.taguri = "x-private:#{ @type_id }" 17 17 end … … 27 27 def self.tag_subclasses?; false; end 28 28 attr_accessor :domain, :type_id, :value 29 def initialize( domain, type, val ) 30 @domain = domain; @type_id = type; @value = val 29 old_init = instance_method(:initialize) 30 define_method(:initialize) do |*args| 31 old_init.call(*args) 31 32 @value.taguri = "tag:#{ @domain }:#{ @type_id }" 32 33 end -
trunk/ext/ruby/tests/basic.rb
r227 r230 35 35 # 36 36 def assert_bytecode( obj, yaml ) 37 yp = YAML:: Syck::Parser.new37 yp = YAML::Parser.new 38 38 yp.input = :bytecode 39 39 assert_equal( obj, yp.load( yaml ) ) … … 46 46 assert_equal( obj, YAML::load( yaml ) ) 47 47 assert_equal( obj, YAML::parse( yaml ).transform ) 48 yp = YAML:: Syck::Parser.new48 yp = YAML::Parser.new 49 49 yp.input = :bytecode 50 50 assert_equal( obj, yp.load( YAML::Syck::compile( yaml ) ) ) … … 976 976 977 977 doc_ct = 0 978 yp = YAML::Syck::Parser.new 979 yp.resolver = YAML.resolver 978 yp = YAML::Parser.new 980 979 yp.input = :bytecode 981 980 yp.load_documents(