sorbet-runtime 0.6.13277 → 0.6.13279

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: 2205d03d1b0986fb0660902a75836d623c48307ad1b7c3b32b4a44ad79fe3c8c
4
- data.tar.gz: 4a38dae4916789de65364bfe2bcb44f68fc1abf80c410b285013ffa1b540b902
3
+ metadata.gz: 94f9430afda35cc983dbaf2b2ece5ce0f8528c3e3928497a9a659f5f177f7a69
4
+ data.tar.gz: a7b483b8aacb2b23c95a152af38b37cd6c99fba0803bd950a56edfed6bd57922
5
5
  SHA512:
6
- metadata.gz: c9835bded347ddabb8ea4ca593150f6d37aa676c01eff1ccc652fb176c8ca11886f6bbb303f454d40c6b0c366bd375c4d7781e277d654e7c55dc5dd11b034481
7
- data.tar.gz: 625b9908b3f1732a2440252835719c8d6dd46160df04fb45622bd720f142274d4c06ffb0ffe5b01ae4fef73ef6baba5677abb91f72242ff8809a7066cd76eafd
6
+ metadata.gz: a0c5963cf3184b283798aaaf31cec437eb366f435f9daeb29a8840f949b7062f2cd460cd80cfb075082f126d9e49850dbd2f6f3741ce3ef3b0a8d733be8f7c8d
7
+ data.tar.gz: 663c026581f6a6a4bb5d2be94177b0cf839e31bd4a05f7cc9e9f24ada3f5ee7e844c2ead306ac91bfc2e73acb27cfac7925008509b1122fe3f37acb7793369a1
@@ -60,18 +60,18 @@ if defined? ::RSpec::Core::MemoizedHelpers::ClassMethods
60
60
  # `let!`, `subject`, and `subject!` are implemented by dispatching to
61
61
  # `let`, so this should cover those methods too.
62
62
  def let(name, &block)
63
- # TODO(jez) This will need to use consume!
64
-
65
- current_declaration = T::Private::DeclState.current.active_declaration
66
- return super unless current_declaration
67
- T::Private::DeclState.current.reset!
63
+ res = T::Private::DeclState.current.without_on_method_added do
64
+ # Allow the `let`-defined methods to be defined
65
+ super
66
+ end
68
67
 
69
- # Allow the `let`-defined methods to be defined
70
- super
68
+ return res unless T::Private::DeclState.current.active_declaration
71
69
 
72
- # Stash the sig and re-define the method RSpec just defined. This
73
- # ensures that the `sig` attaches to the outer method, not any
74
- # method inside the LetDefinitions module.
70
+ # Force the `sig` to attach to the outer `let`-defined method,
71
+ # not the one inside the `LetDefinitions` module. Re-running
72
+ # `define_method` with the method we grab via reflection there
73
+ # triggers the `method_added`, which allows the active_declaration
74
+ # to be consumed.
75
75
  #
76
76
  # Unfortunately, this means that the runtime checks are not
77
77
  # memoized (but they never were).
@@ -80,11 +80,11 @@ if defined? ::RSpec::Core::MemoizedHelpers::ClassMethods
80
80
  # written inside the `LetDefinitions` module didn't work, because
81
81
  # things like `sig {override}` broke: the `LetDefinitions` module
82
82
  # has no ancestors and thus does not override anything)
83
-
84
83
  method = instance_method(name)
85
84
  remove_method(name)
86
- T::Private::DeclState.current.active_declaration = current_declaration
87
85
  define_method(name, method)
86
+
87
+ res
88
88
  end
89
89
  end
90
90
  ::RSpec::Core::MemoizedHelpers::ClassMethods.prepend(MemoizedHelpers)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sorbet-runtime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.13277
4
+ version: 0.6.13279
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe