From 799bf6178e5d9830cb4f9905636d045fd56b7239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Mon, 8 Apr 2013 14:48:29 +0200 Subject: [PATCH 1/2] Fix Psych compatibility. --- spec/helpers/appliance-transformation-helper-spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/helpers/appliance-transformation-helper-spec.rb b/spec/helpers/appliance-transformation-helper-spec.rb index 6cf0433..244646e 100644 --- a/spec/helpers/appliance-transformation-helper-spec.rb +++ b/spec/helpers/appliance-transformation-helper-spec.rb @@ -40,7 +40,7 @@ module BoxGrinder describe ".to_0_9_0" do it "should remove excludes section" do - appl = "name: test-appl\nos:\n name: fedora\n version: 15\npackages:\n includes:\n - @base\n - emacs\n excludes:\n - this-does-nothing" + appl = "name: test-appl\nos:\n name: fedora\n version: 15\npackages:\n includes:\n - '@base'\n - emacs\n excludes:\n - this-does-nothing" out = @helper.to_0_9_0(YAML.load(appl)) out['packages'].should == ["@base", "emacs"] out['excludes'].should == nil From 6fc70a19872f9c4c90a9c3a2f01884bcfce39378 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Mon, 8 Apr 2013 14:52:53 +0200 Subject: [PATCH 2/2] Remove Syck enforcement. It is not part of Ruby 2.0 and properly formated YAML should work with Psych like a charm (see the prefious commit fixing test suite.) --- Manifest | 1 - lib/boxgrinder-core.rb | 1 - lib/boxgrinder-core/compat/yaml19.rb | 7 ------- 3 files changed, 9 deletions(-) delete mode 100644 lib/boxgrinder-core/compat/yaml19.rb diff --git a/Manifest b/Manifest index c90466a..dd15cb7 100644 --- a/Manifest +++ b/Manifest @@ -9,7 +9,6 @@ lib/boxgrinder-core/appliance-validator.rb lib/boxgrinder-core/astruct.rb lib/boxgrinder-core/astruct_mixin.rb lib/boxgrinder-core/compat/color.rb -lib/boxgrinder-core/compat/yaml19.rb lib/boxgrinder-core/errors.rb lib/boxgrinder-core/helpers/appliance-config-helper.rb lib/boxgrinder-core/helpers/appliance-definition-helper.rb diff --git a/lib/boxgrinder-core.rb b/lib/boxgrinder-core.rb index 9b4da4e..3133c06 100644 --- a/lib/boxgrinder-core.rb +++ b/lib/boxgrinder-core.rb @@ -17,6 +17,5 @@ # 02110-1301 USA, or see the FSF site: http://www.fsf.org. module BoxGrinder - require 'boxgrinder-core/compat/yaml19' require 'boxgrinder-core/compat/color' end diff --git a/lib/boxgrinder-core/compat/yaml19.rb b/lib/boxgrinder-core/compat/yaml19.rb deleted file mode 100644 index b32da00..0000000 --- a/lib/boxgrinder-core/compat/yaml19.rb +++ /dev/null @@ -1,7 +0,0 @@ -module BoxGrinder - # Avoid Psych::SyntaxError (): couldn't parse YAML ... in 1.9 - if RUBY_VERSION >= '1.9' - require 'yaml' - YAML::ENGINE.yamler = 'syck' - end -end