diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-03-26 22:40:37 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-03-26 22:40:37 -0700 |
commit | 1c23ee9785721f368f648a23607bd8a69822b287 (patch) | |
tree | 0160c2285bb83aeb7c04727fcaad900105cd5ec8 /lib | |
parent | f6746ce01712071f3d8c58de5ca0ef61f6de57a3 (diff) | |
download | psych-1c23ee9785721f368f648a23607bd8a69822b287.zip |
commenting our core extention removal
Diffstat (limited to 'lib')
-rw-r--r-- | lib/psych.rb | 2 | ||||
-rw-r--r-- | lib/psych/core_ext.rb | 19 | ||||
-rw-r--r-- | lib/psych/yaml.rb | 20 |
3 files changed, 20 insertions, 21 deletions
diff --git a/lib/psych.rb b/lib/psych.rb index 1cdca80..eb13d19 100644 --- a/lib/psych.rb +++ b/lib/psych.rb @@ -7,7 +7,7 @@ require 'psych/parser' require 'psych/omap' require 'psych/set' require 'psych/coder' -require 'psych/yaml' +require 'psych/core_ext' ### # = Overview diff --git a/lib/psych/core_ext.rb b/lib/psych/core_ext.rb new file mode 100644 index 0000000..d8f79eb --- /dev/null +++ b/lib/psych/core_ext.rb @@ -0,0 +1,19 @@ +#require 'date' +#YAML = Psych +# +#[ +# Object, String, Class, Hash, Array, NilClass, Float, FalseClass, TrueClass, +# Range, Complex, Rational, Date, Time, Regexp, Exception, Struct +#].each do |klass| +# klass.send(:remove_method, :to_yaml) rescue NameError +#end + +class Object + def self.yaml_tag url + Psych.add_tag(url, self) + end + + def to_yaml options = {} + Psych.dump self, options + end +end diff --git a/lib/psych/yaml.rb b/lib/psych/yaml.rb deleted file mode 100644 index 49380eb..0000000 --- a/lib/psych/yaml.rb +++ /dev/null @@ -1,20 +0,0 @@ -require 'date' - -YAML = Psych - -[ - Object, String, Class, Hash, Array, NilClass, Float, FalseClass, TrueClass, - Range, Complex, Rational, Date, Time, Regexp, Exception, Struct -].each do |klass| - klass.send(:remove_method, :to_yaml) rescue NameError -end - -class Object - def self.yaml_tag url - Psych.add_tag(url, self) - end - - def to_yaml options = {} - Psych.dump self, options - end -end |