sorbet 0.4.5109 → 0.4.5140
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/srb +22 -0
- data/lib/gem-generator-tracepoint/tracepoint_serializer.rb +2 -1
- data/lib/gem-generator-tracepoint/tracer.rb +13 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cdb64f65dfc92cd880d73d8a408ddc9b4120543
|
4
|
+
data.tar.gz: ab2bb80ee6473d1d447a95c29f44998ee049e030
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7017768a2264337f29237a088b28283774f44929a50b86abc98e833d3d9209926677d14670a61e0ef83078be00c681c1645f6f0389569a390869d9045e0b1061
|
7
|
+
data.tar.gz: 575fab70e06c594eeb57056e3ef560690e90fe48b55da990731cc0f8720c8127e9dc15ebc50c46a91efe5b919f5349ea5fcb3832f50324a159456a2afc0bb7d7
|
data/bin/srb
CHANGED
@@ -70,6 +70,7 @@ typecheck() {
|
|
70
70
|
version_suffix="${without_bin_srb##*/sorbet}"
|
71
71
|
# /path/to/gems
|
72
72
|
gems_path="${without_bin_srb%/sorbet*}"
|
73
|
+
|
73
74
|
# /path/to/gems/sorbet-static-0.0.1-darwin-17/libexec/sorbet
|
74
75
|
# (assumes people only have one platform-depdendent gem installed per version)
|
75
76
|
guess_sorbet=("$gems_path/sorbet-static$version_suffix"*/libexec/sorbet)
|
@@ -83,6 +84,27 @@ typecheck() {
|
|
83
84
|
sorbet="$(VISUAL=echo gem open sorbet-static -v "${version}")/libexec/sorbet"
|
84
85
|
fi
|
85
86
|
|
87
|
+
# if we still don't know the sorbet binary
|
88
|
+
# perhaps this is the java platform
|
89
|
+
if ! [[ -f "${sorbet}" ]]; then
|
90
|
+
if gem env platform | grep -q "java"; then
|
91
|
+
# certain platforms (i.e. java) include multiple binaries
|
92
|
+
# mac.sorbet & linux.sorbet -- since they can't use the host platform (i.e. darwin or linux)
|
93
|
+
# to collect the correct sorbet binary
|
94
|
+
case "$(uname -s)" in
|
95
|
+
Linux*) prefix="linux.";;
|
96
|
+
Darwin*) prefix="mac.";;
|
97
|
+
*) prefix=""
|
98
|
+
esac
|
99
|
+
|
100
|
+
guess_sorbet=("$gems_path/sorbet-static$version_suffix"*/libexec/"${prefix}sorbet")
|
101
|
+
if [[ -f "${guess_sorbet[0]}" ]]; then
|
102
|
+
sorbet="${guess_sorbet[0]}"
|
103
|
+
fi
|
104
|
+
|
105
|
+
fi
|
106
|
+
fi
|
107
|
+
|
86
108
|
# shellcheck disable=SC2086
|
87
109
|
"${sorbet}" "${args[@]}"
|
88
110
|
fi
|
@@ -215,8 +215,9 @@ module Sorbet::Private
|
|
215
215
|
def gem_from_location(location)
|
216
216
|
match =
|
217
217
|
location&.match(/^.*\/(ruby)\/([\d.]+)\//) || # ruby stdlib
|
218
|
+
location&.match(/^.*\/(j?ruby)-([\d.]+)\//) || # jvm ruby stdlib
|
218
219
|
location&.match(/^.*\/(site_ruby)\/([\d.]+)\//) || # rubygems
|
219
|
-
location&.match(/^.*\/gems\/(?:ruby-)?[\d.]+(?:@[^\/]+)?(?:\/bundler)?\/gems\/([^\/]+)-([^-\/]+)\//i) # gem
|
220
|
+
location&.match(/^.*\/gems\/(?:j?ruby-)?[\d.]+(?:@[^\/]+)?(?:\/bundler)?\/gems\/([^\/]+)-([^-\/]+)\//i) # gem
|
220
221
|
if match.nil?
|
221
222
|
# uncomment to generate files for methods outside of gems
|
222
223
|
# {
|
@@ -118,13 +118,18 @@ module Sorbet::Private
|
|
118
118
|
on_module_created(tp.self)
|
119
119
|
end
|
120
120
|
@c_call_tracepoint = TracePoint.new(:c_call) do |tp|
|
121
|
-
|
121
|
+
|
122
|
+
# older version of JRuby unfortunately returned a String
|
123
|
+
case tp.method_id.to_sym
|
122
124
|
when :require, :require_relative
|
123
125
|
@context_stack << []
|
124
126
|
end
|
125
127
|
end
|
126
128
|
@c_return_tracepoint = TracePoint.new(:c_return) do |tp|
|
127
|
-
|
129
|
+
|
130
|
+
# older version of JRuby unfortunately returned a String
|
131
|
+
method_id_sym = tp.method_id.to_sym
|
132
|
+
case method_id_sym
|
128
133
|
when :require, :require_relative
|
129
134
|
popped = @context_stack.pop
|
130
135
|
|
@@ -147,8 +152,13 @@ module Sorbet::Private
|
|
147
152
|
begin
|
148
153
|
tp.disable
|
149
154
|
|
150
|
-
singleton =
|
155
|
+
singleton = method_id_sym == :singleton_method_added
|
151
156
|
receiver = singleton ? Sorbet::Private::RealStdlib.real_singleton_class(tp.self) : tp.self
|
157
|
+
|
158
|
+
# JRuby the main Object is not a module
|
159
|
+
# so lets skip it, otherwise RealStdlib#real_instance_methods raises an exception since it expects one.
|
160
|
+
next unless receiver.is_a?(Module)
|
161
|
+
|
152
162
|
methods = Sorbet::Private::RealStdlib.real_instance_methods(receiver, false) + Sorbet::Private::RealStdlib.real_private_instance_methods(receiver, false)
|
153
163
|
set = @modules[Sorbet::Private::RealStdlib.real_object_id(receiver)] ||= Set.new
|
154
164
|
added = methods.find { |m| !set.include?(m) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sorbet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.5140
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-12-
|
11
|
+
date: 2019-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sorbet-static
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.4.
|
19
|
+
version: 0.4.5140
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.4.
|
26
|
+
version: 0.4.5140
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: minitest
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|