[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5

Matt Robinson matt at puppetlabs.com
Tue May 10 08:09:07 UTC 2011


The following commit has been merged in the experimental branch:
commit 85f3b767e8279188e5a0a594a21b7677126ed664
Author: Matt Robinson <matt at puppetlabs.com>
Date:   Sat Mar 26 09:30:48 2011 -0700

    (#6830) Fix case where instance_variables returns symbols in Ruby 1.9
    
      class Foo
        def initialize
          @a = 2
          @b = "two"
        end
      end
    
      p Foo.new.instance_variables
    
    In Ruby 1.8 this prints
    
      ["@a", "@b"]
    
    In Ruby 1.9 this prints
    
      [:@a, :@b]
    
    Reviewed-by: Jesse Wolfe <jesse at puppetlabs.com>

diff --git a/lib/puppet/simple_graph.rb b/lib/puppet/simple_graph.rb
index ed71a64..27e068e 100644
--- a/lib/puppet/simple_graph.rb
+++ b/lib/puppet/simple_graph.rb
@@ -570,7 +570,10 @@ class Puppet::SimpleGraph
   end
 
   def to_yaml_properties
-    other_vars = instance_variables.reject { |v| %w{@in_to @out_from @upstream_from @downstream_from}.include?(v) }
+    other_vars = instance_variables.
+      map {|v| v.to_s}.
+      reject { |v| %w{@in_to @out_from @upstream_from @downstream_from}.include?(v) }
+
     (other_vars + %w{@vertices @edges}).sort.uniq
   end
 

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list