From de2199f3666ca9e26a0a36ec17b176300a4fa599 Mon Sep 17 00:00:00 2001 From: Daniel Pittman Date: Thu, 21 Apr 2011 15:01:38 -0700 Subject: (#6928) Don't blow up when the method is undefined... Use the same model for testing instance methods as the rest of the code. Reviewed-By: Max Martin --- lib/puppet/util/monkey_patches.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/puppet/util/monkey_patches.rb b/lib/puppet/util/monkey_patches.rb index 9ae0ca6a2..bd954c665 100644 --- a/lib/puppet/util/monkey_patches.rb +++ b/lib/puppet/util/monkey_patches.rb @@ -106,10 +106,8 @@ class Array end -if Symbol.instance_method(:to_proc).nil? - class Symbol - def to_proc - Proc.new { |*args| args.shift.__send__(self, *args) } - end - end +class Symbol + def to_proc + Proc.new { |*args| args.shift.__send__(self, *args) } + end unless method_defined? :to_proc end -- cgit