Skip to content

Commit

Permalink
[rubygems/rubygems] Remove unnecessary ruby_engine local variable
Browse files Browse the repository at this point in the history
Under some case, this variable might not end up being used, in which
case running the script would print unused variable warnings.

rubygems/rubygems@a2d6392ada
  • Loading branch information
deivid-rodriguez authored and hsbt committed Aug 31, 2021
1 parent 1d6551a commit 3aa087d
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 @@ -12,7 +12,6 @@ def generate
end
File.open File.join(bundler_path, "setup.rb"), "w" do |file|
file.puts "require 'rbconfig'"
file.puts "ruby_engine = RUBY_ENGINE"
file.puts "ruby_version = RbConfig::CONFIG[\"ruby_version\"]"
file.puts reverse_rubygems_kernel_mixin
paths.each do |path|
Expand All @@ -27,7 +26,7 @@ def paths
@specs.map do |spec|
next if spec.name == "bundler"
Array(spec.require_paths).map do |path|
gem_path(path, spec).sub(version_dir, '#{ruby_engine}/#{ruby_version}')
gem_path(path, spec).sub(version_dir, '#{RUBY_ENGINE}/#{ruby_version}')
# This is a static string intentionally. It's interpolated at a later time.
end
end.flatten.compact
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("#{__dir__}/../#{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 3aa087d

Please sign in to comment.