summaryrefslogtreecommitdiff
path: root/lib/bundler/cli
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2022-04-01 20:36:59 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2022-04-28 19:08:49 +0900
commit678d58c8508ec46aa270e3c5d81fc09cd0fee175 (patch)
tree34cbc8bb12e609d7a73e35c513090264360ffb49 /lib/bundler/cli
parent479ba9a44b6beda1dce32842bcbc66b6f46a85a0 (diff)
Merge rubygems master 1e4eda741d732ca1bd7031aef0a16c7348adf7a5
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5669
Diffstat (limited to 'lib/bundler/cli')
-rw-r--r--lib/bundler/cli/info.rb2
-rw-r--r--lib/bundler/cli/init.rb2
-rw-r--r--lib/bundler/cli/show.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/bundler/cli/info.rb b/lib/bundler/cli/info.rb
index 38bc008cb5..0545ce8c75 100644
--- a/lib/bundler/cli/info.rb
+++ b/lib/bundler/cli/info.rb
@@ -47,7 +47,7 @@ module Bundler
def print_gem_path(spec)
name = spec.name
if name == "bundler"
- path = File.expand_path("../../../..", __FILE__)
+ path = File.expand_path("../../..", __dir__)
else
path = spec.full_gem_path
if spec.deleted_gem?
diff --git a/lib/bundler/cli/init.rb b/lib/bundler/cli/init.rb
index d851d02d42..e4f8229c48 100644
--- a/lib/bundler/cli/init.rb
+++ b/lib/bundler/cli/init.rb
@@ -32,7 +32,7 @@ module Bundler
file << spec.to_gemfile
end
else
- FileUtils.cp(File.expand_path("../../templates/#{gemfile}", __FILE__), gemfile)
+ FileUtils.cp(File.expand_path("../templates/#{gemfile}", __dir__), gemfile)
end
puts "Writing new #{gemfile} to #{SharedHelpers.pwd}/#{gemfile}"
diff --git a/lib/bundler/cli/show.rb b/lib/bundler/cli/show.rb
index 5eaaba1ef7..2df13db1fa 100644
--- a/lib/bundler/cli/show.rb
+++ b/lib/bundler/cli/show.rb
@@ -18,7 +18,7 @@ module Bundler
if gem_name
if gem_name == "bundler"
- path = File.expand_path("../../../..", __FILE__)
+ path = File.expand_path("../../..", __dir__)
else
spec = Bundler::CLI::Common.select_spec(gem_name, :regex_match)
return unless spec