sorbet 0.5.9465 → 0.5.9468

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6afc832b1325da617900136a15bbf52e4f81e4e9
4
- data.tar.gz: dfb3c3ba897682130de9d3352ea9b62dc057dcb0
3
+ metadata.gz: cc8f5ef00c313fde091fc992ce6e94296b1c072d
4
+ data.tar.gz: 8afd457b1a06bb7dd3419a3435c02e9d25bb1715
5
5
  SHA512:
6
- metadata.gz: 4bd6dbc5d79e633666e15be12aaeaa44a3e23e7d57ee74fbd92bc2c8d53c50dfd49ffb60cb7cf5bea9a4d8f8880b48b97867eeccf4331d48ebdd143938760bb3
7
- data.tar.gz: 43dfbcea5a44767cdf1722ca96956e2d35a16c553308337ef2b123eed1120495c1991403c95b460e28e02b00b4ea741f405f1a4ed2f0a417a54ccf58e501bb7d
6
+ metadata.gz: 9d620d9ed4da0ae9e2354973184845b6b424e423b943255af08cc58ac537033e198c021131eb6974cbd75550cc33e7906b55b061ee0bdb52b668217d3caa3e54
7
+ data.tar.gz: 876bae4587fbecb8c402d04d7f569fa5c8b54ce1b8467d2abb64ace1b812d0b53fc80fff729373ba85f30eb3b9f6c5cd61171dfb973127c04871d4271f70b910
@@ -220,13 +220,7 @@ module Sorbet::Private
220
220
  location&.match(/^.*\/(jruby)-([\d.]+)\//) || # jvm ruby stdlib
221
221
  location&.match(/^.*\/(site_ruby)\/([\d.]+)\//) # rubygems
222
222
  if match.nil?
223
- # uncomment to generate files for methods outside of gems
224
- # {
225
- # path: location,
226
- # gem: location.gsub(/[\/\.]/, '_'),
227
- # version: '1.0.0',
228
- # }
229
- nil
223
+ match_via_bundler_specs(location)
230
224
  else
231
225
  {
232
226
  path: match[0],
@@ -262,6 +256,44 @@ module Sorbet::Private
262
256
  return true if SPECIAL_METHOD_NAMES.include?(string)
263
257
  string =~ /^[[:word:]]+[?!=]?$/
264
258
  end
259
+
260
+ def match_via_bundler_specs(location)
261
+ @bundler_specs ||= begin
262
+ require 'bundler'
263
+ begin
264
+ Bundler.load.specs.map do |spec|
265
+ spec.load_paths.map do |path|
266
+ [path, [spec.name, spec.version.to_s]]
267
+ end
268
+ end.flatten(1).to_h
269
+ rescue Bundler::BundlerError # bail out on any bundler error
270
+ {}
271
+ end
272
+ rescue LoadError # bundler can't be loaded, abort!
273
+ {}
274
+ end
275
+
276
+ path_to_find = Pathname.new(location)
277
+ parent_path, (gem_name, gem_version) = @bundler_specs.detect do |path, _gem|
278
+ path_to_find.fnmatch?(File.join(path, '**'))
279
+ end
280
+
281
+ if parent_path.nil? || gem_name.nil? || gem_version.nil?
282
+ # uncomment to generate files for methods outside of gems
283
+ # {
284
+ # path: location,
285
+ # gem: location.gsub(/[\/\.]/, '_'),
286
+ # version: '1.0.0',
287
+ # }
288
+ nil
289
+ else
290
+ {
291
+ path: location,
292
+ gem: gem_name,
293
+ version: gem_version,
294
+ }
295
+ end
296
+ end
265
297
  end
266
298
  end
267
299
  end
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.9465
4
+ version: 0.5.9468
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-31 00:00:00.000000000 Z
11
+ date: 2022-01-04 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.9465
19
+ version: 0.5.9468
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.9465
26
+ version: 0.5.9468
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: minitest
29
29
  requirement: !ruby/object:Gem::Requirement