]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/chef/libraries/random_password.rb
Merge remote-tracking branch 'github/pull/440'
[chef.git] / cookbooks / chef / libraries / random_password.rb
index f8c6674da93537a3975cad0ab92cdfed5fb0a4ef..71d8bcfededf136192f6e2b6aadb7d334321e002 100644 (file)
@@ -1,7 +1,7 @@
 class Chef
   class Recipe
     def random_password(length)
-      length.times.collect do
+      Array.new(length) do
         "!\#$%&()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~"[rand(91)].chr
       end.join
     end