LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File ruby-1.9-hash.patch of Package hawk (Project openSUSE:Factory)

commit 07843af8e5d811a4d9026febba472967562f053e
Author: Tim Serong <tserong@suse.com>
Date:   Tue Jun 19 18:54:55 2012 +1000

    Misc: Primitve, Template models: Fix op hash construction (ruby 1.9 support)
    
    Signed-off-by: Tim Serong <tserong@suse.com>

diff --git a/hawk/app/models/primitive.rb b/hawk/app/models/primitive.rb
index 6748e1b..49d86b9 100644
--- a/hawk/app/models/primitive.rb
+++ b/hawk/app/models/primitive.rb
@@ -217,7 +217,7 @@ class Primitive < CibObject
       xml.elements['operations'].elements.each do |e|
         name = e.attributes['name']
         ops[name] = [] unless ops[name]
-        op = Hash[e.attributes.collect]
+        op = Hash[e.attributes.collect{|a| a.to_a}]
         op.delete 'name'
         op.delete 'id'
         ops[name].push op
@@ -344,7 +344,7 @@ class Primitive < CibObject
       xml.elements.each('//action') do |e|
         name = e.attributes['name']
         m[:ops][name] = [] unless m[:ops][name]
-        op = Hash[e.attributes.collect]
+        op = Hash[e.attributes.collect{|a| a.to_a}]
         op.delete 'name'
         op.delete 'depth'
         # There's at least one case (ocf:ocfs2:o2cb) where the
diff --git a/hawk/app/models/template.rb b/hawk/app/models/template.rb
index 09e074d..4957341 100644
--- a/hawk/app/models/template.rb
+++ b/hawk/app/models/template.rb
@@ -217,7 +217,7 @@ class Template < CibObject
       xml.elements['operations'].elements.each do |e|
         name = e.attributes['name']
         ops[name] = [] unless ops[name]
-        op = Hash[e.attributes.collect]
+        op = Hash[e.attributes.collect{|a| a.to_a}]
         op.delete 'name'
         op.delete 'id'
         ops[name].push op