sorbet 0.4.4560 → 0.4.4561

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/require_everything.rb +15 -3
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 39d18c41fe349a61d0447fa2934e85faa4102fba
4
- data.tar.gz: 909fbee905b92a2868e8440d9e52946ed54036b7
3
+ metadata.gz: 0d3f69e912babc5f3cbee29abc38a454701a5e49
4
+ data.tar.gz: 6caa38beadd9e991d68a597b49d28e1dee9baee6
5
5
  SHA512:
6
- metadata.gz: a88ffbbcabea6e99ac02c80e231693088af5c53650829232b97e2b123b52fa9cbee15c3759d164eced7f231ef16be0884c824fb97add5759e6c63ab3d07fa382
7
- data.tar.gz: fec26124064d5fc509cfd377c2513a74b0d06a8dca4df5581faddda6fb8f4cad853f7b74b950e6cd567e9ba94742387365badeccbed937fa4167e1b8f9315a97
6
+ metadata.gz: d4708be53cab49168b6975d6625e54bf1c3b745cc37f68b9d70e239089c6ede4491fe05f8590b9ab5cd65f44fb0acc8e16d13b7bbf0cbde4136ab67672d581cc
7
+ data.tar.gz: 262d8992bdefe9bfaacc25c793281f2706a88150b701d64511745a7b800e1d2322d87e6c7c2453bd44eebef5c41464e8dc7ab2a9f8a476e3395fc863a1f548d2
@@ -139,9 +139,7 @@ class Sorbet::Private::RequireEverything
139
139
  excluded_paths = Set.new
140
140
 
141
141
  # Exclude files that have already been loaded by rails
142
- rails = Object.const_get(:Rails)
143
- load_paths = rails.application.send(:_all_load_paths)
144
- load_paths.each do |path|
142
+ self.rails_load_paths.each do |path|
145
143
  excluded_paths += Dir.glob("#{path}/**/*.rb")
146
144
  end
147
145
 
@@ -151,6 +149,20 @@ class Sorbet::Private::RequireEverything
151
149
  excluded_paths += Dir.glob("#{Dir.pwd}/config/initializers/**/*.rb")
152
150
  end
153
151
 
152
+ def self.rails_load_paths
153
+ rails = Object.const_get(:Rails)
154
+
155
+ # As per changes made to change the arity of this method:
156
+ # https://github.com/rails/rails/commit/b6e17b6a4b67ccc9fac5fe16741c3db720f00959
157
+ # This sets the `add_autoload_paths_to_load_path` parameter to `true` which will
158
+ # provide parity with older versions of Rails prior to the mentioned commit.
159
+ if Gem::Version.new(rails.version) >= Gem::Version.new('6.0.0.rc2')
160
+ rails.application.send(:_all_load_paths, true)
161
+ else
162
+ rails.application.send(:_all_load_paths)
163
+ end
164
+ end
165
+
154
166
  def self.rails?
155
167
  return false unless File.exist?('config/application.rb')
156
168
  begin
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sorbet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4560
4
+ version: 0.4.4561
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.4.4560
19
+ version: 0.4.4561
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.4.4560
26
+ version: 0.4.4561
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: minitest
29
29
  requirement: !ruby/object:Gem::Requirement