summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel E. Giddins <segiddins@segiddins.me>2015-05-27 21:31:17 -0700
committerSamuel E. Giddins <segiddins@segiddins.me>2015-05-28 10:03:37 -0700
commit7d31c4366d81e9ed5c2cede17f4cdafe2a23fb22 (patch)
tree4a3cf57f50a569d392d64402672546572b07373a
parent8f7d9442cce3dd3460119d81963eacc3ad5c3018 (diff)
downloadbundler-7d31c4366d81e9ed5c2cede17f4cdafe2a23fb22.tar.gz
Use synchronized pwd everywhere
-rw-r--r--lib/bundler/cli/gem.rb4
-rw-r--r--lib/bundler/cli/init.rb6
-rw-r--r--lib/bundler/inline.rb2
-rw-r--r--lib/bundler/source/git/git_proxy.rb2
4 files changed, 7 insertions, 7 deletions
diff --git a/lib/bundler/cli/gem.rb b/lib/bundler/cli/gem.rb
index cbbaa277e7..89058ca640 100644
--- a/lib/bundler/cli/gem.rb
+++ b/lib/bundler/cli/gem.rb
@@ -10,7 +10,7 @@ module Bundler
@thor = thor
@name = @gem_name
- @target = Pathname.pwd.join(gem_name)
+ @target = SharedHelpers.pwd.join(gem_name)
validate_ext_name if options[:ext]
end
@@ -134,7 +134,7 @@ module Bundler
private
def resolve_name(name)
- Pathname.pwd.join(name).basename.to_s
+ SharedHelpers.pwd.join(name).basename.to_s
end
def ask_and_set(key, header, message)
diff --git a/lib/bundler/cli/init.rb b/lib/bundler/cli/init.rb
index d6b2e7422d..fbf17424c4 100644
--- a/lib/bundler/cli/init.rb
+++ b/lib/bundler/cli/init.rb
@@ -7,7 +7,7 @@ module Bundler
def run
if File.exist?("Gemfile")
- Bundler.ui.error "Gemfile already exists at #{Dir.pwd}/Gemfile"
+ Bundler.ui.error "Gemfile already exists at #{SharedHelpers.pwd}/Gemfile"
exit 1
end
@@ -18,13 +18,13 @@ module Bundler
exit 1
end
spec = Gem::Specification.load(gemspec)
- puts "Writing new Gemfile to #{Dir.pwd}/Gemfile"
+ puts "Writing new Gemfile to #{SharedHelpers.pwd}/Gemfile"
File.open('Gemfile', 'wb') do |file|
file << "# Generated from #{gemspec}\n"
file << spec.to_gemfile
end
else
- puts "Writing new Gemfile to #{Dir.pwd}/Gemfile"
+ puts "Writing new Gemfile to #{SharedHelpers.pwd}/Gemfile"
FileUtils.cp(File.expand_path('../../templates/Gemfile', __FILE__), 'Gemfile')
end
end
diff --git a/lib/bundler/inline.rb b/lib/bundler/inline.rb
index 99ee98db04..81cab1984d 100644
--- a/lib/bundler/inline.rb
+++ b/lib/bundler/inline.rb
@@ -31,7 +31,7 @@ def gemfile(install = false, &gemfile)
require 'bundler'
old_root = Bundler.method(:root)
def Bundler.root
- Pathname.pwd.expand_path
+ SharedHelpers.pwd.expand_path
end
ENV['BUNDLE_GEMFILE'] ||= 'Gemfile'
diff --git a/lib/bundler/source/git/git_proxy.rb b/lib/bundler/source/git/git_proxy.rb
index 89c784e0fa..6d2cec09b9 100644
--- a/lib/bundler/source/git/git_proxy.rb
+++ b/lib/bundler/source/git/git_proxy.rb
@@ -21,7 +21,7 @@ module Bundler
class GitCommandError < GitError
def initialize(command, path = nil)
- msg = "Git error: command `git #{command}` in directory #{Dir.pwd} has failed."
+ msg = "Git error: command `git #{command}` in directory #{SharedHelpers.pwd} has failed."
msg << "\nIf this error persists you could try removing the cache directory '#{path}'" if path && path.exist?
super msg
end