Permalink
Browse files

syncing with ruby trunk

  • Loading branch information...
1 parent b4c0f7f commit 95fc90723bb041134c8fe3be8714e8599664ce8b @tenderlove tenderlove committed Aug 17, 2011
Showing with 16 additions and 5 deletions.
  1. +2 −2 Rakefile
  2. +1 −0 lib/psych/core_ext.rb
  3. +5 −2 lib/psych/scalar_scanner.rb
  4. +1 −1 test/psych/test_engine_manager.rb
  5. +7 −0 test/psych/test_yaml.rb
View
@@ -11,10 +11,10 @@ end
gem 'rake-compiler', '>= 0.4.1'
require "rake/extensiontask"
-Hoe.plugin :debugging, :doofus, :git
+Hoe.plugin :debugging, :doofus, :git, :gemspec
Hoe.spec 'psych' do
- developer 'Aaron Patterson', 'aaronp@rubyforge.org'
+ developer 'Aaron Patterson', 'aaron@tenderlovemaking.com'
self.extra_rdoc_files = Dir['*.rdoc']
self.history_file = 'CHANGELOG.rdoc'
View
@@ -36,4 +36,5 @@ def psych_y *objects
end
remove_method :y rescue nil
alias y psych_y
+ private :y
end
@@ -68,8 +68,11 @@ def tokenize string
end
i
else
- return Integer(string.gsub(/[,_]/, '')) rescue ArgumentError
- return Float(string.gsub(/[,_]/, '')) rescue ArgumentError
+ if string.count('.') < 2
+ return Integer(string.gsub(/[,_]/, '')) rescue ArgumentError
+ return Float(string.gsub(/[,_]/, '')) rescue ArgumentError
+ end
+
@string_cache[string] = true
string
end
@@ -21,7 +21,7 @@ def test_set_psych
def test_set_syck
YAML::ENGINE.yamler = 'syck'
- assert_equal Syck, YAML
+ assert_equal ::Syck, YAML
assert_equal 'syck', YAML::ENGINE.yamler
end
View
@@ -3,6 +3,7 @@
# $Id$
#
require 'psych/helper'
+require 'ostruct'
# [ruby-core:01946]
module Psych_Tests
@@ -14,6 +15,12 @@ def teardown
Psych.domain_types.clear
end
+ def test_y_method
+ assert_raises(NoMethodError) do
+ OpenStruct.new.y 1
+ end
+ end
+
def test_syck_compat
time = Time.utc(2010, 10, 10)
yaml = Psych.dump time

0 comments on commit 95fc907

Please sign in to comment.