sorbet-runtime 0.5.9195 → 0.5.9218

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3db4ec91dce4c52303e8c13ba0ae8605f8f4dc954ad15ae455c3cac3f4e15ed3
4
- data.tar.gz: e874774df6cb201146d1db7033e35f63f0ddbe20349c85cf40420139e4787547
3
+ metadata.gz: 50debdab68e222f1e7e09dc2ffd9b715e89ea9f40fb4488578c3d1475e3dc3d7
4
+ data.tar.gz: 0d5baa83dd4cf79d41464d0742cebfd3b340d8629c73a7f8c4ef5551b6141499
5
5
  SHA512:
6
- metadata.gz: f70c31fe47e4bfb0de9b2b579e41dfff6daa40b051dfff13f031fc01672697f1d575b542512cae1ec6a1b202fb72f0951d066d05b4afc2662014e6c5e1addf01
7
- data.tar.gz: 34df15e3d5ec575898f3442d697cba6887af7884ed9b6a5eebaf9bf066527d39ab29c14f8e77464ef8d8b83016534146f5ca2bd24e6d855d0d76f6b6823312f1
6
+ metadata.gz: bf03b57017b4b7659011b55f4dd8cc23c5be26a090f6e97d8e6c65aea1937df379c23468187690f669c8ab99095806c8d45f0f7de0b0613c2f602f25b9c0b4d5
7
+ data.tar.gz: 5db711732ff8dd1d84f1b097bfdda2bc01af31758b77ccd39d541e115615eb1f41c429647d42b18ed67bd5606daa5cada725f423678c8d28a14add8b4d437a75
data/lib/types/helpers.rb CHANGED
@@ -4,6 +4,8 @@
4
4
  # Use as a mixin with extend (`extend T::Helpers`).
5
5
  # Docs at https://confluence.corp.stripe.com/display/PRODINFRA/Ruby+Types
6
6
  module T::Helpers
7
+ extend T::Sig
8
+
7
9
  Private = T::Private
8
10
 
9
11
  ### Class/Module Helpers ###
@@ -44,7 +46,7 @@ module T::Helpers
44
46
  # module MyHelper
45
47
  # extend T::Helpers
46
48
  #
47
- # requires_ancestor Kernel
49
+ # requires_ancestor { Kernel }
48
50
  # end
49
51
  #
50
52
  # class MyClass < BasicObject # error: `MyClass` must include `Kernel` (required by `MyHelper`)
@@ -52,5 +54,5 @@ module T::Helpers
52
54
  # end
53
55
  #
54
56
  # TODO: implement the checks in sorbet-runtime.
55
- def requires_ancestor(mod, *mods); end
57
+ def requires_ancestor(*mods, &block); end
56
58
  end
@@ -40,6 +40,11 @@ module T::Private::Abstract::Declare
40
40
  end
41
41
  super(*args, &blk)
42
42
  end
43
+
44
+ # Ruby doesn not emit "method redefined" warnings for aliased methods
45
+ # (more robust than undef_method that would create a small window in which the method doesn't exist)
46
+ mod.send(:alias_method, :initialize, :initialize)
47
+
43
48
  if mod.respond_to?(:ruby2_keywords, true)
44
49
  mod.send(:ruby2_keywords, :initialize)
45
50
  end
@@ -83,6 +83,11 @@ module T::Props
83
83
  lazily_defined_methods[name] = blk
84
84
 
85
85
  cls = decorated_class
86
+ if cls.method_defined?(name)
87
+ # Ruby doesn not emit "method redefined" warnings for aliased methods
88
+ # (more robust than undef_method that would create a small window in which the method doesn't exist)
89
+ cls.send(:alias_method, name, name)
90
+ end
86
91
  cls.send(:define_method, name) do |*args|
87
92
  self.class.decorator.send(:eval_lazily_defined_method!, name)
88
93
  send(name, *args)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sorbet-runtime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.9195
4
+ version: 0.5.9218
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-05 00:00:00.000000000 Z
11
+ date: 2021-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest