From: Daniele Sluijters Date: Sun, 16 Mar 2014 11:44:05 +0000 (+0100) Subject: Use File.expand_path with require. X-Git-Tag: 1.5.0~20^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=cc1f9c8bb900ed3da48e794a2185c9e17b4df9a4;p=puppet-modules%2Fpuppetlabs-apt.git Use File.expand_path with require. For some reason, even though our own tests pass with `require puppet_x/apt_key/patch_openuri` every other module that depends on puppetlabs-apt is now breaking in tests claiming it can't load that module. Somewhere along the way something is probably messing with LOADPATH causing this to trip up. This should fix the issues for everyone. This commit affects: * puppetlabs/puppetlabs-apt#229 * puppetlabs/puppetlabs-postgresql#391 --- diff --git a/lib/puppet/provider/apt_key/apt_key.rb b/lib/puppet/provider/apt_key/apt_key.rb index 51791d0..f8d4072 100644 --- a/lib/puppet/provider/apt_key/apt_key.rb +++ b/lib/puppet/provider/apt_key/apt_key.rb @@ -6,7 +6,8 @@ require 'tempfile' if RUBY_VERSION == '1.8.7' # Mothers cry, puppies die and Ruby 1.8.7's open-uri needs to be # monkeypatched to support passing in :ftp_passive_mode. - require 'puppet_x/apt_key/patch_openuri' + require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', + 'puppet_x', 'apt_key', 'patch_openuri.rb')) OpenURI::Options.merge!({:ftp_active_mode => false,}) end