whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Ruby <ru...@apache.org>
Subject [whimsy.git] [1/1] Commit a8acbc8: to_h backwards compatibility for Ruby 2.0
Date Tue, 15 Mar 2016 16:39:42 GMT
Commit a8acbc8b6f7a64a1372348cc62b8c796c7f077c8:
    to_h backwards compatibility for Ruby 2.0


Branch: refs/heads/master
Author: Sam Ruby <rubys@intertwingly.net>
Committer: Sam Ruby <rubys@intertwingly.net>
Pusher: rubys <rubys@apache.org>

------------------------------------------------------------
lib/whimsy/asf/auth.rb                                       | +++++++ 
------------------------------------------------------------
7 changes: 7 additions, 0 deletions.
------------------------------------------------------------


diff --git a/lib/whimsy/asf/auth.rb b/lib/whimsy/asf/auth.rb
index 00c52bb..158c5a6 100644
--- a/lib/whimsy/asf/auth.rb
+++ b/lib/whimsy/asf/auth.rb
@@ -26,6 +26,13 @@ def each
         yield pmc, ids.split(',')
       end
     end
+
+    unless Enumerable.instance_methods.include? :to_h
+      # backwards compatibility for Ruby versions <= 2.0
+      def to_h
+        Hash[self.to_a]
+      end
+    end
   end
 
   class Person

Mime
View raw message