sorbet-runtime 0.5.6164 → 0.5.6173
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/types/configuration.rb +21 -0
- data/lib/types/props/private/serde_transform.rb +1 -5
- 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: a9d4581ed43e607f92b1f5f6ad970c3c644c6f2e406f5389e52936f6664b4ba6
|
4
|
+
data.tar.gz: 887f7dd88808b820f4e6ef28d11d2ba2302cb94ee0853551ee624db7442f73cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca2e60518c4f7c03e56977394925e353090a555260f9c51fbca487c68ee43503ddc715ba12e319a7c58c2ca173d6222234d02785a89d36a02479385a2c775cb6
|
7
|
+
data.tar.gz: ead7aa46dc4a488be9cbf8224aafa03fc15e7d569e5374bd6faaef1e97e1ca17b1bf28ef15deaa5f04bb1a0ad60331a6fded469744f4dace9c25ad22188360e3
|
data/lib/types/configuration.rb
CHANGED
@@ -363,6 +363,27 @@ module T::Configuration
|
|
363
363
|
@scalar_types || @default_scalar_types
|
364
364
|
end
|
365
365
|
|
366
|
+
# Guard against overrides of `name` or `to_s`
|
367
|
+
MODULE_NAME = Module.instance_method(:name)
|
368
|
+
private_constant :MODULE_NAME
|
369
|
+
|
370
|
+
@default_module_name_mangler = ->(type) {MODULE_NAME.bind(type).call}
|
371
|
+
@module_name_mangler = nil
|
372
|
+
|
373
|
+
def self.module_name_mangler
|
374
|
+
@module_name_mangler || @default_module_name_mangler
|
375
|
+
end
|
376
|
+
|
377
|
+
# Set to override the default behavior for converting types
|
378
|
+
# to names in generated code. Used by the runtime implementation
|
379
|
+
# associated with `--stripe-packages` mode.
|
380
|
+
#
|
381
|
+
# @param [Lambda, Proc, nil] value Proc that converts a type (Class/Module)
|
382
|
+
# to a String (pass nil to reset to default behavior)
|
383
|
+
def self.module_name_mangler=(handler)
|
384
|
+
@module_name_mangler = handler
|
385
|
+
end
|
386
|
+
|
366
387
|
# Temporarily disable ruby warnings while executing the given block. This is
|
367
388
|
# useful when doing something that would normally cause a warning to be
|
368
389
|
# emitted in Ruby verbose mode ($VERBOSE = true).
|
@@ -177,13 +177,9 @@ module T::Props
|
|
177
177
|
end
|
178
178
|
end
|
179
179
|
|
180
|
-
# Guard against overrides of `name` or `to_s`
|
181
|
-
MODULE_NAME = T.let(Module.instance_method(:name), UnboundMethod)
|
182
|
-
private_constant :MODULE_NAME
|
183
|
-
|
184
180
|
sig {params(type: Module).returns(T.nilable(String)).checked(:never)}
|
185
181
|
private_class_method def self.module_name(type)
|
186
|
-
|
182
|
+
T::Configuration.module_name_mangler.call(type)
|
187
183
|
end
|
188
184
|
end
|
189
185
|
end
|
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.
|
4
|
+
version: 0.5.6173
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|