summaryrefslogtreecommitdiff
path: root/lib/chef.rb
diff options
context:
space:
mode:
authordanielsdeleo <dan@opscode.com>2013-11-15 12:17:42 -0800
committerdanielsdeleo <dan@opscode.com>2013-11-15 12:17:42 -0800
commit5d2e306bfd4030a5c27bd8a0b13da686db3a6b8a (patch)
treeb7fae4b6b79c1959ededae8501dd68df995ae91e /lib/chef.rb
parentecbc917ac5496f3138b798332ea66f477c33f8ba (diff)
downloadchef-5d2e306bfd4030a5c27bd8a0b13da686db3a6b8a.tar.gz
Backport URI::Generic#hostname to Ruby 1.9.2 and older
Documentation for URI::Generic#host in Ruby 2.0.0 explains: Since IPv6 addresses are wrapped by brackets in URIs, this method returns IPv6 addresses wrapped by brackets. This form is not appropriate to pass socket methods such as TCPSocket.open. If unwrapped host names are required, use “hostname” method. Therefore the best way to support IPv6 URIs is to replace calls to URI::Generic#host with URI::Generic#hostname. The #hostname method is added in Ruby 1.9.3 so we need to backport it for older ruby versions.
Diffstat (limited to 'lib/chef.rb')
-rw-r--r--lib/chef.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/chef.rb b/lib/chef.rb
index 3e5394b141..0d5fb3de2c 100644
--- a/lib/chef.rb
+++ b/lib/chef.rb
@@ -37,3 +37,5 @@ require 'chef/monkey_patches/string'
require 'chef/monkey_patches/numeric'
require 'chef/monkey_patches/object'
require 'chef/monkey_patches/file'
+require 'chef/monkey_patches/uri'
+