You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by Sam Ruby <ru...@apache.org> on 2016/03/15 17:39:42 UTC

[whimsy.git] [1/1] Commit a8acbc8: to_h backwards compatibility for Ruby 2.0

Commit a8acbc8b6f7a64a1372348cc62b8c796c7f077c8:
    to_h backwards compatibility for Ruby 2.0


Branch: refs/heads/master
Author: Sam Ruby <ru...@intertwingly.net>
Committer: Sam Ruby <ru...@intertwingly.net>
Pusher: rubys <ru...@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