Skip to content

Commit 6c161b2

Browse files
committed
Use Dir.pwd instead of Pathname.pwd
1 parent 89e95d0 commit 6c161b2

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

bundler/lib/bundler/cli/gem.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def initialize(options, gem_name, thor)
2424
thor.destination_root = nil
2525

2626
@name = @gem_name
27-
@target = SharedHelpers.pwd.join(gem_name)
27+
@target = Pathname.new(SharedHelpers.pwd).join(gem_name)
2828

2929
@extension = options[:ext]
3030

@@ -276,7 +276,7 @@ def run
276276
private
277277

278278
def resolve_name(name)
279-
SharedHelpers.pwd.join(name).basename.to_s
279+
Pathname.new(SharedHelpers.pwd).join(name).basename.to_s
280280
end
281281

282282
def ask_and_set(key, prompt, explanation)

bundler/lib/bundler/shared_helpers.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def chdir(dir, &blk)
5555

5656
def pwd
5757
Bundler.rubygems.ext_lock.synchronize do
58-
Pathname.pwd
58+
Dir.pwd
5959
end
6060
end
6161

bundler/lib/bundler/source/path.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def initialize(options)
2424
@path = Pathname.new(options["path"])
2525
expanded_path = expand(@path)
2626
@path = if @path.relative?
27-
expanded_path.relative_path_from(root_path.expand_path)
27+
expanded_path.relative_path_from(File.expand_path(root_path))
2828
else
2929
expanded_path
3030
end

bundler/spec/bundler/shared_helpers_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159
let(:pwd_stub) { nil }
160160

161161
it "returns the current absolute path" do
162-
expect(subject.pwd).to eq(source_root)
162+
expect(subject.pwd).to eq(source_root.to_s)
163163
end
164164
end
165165

0 commit comments

Comments
 (0)