summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorwhy <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-16 16:09:41 +0000
committerwhy <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-16 16:09:41 +0000
commitb02b4bb04831671c77dbd55eaf7e77e1629c03b5 (patch)
tree8311ecba8628f181bc0ce9e4d91dd34298a62b49 /lib
parentc16bdcc5e1c10fa873e35c7e0b184f7f99340786 (diff)
* lib/yaml.rb: removed fallback to pure Ruby parser.
* lib/yaml/baseemitter.rb (indent_text): was forcing a mod value of zero at times, which kept some blocks from getting indentation. * lib/yaml/baseemitter.rb (node_text): rewriting folded scalars. * ext/syck/syck.h: reports style of scalars now, be they plain, block single-, or double-quoted. * ext/syck/syck.c: ditto. * ext/syck/gram.c: ditto. * ext/syck/node.c: ditto. * ext/syck/token.c: ditto. * ext/syck/rubyext.c (yaml_org_handler): symbols loaded only if scalar style is plain. * ext/syck/rubyext.c (yaml_org_handler): some empty strings were loaded as symbols. * test/yaml/test_yaml.rb (test_perl_regexp): updated test to match new regexp serialization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/yaml.rb21
1 files changed, 2 insertions, 19 deletions
diff --git a/lib/yaml.rb b/lib/yaml.rb
index baa599d3c5..3e1b56b7ad 100644
--- a/lib/yaml.rb
+++ b/lib/yaml.rb
@@ -5,21 +5,12 @@
#
# Loads the parser/loader and emitter/writer.
#
-
module YAML
- begin
require 'yaml/syck'
@@parser = YAML::Syck::Parser
@@loader = YAML::Syck::DefaultLoader
@@emitter = YAML::Syck::Emitter
- rescue LoadError
- require 'yaml/parser'
- @@parser = YAML::Parser
- @@loader = YAML::DefaultLoader
- require 'yaml/emitter'
- @@emitter = YAML::Emitter
- end
require 'yaml/loader'
require 'yaml/stream'
@@ -148,7 +139,7 @@ module YAML
end
#
- # Method to extract colon-separated type and class, returning
+ # Method to extract colon-seperated type and class, returning
# the type and the constant of the class
#
def YAML.read_type_class( type, obj_class )
@@ -160,20 +151,12 @@ module YAML
#
# Allocate blank object
#
- def YAML.object_maker( obj_class, val, is_attr = false )
+ def YAML.object_maker( obj_class, val )
if Hash === val
- # name = obj_class.name
- # ostr = sprintf( "%c%co:%c%s\000", ::Marshal::MAJOR_VERSION, ::Marshal::MINOR_VERSION,
- # name.length + 5, name )
- # if is_attr
- # ostr[ -1, 1 ] = ::Marshal.dump( val ).sub( /^[^{]+\{/, '' )
- # end
o = obj_class.allocate
- unless is_attr
val.each_pair { |k,v|
o.instance_variable_set("@#{k}", v)
}
- end
o
else
raise YAML::Error, "Invalid object explicitly tagged !ruby/Object: " + val.inspect