sorbet 0.5.5417 → 0.5.5420

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gem_loader.rb +14 -7
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 38863fe6f21cca05325bc17a00b1ce80a07ee3a4
4
- data.tar.gz: 92cb1fe399624cba3ecef7aa782557fd6d0a7550
3
+ metadata.gz: 17b8d33c4accdfd1479095a6b586e4617923b019
4
+ data.tar.gz: 2e8eb2c61fc0b417861480e29c15c45bcb72adcf
5
5
  SHA512:
6
- metadata.gz: da436b37d15ce226c32d95105857e2a10917e953743ab10d067c7c591ce3c97fd23292b3fbe63c489e164157600c752d6aba4e04d715e3d752572cc79bc76295
7
- data.tar.gz: 7a9e9bb13a8ec711c2227db3721d5313f25cbe5fef39df86a5eaae3707d38d33835ec05565129146f0c7901709623f953e799f419962d758c463cec0b74ddbcf
6
+ metadata.gz: c09bcad05664762e0ea4928d7dfee28d3c9a8caf4d883957b5117cd9202fc56fc85a677dab9ba682221ec2ab076218f53c33804f970baa271a175f990a1848df
7
+ data.tar.gz: c0dcfa343a5d6227fc2f1e74dfd82d386c180cc11777b8f5c35217dfbdf00f9302518a6d8a3fa18892b991edc9ead879af4b5894e8c8255d8f2249111cf6676f
@@ -950,16 +950,23 @@ class Sorbet::Private::GemLoader
950
950
 
951
951
  def self.require_all_gems
952
952
  require 'bundler/setup'
953
+ require 'bundler/lockfile_parser'
953
954
 
955
+ specs = []
956
+ lockfile_parser = Bundler::LockfileParser.new(File.read(Bundler.default_lockfile))
954
957
  # Do not load gems in Gemfile where require is false
955
- deps = Bundler.load.dependencies.reject { |dep| dep.autorequire && dep.autorequire.empty? }
956
- specs = deps.flat_map do |dep|
957
- begin
958
- dep.to_specs
959
- rescue Gem::MissingSpecError
960
- []
958
+ dependencies = lockfile_parser.dependencies.reject { |name, dep| dep.autorequire && dep.autorequire.empty? }
959
+ required_dependency_names = dependencies.values.map(&:name)
960
+ lockfile_parser.specs.each do |spec|
961
+ # Only include the spec for a gem and it's dependencies if it's autorequired.
962
+ if required_dependency_names.include?(spec.name)
963
+ specs << spec
964
+ specs << spec.dependencies
961
965
  end
962
- end.to_set
966
+ end
967
+ specs.flatten!
968
+ specs.uniq! { |spec| spec.name }
969
+ specs = specs.to_set
963
970
 
964
971
  specs.sort_by(&:name).each do |gemspec|
965
972
  begin
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sorbet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5417
4
+ version: 0.5.5420
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-05 00:00:00.000000000 Z
11
+ date: 2020-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sorbet-static
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.5.5417
19
+ version: 0.5.5420
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.5.5417
26
+ version: 0.5.5420
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: minitest
29
29
  requirement: !ruby/object:Gem::Requirement