]> gitweb.fluxo.info Git - puppet-stdlib.git/commitdiff
Fix some ruby 1.9.2 issues.
authorKen Barber <ken@bob.sh>
Fri, 29 Jul 2011 23:44:02 +0000 (00:44 +0100)
committerKen Barber <ken@bob.sh>
Fri, 29 Jul 2011 23:44:02 +0000 (00:44 +0100)
lib/puppet/parser/functions/sort.rb
lib/puppet/parser/functions/values_at.rb
spec/unit/parser/functions/shuffle_spec.rb

index 378549624c97a7aaed323acd3091826fb4b387e9..cefbe5463b48de6d63b76c42a88e3b31b4cc14f9 100644 (file)
@@ -18,7 +18,7 @@ Sorts strings and arrays lexically.
     if value.is_a?(Array) then
       value.sort
     elsif value.is_a?(String) then
-      value.split("").sort.to_s
+      value.split("").sort.join("")
     end
 
   end
index 7f1de8e45d1059bfea55a6ac2c215562dfb1445f..d3e69d97fc13271a33a56c08d30e78d95eee8ae9 100644 (file)
@@ -38,7 +38,7 @@ Would return ['a','c','d'].
       raise(Puppet::ParseError, 'values_at(): Requires array to work with')
     end
 
-    indices = *arguments # Get them all ... Pokemon ...
+    indices = [arguments.shift].flatten() # Get them all ... Pokemon ...
 
     if not indices or indices.empty?
       raise(Puppet::ParseError, 'values_at(): You must provide ' +
index 936c2fdba1a6e7c13f57e01083a59456e403ef72..f04fda597c7b1835d9e92477e9562d99de282343 100644 (file)
@@ -25,7 +25,7 @@ describe "the shuffle function" do
 
   it "should shuffle a string but the sorted contents should still be the same" do
     result = @scope.function_shuffle(["adfs"])
-    result.split("").sort.to_s.should(eq("adfs"))
+    result.split("").sort.join("").should(eq("adfs"))
   end
 
 end