ruby-changes:34478
From: hsbt <ko1@a...>
Date: Thu, 26 Jun 2014 11:52:55 +0900 (JST)
Subject: [ruby-changes:34478] hsbt:r46559 (trunk): Revert "Revert "* lib/yaml.rb: Remove Psych::EngineManager [Bug #8344]""
hsbt 2014-06-26 11:52:46 +0900 (Thu, 26 Jun 2014) New Revision: 46559 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46559 Log: Revert "Revert "* lib/yaml.rb: Remove Psych::EngineManager [Bug #8344]"" syck-1.0.3 gem support this imcompatible changes. This reverts commit r46102 Removed files: trunk/test/psych/test_engine_manager.rb Modified files: trunk/ChangeLog trunk/NEWS trunk/lib/yaml.rb trunk/test/psych/test_yamldbm.rb trunk/test/psych/test_yamlstore.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 46558) +++ ChangeLog (revision 46559) @@ -1207,6 +1207,11 @@ Sun May 25 11:56:33 2014 Nobuyoshi Naka https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1207 start cannot exceed the size, the comparison was always false. [ruby-core:62737] [Bug #9861] +Sun May 25 11:32:42 2014 Zachary Scott <e@z...> + + * lib/yaml.rb: Remove Psych::EngineManager [Bug #8344] + * test/psych/*: ditto. + Sun May 25 10:34:15 2014 Zachary Scott <e@z...> * doc/regexp.rdoc: [DOC] Clarify whitespace matching by @allolex Index: lib/yaml.rb =================================================================== --- lib/yaml.rb (revision 46558) +++ lib/yaml.rb (revision 46559) @@ -12,40 +12,6 @@ end https://github.com/ruby/ruby/blob/trunk/lib/yaml.rb#L12 YAML = Psych # :nodoc: -module Psych # :nodoc: - # For compatibility, deprecated - class EngineManager # :nodoc: - attr_reader :yamler # :nodoc: - - def initialize # :nodoc: - @yamler = 'psych' - end - - def syck? # :nodoc: - false - end - - # Psych is always used and this method has no effect. - # - # This method is still present for compatibility. - # - # You may still use the Syck engine by installing - # the 'syck' gem and using the Syck constant. - def yamler= engine # :nodoc: - case engine - when 'syck' then warn "syck has been removed, psych is used instead" - when 'psych' then @yamler = 'psych' - else - raise(ArgumentError, "bad engine") - end - - engine - end - end - - ENGINE = EngineManager.new # :nodoc: -end - # YAML Ain't Markup Language # # This module provides a Ruby interface for data serialization in YAML format. Index: NEWS =================================================================== --- NEWS (revision 46558) +++ NEWS (revision 46559) @@ -127,6 +127,9 @@ with all sufficient information, see the https://github.com/ruby/ruby/blob/trunk/NEWS#L127 * Prime.prime? now returns false for negative numbers. This method should not be used to know the number is composite or not. [Bug #7395] +* Psych + * Removed Psych::EngineManager [Bug #8344] + === Built-in global variables compatibility issues === C API updates Index: test/psych/test_engine_manager.rb =================================================================== --- test/psych/test_engine_manager.rb (revision 46558) +++ test/psych/test_engine_manager.rb (revision 46559) @@ -1,47 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/test/psych/test_engine_manager.rb#L0 -require_relative 'helper' -require 'yaml' - -module Psych - class TestEngineManager < TestCase - def test_bad_engine - assert_raises(ArgumentError) do - YAML::ENGINE.yamler = 'foooo' - end - end - - def test_set_psych - YAML::ENGINE.yamler = 'psych' - assert_equal Psych, YAML - assert_equal 'psych', YAML::ENGINE.yamler - end - - A = Struct.new(:name) - - def test_dump_types - YAML::ENGINE.yamler = 'psych' - - assert_to_yaml ::Object.new - assert_to_yaml Time.now - assert_to_yaml Date.today - assert_to_yaml('a' => 'b') - assert_to_yaml A.new('foo') - assert_to_yaml %w{a b} - assert_to_yaml Exception.new('foo') - assert_to_yaml "hello!" - assert_to_yaml :fooo - assert_to_yaml(1..10) - assert_to_yaml(/hello!~/) - assert_to_yaml 1 - assert_to_yaml 1.2 - assert_to_yaml Rational(1, 2) - assert_to_yaml Complex(1, 2) - assert_to_yaml true - assert_to_yaml false - assert_to_yaml nil - end - - def assert_to_yaml obj - assert obj.to_yaml, "#{obj.class} to_yaml works" - end - end -end Index: test/psych/test_yamlstore.rb =================================================================== --- test/psych/test_yamlstore.rb (revision 46558) +++ test/psych/test_yamlstore.rb (revision 46559) @@ -7,7 +7,6 @@ module Psych https://github.com/ruby/ruby/blob/trunk/test/psych/test_yamlstore.rb#L7 class YAMLStoreTest < TestCase def setup - @engine, YAML::ENGINE.yamler = YAML::ENGINE.yamler, 'psych' @dir = Dir.mktmpdir("rubytest-file") File.chown(-1, Process.gid, @dir) @yamlstore_file = make_tmp_filename("yamlstore") @@ -15,7 +14,6 @@ module Psych https://github.com/ruby/ruby/blob/trunk/test/psych/test_yamlstore.rb#L14 end def teardown - YAML::ENGINE.yamler = @engine FileUtils.remove_entry_secure @dir end Index: test/psych/test_yamldbm.rb =================================================================== --- test/psych/test_yamldbm.rb (revision 46558) +++ test/psych/test_yamldbm.rb (revision 46559) @@ -13,7 +13,6 @@ module Psych https://github.com/ruby/ruby/blob/trunk/test/psych/test_yamldbm.rb#L13 class YAMLDBMTest < TestCase def setup - @engine, YAML::ENGINE.yamler = YAML::ENGINE.yamler, 'psych' @dir = Dir.mktmpdir("rubytest-file") File.chown(-1, Process.gid, @dir) @yamldbm_file = make_tmp_filename("yamldbm") @@ -21,7 +20,6 @@ module Psych https://github.com/ruby/ruby/blob/trunk/test/psych/test_yamldbm.rb#L20 end def teardown - YAML::ENGINE.yamler = @engine @yamldbm.clear @yamldbm.close FileUtils.remove_entry_secure @dir -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/