Skip to content

Commit

Permalink
[rubygems/rubygems] Remove unnecessary path local variable
Browse files Browse the repository at this point in the history
We can use `__dir__` directly.

rubygems/rubygems@0e6083ca94
  • Loading branch information
deivid-rodriguez authored and hsbt committed Aug 31, 2021
1 parent 97c0d3f commit 1d6551a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/bundler/installer/standalone.rb
Expand Up @@ -14,10 +14,9 @@ def generate
file.puts "require 'rbconfig'"
file.puts "ruby_engine = RUBY_ENGINE"
file.puts "ruby_version = RbConfig::CONFIG[\"ruby_version\"]"
file.puts "path = File.expand_path('..', __FILE__)"
file.puts reverse_rubygems_kernel_mixin
paths.each do |path|
file.puts %($:.unshift File.expand_path("\#{path}/#{path}"))
file.puts %($:.unshift File.expand_path("\#{__dir__}/#{path}"))
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/bundler/install/gems/standalone_spec.rb
Expand Up @@ -159,7 +159,7 @@
it "generates a bundle/bundler/setup.rb with the proper paths" do
expected_path = bundled_app("bundle/bundler/setup.rb")
extension_line = File.read(expected_path).each_line.find {|line| line.include? "/extensions/" }.strip
expect(extension_line).to start_with '$:.unshift File.expand_path("#{path}/../#{ruby_engine}/#{ruby_version}/extensions/'
expect(extension_line).to start_with '$:.unshift File.expand_path("#{__dir__}/../#{ruby_engine}/#{ruby_version}/extensions/'
expect(extension_line).to end_with '/very_simple_binary-1.0")'
end
end
Expand Down

0 comments on commit 1d6551a

Please sign in to comment.