sorbet-runtime-stub 0.1.4 → 0.2.0

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
  SHA256:
3
- metadata.gz: 28842eac1f246fb87f48035e1b8744a39ac2b617ae9ce0368343fe1372bad270
4
- data.tar.gz: 24d7ac572b3486b5c0b5972318dd2d0dc9edde21928be92d87ee1a7fa3ac93c9
3
+ metadata.gz: 5dca978548461e34360c9512ab5ba44c3c9c9dc8919ea5bcd623b7c3722949b3
4
+ data.tar.gz: ccd4bd92e83185a10770444d5405b09c6b113d09d4e3f1b69e1be247c914fff1
5
5
  SHA512:
6
- metadata.gz: eb1f59083dbc03b89c703d1f7c50bb34c2bfebd61f274e9a03405cb8d69af9e47fc02be89285300f799b9787aee25d5d3907c3e287099a1e18ff643e59114b4a
7
- data.tar.gz: a8ef5a270bb6a77187b177bb5f361b9b57ce68a1d874346c61158ea89b3c5b3532a8e321c1480ae08a0bdf200b9af7569a9693a302df1e4f2767cffdf48b086b
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
- Your code should decide to switch between requiring `sorbet-runtime` or `sorbet-runtime-stub`.
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
- For example, if you don't want to load `sorbet-runtime` in a production environment in a Rails app, you can use:
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
 
@@ -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.1.4
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-05-05 00:00:00.000000000 Z
11
+ date: 2020-07-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: