You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by ma...@redhat.com on 2013/02/12 11:27:15 UTC
[PATCH] [Core] DTACLOUD-464 alias Array.sample for ruby 1.8.7
From: marios <ma...@redhat.com>
https://issues.apache.org/jira/browse/DTACLOUD-464
Signed-off-by: marios <ma...@redhat.com>
---
server/lib/deltacloud/core_ext/array.rb | 5 +++++
1 file changed, 5 insertions(+)
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
--
1.7.11.7