Please review pull request #505: Maint/2.7.x/fix range monkey patch mistake opened by (mmrobins)

Description:

I made a last minute change to the original pull request to not monkey
patch Range to have an intersection method if it was already defined.
However, I also added unless method_defined? :intersection to the &
alias after intersection had been defined, so the alias never got
defined. This commit fixes the :& alias.

  • Opened: Wed Feb 15 21:36:40 UTC 2012
  • Based on: puppetlabs:2.7.x (bd4b6cf7eee74ac379e950903bb545e63dc4887e)
  • Requested merge: mmrobins:maint/2.7.x/fix_range_monkey_patch_mistake (edf13c19cf04e07bf410552129dc749c52b102f5)

Diff follows:

diff --git a/lib/puppet/util/monkey_patches.rb b/lib/puppet/util/monkey_patches.rb
index dd5bbbf..010e9b1 100644
--- a/lib/puppet/util/monkey_patches.rb
+++ b/lib/puppet/util/monkey_patches.rb
@@ -160,7 +160,7 @@ def intersection(other)
     end
   end unless method_defined? :intersection
 
-  alias_method :&, :intersection unless method_defined? :intersection
+  alias_method :&, :intersection unless method_defined? :&
 end
 
 # Ruby 1.8.5 doesn't have tap

    

--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to