Skip to content

Commit 0afbb6e

Browse files
authored
Merge branch 'master' into dependabot/bundler/examples/simple_rails_api/tzinfo-1.2.10
2 parents 66d6546 + 25ef123 commit 0afbb6e

File tree

3 files changed

+25
-9
lines changed

3 files changed

+25
-9
lines changed

examples/simple_script/Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ source 'https://rubygems.org'
55
gem 'awesome_print'
66
gem 'colored2'
77
gem 'rspec', '~> 3.7.0'
8-
gem 'rspec-its'
8+
gem 'rspec-its', github: "rspec/rspec-its", ref: "3d36b4a7b004ffa204a0e392f27c8b6b0b674ecf" # v1.3.0
99
gem 'rubocop'

examples/simple_script/Gemfile.lock

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
GIT
2+
remote: https://github.com/rspec/rspec-its.git
3+
revision: 3d36b4a7b004ffa204a0e392f27c8b6b0b674ecf
4+
ref: 3d36b4a7b004ffa204a0e392f27c8b6b0b674ecf
5+
specs:
6+
rspec-its (1.3.0)
7+
rspec-core (>= 3.0.0)
8+
rspec-expectations (>= 3.0.0)
9+
110
GEM
211
remote: https://rubygems.org/
312
specs:
@@ -20,9 +29,6 @@ GEM
2029
rspec-expectations (3.7.0)
2130
diff-lcs (>= 1.2.0, < 2.0)
2231
rspec-support (~> 3.7.0)
23-
rspec-its (1.3.0)
24-
rspec-core (>= 3.0.0)
25-
rspec-expectations (>= 3.0.0)
2632
rspec-mocks (3.7.0)
2733
diff-lcs (>= 1.2.0, < 2.0)
2834
rspec-support (~> 3.7.0)
@@ -48,7 +54,7 @@ DEPENDENCIES
4854
awesome_print
4955
colored2
5056
rspec (~> 3.7.0)
51-
rspec-its
57+
rspec-its!
5258
rubocop
5359

5460
BUNDLED WITH

ruby/private/bundle/create_bundle_build_file.rb

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,12 +252,22 @@ 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-
gem_path = GEM_PATH[ruby_version, spec.name, spec.version]
256-
spec_path = SPEC_PATH[ruby_version, spec.name, spec.version]
257255
base_dir = "lib/ruby/#{ruby_version}"
256+
if spec.source.is_a?(Bundler::Source::Git)
257+
stub = spec.source.specs.find { |s| s.name == spec.name }.stub
258+
gem_path = "#{base_dir}/bundler/gems/#{Pathname(stub.full_gem_path).relative_path_from(stub.base_dir)}"
259+
spec_path = "#{base_dir}/bundler/gems/#{Pathname(stub.loaded_from).relative_path_from(stub.base_dir)}"
260+
261+
# paths to register to $LOAD_PATH
262+
require_paths = stub.require_paths
263+
else
264+
gem_path = GEM_PATH[ruby_version, spec.name, spec.version]
265+
spec_path = SPEC_PATH[ruby_version, spec.name, spec.version]
266+
267+
# paths to register to $LOAD_PATH
268+
require_paths = Gem::StubSpecification.gemspec_stub(spec_path, base_dir, "#{base_dir}/gems").require_paths
269+
end
258270

259-
# paths to register to $LOAD_PATH
260-
require_paths = Gem::StubSpecification.gemspec_stub(spec_path, base_dir, "#{base_dir}/gems").require_paths
261271
# Usually, registering the directory paths listed in the `require_paths` of gemspecs is sufficient, but
262272
# some gems also require additional paths to be included in the load paths.
263273
require_paths += include_array(spec.name)

0 commit comments

Comments
 (0)