deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject git commit: [Core] DTACLOUD-464 alias Array.sample for ruby 1.8.7
Date Tue, 12 Feb 2013 16:22:29 GMT
Updated Branches:
  refs/heads/master 573bb7da2 -> ab218bbb8


[Core] DTACLOUD-464 alias Array.sample for ruby 1.8.7

https://issues.apache.org/jira/browse/DTACLOUD-464


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/ab218bbb
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/ab218bbb
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/ab218bbb

Branch: refs/heads/master
Commit: ab218bbb86074e93bda6d69473710fb917ee7049
Parents: 573bb7d
Author: marios <marios@redhat.com>
Authored: Tue Feb 12 11:02:41 2013 +0200
Committer: marios <marios@redhat.com>
Committed: Tue Feb 12 18:22:10 2013 +0200

----------------------------------------------------------------------
 server/lib/deltacloud/core_ext/array.rb |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/ab218bbb/server/lib/deltacloud/core_ext/array.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/core_ext/array.rb b/server/lib/deltacloud/core_ext/array.rb
index 620b1f4..232b216 100644
--- a/server/lib/deltacloud/core_ext/array.rb
+++ b/server/lib/deltacloud/core_ext/array.rb
@@ -22,4 +22,9 @@ class Array
   def extract_opts!
     last.is_a?(Hash) ? pop : {}
   end
+
+  unless [].respond_to? :sample
+    alias :sample :choice
+  end
+
 end


Mime
View raw message