summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Robinson <matt@puppetlabs.com>2011-04-13 15:04:46 -0700
committerMatt Robinson <matt@puppetlabs.com>2011-04-13 15:04:46 -0700
commit008770dba7946b67f252561fecd967c7fe67fd17 (patch)
tree24be11a1aa3b7e8d2cce066b8c106dfc1e10443a
parent175803b7d27d7ab1be758dd779ca1568e429d096 (diff)
parent4ef622e0874c53c8060531d43da06f0fd6fddc36 (diff)
downloadpuppet-008770dba7946b67f252561fecd967c7fe67fd17.tar.gz
puppet-008770dba7946b67f252561fecd967c7fe67fd17.tar.xz
puppet-008770dba7946b67f252561fecd967c7fe67fd17.zip
Merge branch 'ticket/next/6830-more_ruby19_fixes' into next
* ticket/next/6830-more_ruby19_fixes: (#6830) Fix sha1 to digest/sha1 require issue for Ruby 1.9 (#6830) Fix UTF-8 encoding issue for Ruby 1.9 (#6830) Fix string method sub call on a symbol for Ruby 1.9
-rw-r--r--lib/puppet/interface/option_builder.rb2
-rw-r--r--lib/puppet/parser/functions/sha1.rb2
-rw-r--r--lib/puppet/transaction.rb8
-rwxr-xr-xspec/shared_behaviours/things_that_declare_options.rb1
4 files changed, 7 insertions, 6 deletions
diff --git a/lib/puppet/interface/option_builder.rb b/lib/puppet/interface/option_builder.rb
index 83a1906b0..2240b3e4a 100644
--- a/lib/puppet/interface/option_builder.rb
+++ b/lib/puppet/interface/option_builder.rb
@@ -19,7 +19,7 @@ class Puppet::Interface::OptionBuilder
Puppet::Interface::Option.instance_methods.grep(/=$/).each do |setter|
next if setter =~ /^=/ # special case, darn it...
- dsl = setter.sub(/=$/, '')
+ dsl = setter.to_s.sub(/=$/, '')
define_method(dsl) do |value| @option.send(setter, value) end
end
end
diff --git a/lib/puppet/parser/functions/sha1.rb b/lib/puppet/parser/functions/sha1.rb
index 10cc55cfe..1e7d5abe4 100644
--- a/lib/puppet/parser/functions/sha1.rb
+++ b/lib/puppet/parser/functions/sha1.rb
@@ -1,5 +1,5 @@
Puppet::Parser::Functions::newfunction(:sha1, :type => :rvalue, :doc => "Returns a SHA1 hash value from a provided string.") do |args|
- require 'sha1'
+ require 'digest/sha1'
Digest::SHA1.hexdigest(args[0])
end
diff --git a/lib/puppet/transaction.rb b/lib/puppet/transaction.rb
index 0533273d9..d7845fbc9 100644
--- a/lib/puppet/transaction.rb
+++ b/lib/puppet/transaction.rb
@@ -4,7 +4,7 @@
require 'puppet'
require 'puppet/util/tagging'
require 'puppet/application'
-require 'sha1'
+require 'digest/sha1'
class Puppet::Transaction
require 'puppet/transaction/event'
@@ -255,13 +255,13 @@ class Puppet::Transaction
# We want to monitor changes in the relationship graph of our
# catalog but this is complicated by the fact that the catalog
- # both is_a graph and has_a graph, by the fact that changes to
+ # both is_a graph and has_a graph, by the fact that changes to
# the structure of the object can have adverse serialization
# effects, by threading issues, by order-of-initialization issues,
- # etc.
+ # etc.
#
# Since the proper lifetime/scope of the monitoring is a transaction
- # and the transaction is already commiting a mild law-of-demeter
+ # and the transaction is already commiting a mild law-of-demeter
# transgression, we cut the Gordian knot here by simply wrapping the
# transaction's view of the resource graph to capture and maintain
# the information we need. Nothing outside the transaction needs
diff --git a/spec/shared_behaviours/things_that_declare_options.rb b/spec/shared_behaviours/things_that_declare_options.rb
index f7512dec0..ac358eacd 100755
--- a/spec/shared_behaviours/things_that_declare_options.rb
+++ b/spec/shared_behaviours/things_that_declare_options.rb
@@ -1,3 +1,4 @@
+# encoding: UTF-8
shared_examples_for "things that declare options" do
it "should support options without arguments" do
subject = add_options_to { option "--bar" }