sorbet-runtime-stub 0.1.4 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +5 -2
- data/lib/sorbet-runtime-stub.rb +7 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5dca978548461e34360c9512ab5ba44c3c9c9dc8919ea5bcd623b7c3722949b3
|
4
|
+
data.tar.gz: ccd4bd92e83185a10770444d5405b09c6b113d09d4e3f1b69e1be247c914fff1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fae1011e19d1918b925be5f70be4d63d7fb70bf6bdfd84764767188b5fd4b8a2c687a39b6a1d737043e54bb0b3e148a7b68d20d75c081f0096bbaa5e2733589
|
7
|
+
data.tar.gz: 7b2f1ea011bc627a5f5e3d309ef63bcad16912cec494b4f62683f1dff168a46e46ceec5bd286a2095f303d019cf100649c119f907f8fc87564012e895f4f6db9
|
data/README.md
CHANGED
@@ -22,9 +22,11 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
|
25
|
+
The most critical thing when loading `sorbet-runtime-stub` is to never overwrite methods defined by `sorbet-runtime`, since this would cause silent suppression of runtime type checking.
|
26
26
|
|
27
|
-
|
27
|
+
Thus, this gem will never load stub definitions if `sorbet-runtime` is present as a loadable gem in the application context. This means that on projects that do not use Bundler, this gem will not install stub definitions, if `sorbet-runtime` is installed as a gem (but it will also not load `sorbet-runtime`). On projects that use Bundler, this gem will not install stub definitions, if `sorbet-runtime` exists in the `Gemfile` for the currently running group.
|
28
|
+
|
29
|
+
Thus, if you don't want to load `sorbet-runtime` in a production environment in a Rails app, you need to use:
|
28
30
|
```ruby
|
29
31
|
if ENV['RAILS_ENV'] == 'production'
|
30
32
|
require 'sorbet-runtime-stub'
|
@@ -32,6 +34,7 @@ else
|
|
32
34
|
require 'sorbet-runtime'
|
33
35
|
end
|
34
36
|
```
|
37
|
+
and add `sorbet-runtime` to your `Gemfile` only for `development` and `test` groups.
|
35
38
|
|
36
39
|
## Missing features
|
37
40
|
|
data/lib/sorbet-runtime-stub.rb
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# typed: ignore
|
2
2
|
|
3
|
+
begin
|
4
|
+
gem "sorbet-runtime"
|
5
|
+
return
|
6
|
+
rescue Gem::LoadError
|
7
|
+
end
|
8
|
+
|
3
9
|
module T
|
4
10
|
class << self
|
5
11
|
def absurd(value); end
|
@@ -45,7 +51,7 @@ module T
|
|
45
51
|
end
|
46
52
|
|
47
53
|
module Sig
|
48
|
-
def sig(&blk); end
|
54
|
+
def sig(arg0=nil, &blk); end
|
49
55
|
end
|
50
56
|
|
51
57
|
module Helpers
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sorbet-runtime-stub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|