summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Robinson <matt@puppetlabs.com>2011-05-16 15:14:23 -0700
committerMatt Robinson <matt@puppetlabs.com>2011-05-16 15:14:23 -0700
commit8f58db9188359ab8c8988e56b1abf0ec3bbc1303 (patch)
treeeddaf0fce8fac23de251f2c9c033d8e65093d776
parent61d732231fa1d23a5e9c32bc38ec9f11430229ba (diff)
parent48923af0954e93b5e063e4934809779b4f6cf690 (diff)
downloadpuppet-8f58db9188359ab8c8988e56b1abf0ec3bbc1303.tar.gz
puppet-8f58db9188359ab8c8988e56b1abf0ec3bbc1303.tar.xz
puppet-8f58db9188359ab8c8988e56b1abf0ec3bbc1303.zip
Merge branch 'ticket/2.7.x/7291-ruby19-fixes' into 2.7.x
* ticket/2.7.x/7291-ruby19-fixes: (#7291) Fix issues with instance_methods in Ruby 1.9 (#7291) Fixed ascii problem with Ruby 1.9.2 (#7291) Fix Ruby 1.9 face failures (#7291) The 'script' version of actions needs options argument
-rw-r--r--lib/puppet/face/certificate.rb2
-rw-r--r--lib/puppet/face/resource.rb2
-rw-r--r--lib/puppet/interface/action_builder.rb4
-rw-r--r--lib/puppet/interface/option_builder.rb4
-rw-r--r--lib/puppet/network/client.rb2
-rw-r--r--lib/puppet/network/format.rb2
-rw-r--r--lib/puppet/util/selinux.rb2
-rwxr-xr-xspec/lib/puppet/face/huzzah.rb2
-rw-r--r--spec/lib/puppet/face/version_matching.rb2
9 files changed, 11 insertions, 11 deletions
diff --git a/lib/puppet/face/certificate.rb b/lib/puppet/face/certificate.rb
index ee2b2873f..859946623 100644
--- a/lib/puppet/face/certificate.rb
+++ b/lib/puppet/face/certificate.rb
@@ -8,7 +8,7 @@ Puppet::Indirector::Face.define(:certificate, '0.0.1') do
summary "Provide access to the CA for certificate management"
description <<-EOT
This face interacts with a local or remote Puppet certificate
- authority. Currently, its behavior is not a full superset of puppet
+ authority. Currently, its behavior is not a full superset of puppet
cert; specifically, it is unable to mimic puppet cert's "clean" option,
and its "generate" action submits a CSR rather than creating a
signed certificate.
diff --git a/lib/puppet/face/resource.rb b/lib/puppet/face/resource.rb
index ed6360888..87e587624 100644
--- a/lib/puppet/face/resource.rb
+++ b/lib/puppet/face/resource.rb
@@ -7,7 +7,7 @@ Puppet::Indirector::Face.define(:resource, '0.0.1') do
summary "Interact directly with resources via the RAL, like ralsh"
description <<-EOT
This face provides a Ruby API with functionality similar to the puppet
- resource (née ralsh) command line application. It is not intended to be
+ resource (originally ralsh) command line application. It is not intended to be
used from the command line.
EOT
notes <<-EOT
diff --git a/lib/puppet/interface/action_builder.rb b/lib/puppet/interface/action_builder.rb
index 62db8de06..4948f5fab 100644
--- a/lib/puppet/interface/action_builder.rb
+++ b/lib/puppet/interface/action_builder.rb
@@ -49,9 +49,9 @@ class Puppet::Interface::ActionBuilder
# Metaprogram the simple DSL from the target class.
Puppet::Interface::Action.instance_methods.grep(/=$/).each do |setter|
next if setter =~ /^=/
- property = setter.sub(/=$/, '')
+ property = setter.to_s.chomp('=')
- unless public_instance_methods.include? property
+ unless method_defined? property
# Using eval because the argument handling semantics are less awful than
# when we use the define_method/block version. The later warns on older
# Ruby versions if you pass the wrong number of arguments, but carries
diff --git a/lib/puppet/interface/option_builder.rb b/lib/puppet/interface/option_builder.rb
index 8f358c222..5676ec977 100644
--- a/lib/puppet/interface/option_builder.rb
+++ b/lib/puppet/interface/option_builder.rb
@@ -18,9 +18,9 @@ class Puppet::Interface::OptionBuilder
# Metaprogram the simple DSL from the option class.
Puppet::Interface::Option.instance_methods.grep(/=$/).each do |setter|
next if setter =~ /^=/
- dsl = setter.sub(/=$/, '')
+ dsl = setter.to_s.chomp('=')
- unless private_instance_methods.include? dsl
+ unless private_method_defined? dsl
define_method(dsl) do |value| @option.send(setter, value) end
end
end
diff --git a/lib/puppet/network/client.rb b/lib/puppet/network/client.rb
index cd88b9d84..c56b21393 100644
--- a/lib/puppet/network/client.rb
+++ b/lib/puppet/network/client.rb
@@ -23,7 +23,7 @@ class Net::HTTP
# JJM: This is a "backport" of sorts to older ruby versions which
# do not have this accessor. See #896 for more information.
- attr_accessor :enable_post_connection_check unless Net::HTTP.instance_methods.include? "enable_post_connection_check"
+ attr_accessor :enable_post_connection_check unless Net::HTTP.method_defined? "enable_post_connection_check"
end
# The base class for all of the clients. Many clients just directly
diff --git a/lib/puppet/network/format.rb b/lib/puppet/network/format.rb
index 9cd6cf0b5..69895c344 100644
--- a/lib/puppet/network/format.rb
+++ b/lib/puppet/network/format.rb
@@ -106,6 +106,6 @@ class Puppet::Network::Format
method = send(name)
- return(type == :class ? klass.respond_to?(method) : klass.instance_methods.include?(method))
+ return(type == :class ? klass.respond_to?(method) : klass.method_defined?(method))
end
end
diff --git a/lib/puppet/util/selinux.rb b/lib/puppet/util/selinux.rb
index cec8a57d9..255388d58 100644
--- a/lib/puppet/util/selinux.rb
+++ b/lib/puppet/util/selinux.rb
@@ -140,7 +140,7 @@ module Puppet::Util::SELinux
def read_mounts
mounts = ""
begin
- if File.instance_methods.include? "read_nonblock"
+ if File.method_defined? "read_nonblock"
# If possible we use read_nonblock in a loop rather than read to work-
# a linux kernel bug. See ticket #1963 for details.
mountfh = File.open("/proc/mounts")
diff --git a/spec/lib/puppet/face/huzzah.rb b/spec/lib/puppet/face/huzzah.rb
index 6593d358a..ab465d9e0 100755
--- a/spec/lib/puppet/face/huzzah.rb
+++ b/spec/lib/puppet/face/huzzah.rb
@@ -3,5 +3,5 @@ Puppet::Face.define(:huzzah, '2.0.1') do
copyright "Puppet Labs", 2011
license "Apache 2 license; see COPYING"
summary "life is a thing for celebration"
- script :bar do "is where beer comes from" end
+ script :bar do |options| "is where beer comes from" end
end
diff --git a/spec/lib/puppet/face/version_matching.rb b/spec/lib/puppet/face/version_matching.rb
index 52bc71dbd..bfdf5e36e 100644
--- a/spec/lib/puppet/face/version_matching.rb
+++ b/spec/lib/puppet/face/version_matching.rb
@@ -7,6 +7,6 @@ require 'puppet/face'
copyright "Puppet Labs", 2011
license "Apache 2 license; see COPYING"
summary "version matching face #{version}"
- script :version do version end
+ script :version do |options| version end
end
end