Skip to content

Commit ecb0e81

Browse files
committed
Refactor to move same def var before if
1 parent d61b643 commit ecb0e81

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

ruby/private/bundle/create_bundle_build_file.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,9 @@ def register_gem(spec, template_out, bundle_lib_paths, bundle_binaries)
252252
# Do not register local gems
253253
return if spec.source.path?
254254

255+
base_dir = "lib/ruby/#{ruby_version}"
255256
if spec.source.is_a?(Bundler::Source::Git)
256257
stub = spec.source.specs.find { |s| s.name == spec.name }.stub
257-
base_dir = "lib/ruby/#{ruby_version}"
258258
gem_path = "#{base_dir}/bundler/gems/#{Pathname(stub.full_gem_path).relative_path_from(stub.base_dir)}"
259259
spec_path = "#{base_dir}/bundler/gems/#{Pathname(stub.loaded_from).relative_path_from(stub.base_dir)}"
260260

@@ -263,7 +263,6 @@ def register_gem(spec, template_out, bundle_lib_paths, bundle_binaries)
263263
else
264264
gem_path = GEM_PATH[ruby_version, spec.name, spec.version]
265265
spec_path = SPEC_PATH[ruby_version, spec.name, spec.version]
266-
base_dir = "lib/ruby/#{ruby_version}"
267266

268267
# paths to register to $LOAD_PATH
269268
require_paths = Gem::StubSpecification.gemspec_stub(spec_path, base_dir, "#{base_dir}/gems").require_paths

0 commit comments

Comments
 (0)