summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorDaniel Pittman <daniel@puppetlabs.com>2011-04-21 15:01:38 -0700
committerDaniel Pittman <daniel@puppetlabs.com>2011-04-21 15:02:02 -0700
commitde2199f3666ca9e26a0a36ec17b176300a4fa599 (patch)
tree99abda88f63a69928dece65b47b392dc7fde09dd /lib/puppet
parenta0de3288bad113c9be1190095b03e892e17000d2 (diff)
downloadpuppet-de2199f3666ca9e26a0a36ec17b176300a4fa599.tar.gz
puppet-de2199f3666ca9e26a0a36ec17b176300a4fa599.tar.xz
puppet-de2199f3666ca9e26a0a36ec17b176300a4fa599.zip
(#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 <max@puppetlabs.com>
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/util/monkey_patches.rb10
1 files 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