[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5
Markus Roberts
Markus at reality.com
Tue May 10 08:01:35 UTC 2011
The following commit has been merged in the experimental branch:
commit ed49313c025131fa7a4697e834233a6e952ab6dd
Merge: 0d24ea3583c4cd6a4583f4788686a4f9e02cb994 3c4412128a50e41380108e5a90f2656329b84492
Author: Markus Roberts <Markus at reality.com>
Date: Wed Nov 17 06:02:05 2010 -0800
Merge branch 'ticket/next/4590' into next
Conflicts:
lib/puppet/util/monkey_patches.rb
-- two unrelated additions had been made, kept them both.
diff --combined lib/puppet/util/monkey_patches.rb
index bdce5ec,4a4f30a..1c35ae5
--- a/lib/puppet/util/monkey_patches.rb
+++ b/lib/puppet/util/monkey_patches.rb
@@@ -48,11 -48,16 +48,26 @@@ if RUBY_VERSION == '1.8.7
end
end
++
+class Object
+ # ActiveSupport 2.3.x mixes in a dangerous method
+ # that can cause rspec to fork bomb
+ # and other strange things like that.
+ def daemonize
+ raise NotImplementedError, "Kernel.daemonize is too dangerous, please don't try to use it."
+ end
+end
++
+ # Workaround for yaml_initialize, which isn't supported before Ruby
+ # 1.8.3.
+ if RUBY_VERSION == '1.8.1' || RUBY_VERSION == '1.8.2'
+ YAML.add_ruby_type( /^object/ ) { |tag, val|
+ type, obj_class = YAML.read_type_class( tag, Object )
+ r = YAML.object_maker( obj_class, val )
+ if r.respond_to? :yaml_initialize
+ r.instance_eval { instance_variables.each { |name| remove_instance_variable name } }
+ r.yaml_initialize(tag, val)
+ end
+ r
+ }
+ end
diff --combined spec/unit/util/zaml_spec.rb
index b223f89,2a9bc07..358c6aa
mode 100755,100644..100755
--- a/spec/unit/util/zaml_spec.rb
+++ b/spec/unit/util/zaml_spec.rb
@@@ -11,8 -11,7 +11,8 @@@ describe "Pure ruby yaml implementation
'test' => "--- test",
[] => "--- []",
:symbol => "--- !ruby/sym symbol",
- {:a => "A"} => "--- \n !ruby/sym a: A"
+ {:a => "A"} => "--- \n !ruby/sym a: A",
+ {:a => "x\ny"} => "--- \n !ruby/sym a: |-\n x\n y"
}.each { |o,y|
it "should convert the #{o.class} #{o.inspect} to yaml" do
o.to_yaml.should == y
@@@ -35,30 -34,4 +35,29 @@@
lambda { YAML.load(o.to_yaml) }.should_not raise_error
end
}
+
+ it "should emit proper labels and backreferences for common objects" do
+ # Note: this test makes assumptions about the names ZAML chooses
+ # for labels.
+ x = [1, 2]
+ y = [3, 4]
+ z = [x, y, x, y]
+ z.to_yaml.should == "--- \n - &id001\n - 1\n - 2\n - &id002\n - 3\n - 4\n - *id001\n - *id002"
+ z2 = YAML.load(z.to_yaml)
+ z2.should == z
+ z2[0].should equal(z2[2])
+ z2[1].should equal(z2[3])
+ end
+
+ it "should emit proper labels and backreferences for recursive objects" do
+ x = [1, 2]
+ x << x
+ x.to_yaml.should == "--- &id001\n \n - 1\n - 2\n - *id001"
+ x2 = YAML.load(x.to_yaml)
+ x2.should be_a(Array)
+ x2.length.should == 3
+ x2[0].should == 1
+ x2[1].should == 2
+ x2[2].should equal(x2)
+ end
end
-
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list