diff options
| author | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-21 15:01:38 -0700 |
|---|---|---|
| committer | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-21 15:02:02 -0700 |
| commit | de2199f3666ca9e26a0a36ec17b176300a4fa599 (patch) | |
| tree | 99abda88f63a69928dece65b47b392dc7fde09dd /lib/puppet | |
| parent | a0de3288bad113c9be1190095b03e892e17000d2 (diff) | |
| download | puppet-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.rb | 10 |
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 |
