diff options
author | Matt Robinson <matt@puppetlabs.com> | 2011-05-16 14:33:58 -0700 |
---|---|---|
committer | Matt Robinson <matt@puppetlabs.com> | 2011-05-16 15:13:52 -0700 |
commit | 48923af0954e93b5e063e4934809779b4f6cf690 (patch) | |
tree | eddaf0fce8fac23de251f2c9c033d8e65093d776 /lib/puppet/interface/documentation.rb | |
parent | 68065ff4bb09f90ecfc3d7a71197133d78f3eb3d (diff) | |
download | puppet-48923af0954e93b5e063e4934809779b4f6cf690.tar.gz puppet-48923af0954e93b5e063e4934809779b4f6cf690.tar.xz puppet-48923af0954e93b5e063e4934809779b4f6cf690.zip |
(#7291) Fix issues with instance_methods in Ruby 1.9
instance_methods in Ruby 1.8.7 returns an array of strings, but returns
an array of symbols in 1.9.2. This manifested itself when running the
tests because in 1.9.2 we were trying to call sub on a sybmol. The
original proposed solution was to monkey patch symbols to have a sub
method, but this didn't deal with the real issue of need to check
whether a method was defined, and actually made it worse.
Turns out that checking for the presence of a method in an array that
may contain symbols and may contain strings is better done by just
calling method_defined? instead.
This patch addresses all the places ack turned up the code doing this
include? check instead of directly calling method_defined?.
Thanks to Alex Sharp ajsharp@gmail.com for pointing out the Ruby 1.9
problems and working toward a solution.
Reviewed-by: Nick Lewis <nick@puppetlabs.com>
Diffstat (limited to 'lib/puppet/interface/documentation.rb')
0 files changed, 0 insertions, 0 deletions