tapioca 0.17.9 → 0.18.0
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 +4 -4
- data/README.md +3 -2
- data/lib/tapioca/bundler_ext/auto_require_hook.rb +0 -3
- data/lib/tapioca/cli.rb +0 -2
- data/lib/tapioca/commands/abstract_dsl.rb +21 -2
- data/lib/tapioca/commands/abstract_gem.rb +20 -1
- data/lib/tapioca/commands/annotations.rb +7 -3
- data/lib/tapioca/commands/check_shims.rb +9 -2
- data/lib/tapioca/commands/command.rb +0 -1
- data/lib/tapioca/dsl/compiler.rb +17 -16
- data/lib/tapioca/dsl/compilers/aasm.rb +2 -6
- data/lib/tapioca/dsl/compilers/action_controller_helpers.rb +2 -6
- data/lib/tapioca/dsl/compilers/action_mailer.rb +1 -5
- data/lib/tapioca/dsl/compilers/action_text.rb +1 -5
- data/lib/tapioca/dsl/compilers/active_job.rb +1 -5
- data/lib/tapioca/dsl/compilers/active_model_attributes.rb +1 -5
- data/lib/tapioca/dsl/compilers/active_model_secure_password.rb +1 -5
- data/lib/tapioca/dsl/compilers/active_model_validations_confirmation.rb +1 -3
- data/lib/tapioca/dsl/compilers/active_record_associations.rb +1 -6
- data/lib/tapioca/dsl/compilers/active_record_columns.rb +8 -5
- data/lib/tapioca/dsl/compilers/active_record_delegated_types.rb +1 -4
- data/lib/tapioca/dsl/compilers/active_record_enum.rb +1 -5
- data/lib/tapioca/dsl/compilers/active_record_fixtures.rb +1 -5
- data/lib/tapioca/dsl/compilers/active_record_relations.rb +45 -87
- data/lib/tapioca/dsl/compilers/active_record_scope.rb +1 -2
- data/lib/tapioca/dsl/compilers/active_record_secure_token.rb +1 -4
- data/lib/tapioca/dsl/compilers/active_record_store.rb +1 -4
- data/lib/tapioca/dsl/compilers/active_record_typed_store.rb +1 -5
- data/lib/tapioca/dsl/compilers/active_resource.rb +1 -5
- data/lib/tapioca/dsl/compilers/active_storage.rb +2 -6
- data/lib/tapioca/dsl/compilers/active_support_concern.rb +6 -10
- data/lib/tapioca/dsl/compilers/active_support_current_attributes.rb +4 -19
- data/lib/tapioca/dsl/compilers/active_support_environment_inquirer.rb +60 -0
- data/lib/tapioca/dsl/compilers/active_support_time_ext.rb +1 -5
- data/lib/tapioca/dsl/compilers/config.rb +2 -6
- data/lib/tapioca/dsl/compilers/frozen_record.rb +1 -5
- data/lib/tapioca/dsl/compilers/graphql_input_object.rb +1 -5
- data/lib/tapioca/dsl/compilers/graphql_mutation.rb +1 -5
- data/lib/tapioca/dsl/compilers/identity_cache.rb +2 -6
- data/lib/tapioca/dsl/compilers/json_api_client_resource.rb +4 -18
- data/lib/tapioca/dsl/compilers/kredis.rb +1 -5
- data/lib/tapioca/dsl/compilers/mixed_in_class_attributes.rb +2 -6
- data/lib/tapioca/dsl/compilers/protobuf.rb +2 -6
- data/lib/tapioca/dsl/compilers/rails_generators.rb +1 -5
- data/lib/tapioca/dsl/compilers/sidekiq_worker.rb +1 -5
- data/lib/tapioca/dsl/compilers/smart_properties.rb +1 -5
- data/lib/tapioca/dsl/compilers/state_machines.rb +2 -6
- data/lib/tapioca/dsl/compilers/url_helpers.rb +7 -10
- data/lib/tapioca/dsl/helpers/active_model_type_helper.rb +0 -2
- data/lib/tapioca/dsl/helpers/active_record_column_type_helper.rb +3 -6
- data/lib/tapioca/dsl/helpers/active_record_constants_helper.rb +0 -2
- data/lib/tapioca/dsl/helpers/graphql_type_helper.rb +18 -5
- data/lib/tapioca/dsl/pipeline.rb +25 -13
- data/lib/tapioca/executor.rb +0 -2
- data/lib/tapioca/gem/events.rb +15 -23
- data/lib/tapioca/gem/listeners/base.rb +0 -1
- data/lib/tapioca/gem/listeners/dynamic_mixins.rb +0 -2
- data/lib/tapioca/gem/listeners/foreign_constants.rb +0 -2
- data/lib/tapioca/gem/listeners/methods.rb +19 -9
- data/lib/tapioca/gem/listeners/mixins.rb +3 -5
- data/lib/tapioca/gem/listeners/remove_empty_payload_scopes.rb +0 -2
- data/lib/tapioca/gem/listeners/sorbet_enums.rb +0 -2
- data/lib/tapioca/gem/listeners/sorbet_helpers.rb +0 -2
- data/lib/tapioca/gem/listeners/sorbet_props.rb +0 -1
- data/lib/tapioca/gem/listeners/sorbet_required_ancestors.rb +0 -2
- data/lib/tapioca/gem/listeners/sorbet_signatures.rb +0 -2
- data/lib/tapioca/gem/listeners/sorbet_type_variables.rb +1 -3
- data/lib/tapioca/gem/listeners/source_location.rb +6 -7
- data/lib/tapioca/gem/listeners/subconstants.rb +0 -2
- data/lib/tapioca/gem/listeners/yard_doc.rb +0 -2
- data/lib/tapioca/gem/pipeline.rb +25 -21
- data/lib/tapioca/gemfile.rb +1 -3
- data/lib/tapioca/helpers/cli_helper.rb +0 -1
- data/lib/tapioca/helpers/config_helper.rb +5 -2
- data/lib/tapioca/helpers/env_helper.rb +0 -1
- data/lib/tapioca/helpers/gem_helper.rb +0 -2
- data/lib/tapioca/helpers/git_attributes.rb +0 -2
- data/lib/tapioca/helpers/package_url.rb +416 -0
- data/lib/tapioca/helpers/rbi_files_helper.rb +8 -2
- data/lib/tapioca/helpers/rbi_helper.rb +0 -3
- data/lib/tapioca/helpers/sorbet_helper.rb +0 -2
- data/lib/tapioca/helpers/test/content.rb +0 -1
- data/lib/tapioca/helpers/test/dsl_compiler.rb +0 -3
- data/lib/tapioca/helpers/test/isolation.rb +0 -6
- data/lib/tapioca/helpers/test/template.rb +1 -9
- data/lib/tapioca/internal.rb +1 -1
- data/lib/tapioca/loaders/dsl.rb +0 -4
- data/lib/tapioca/loaders/gem.rb +14 -6
- data/lib/tapioca/loaders/loader.rb +0 -1
- data/lib/tapioca/rbi_ext/model.rb +9 -4
- data/lib/tapioca/rbi_formatter.rb +0 -2
- data/lib/tapioca/repo_index.rb +1 -4
- data/lib/tapioca/runtime/dynamic_mixin_compiler.rb +6 -9
- data/lib/tapioca/runtime/generic_type_registry.rb +8 -12
- data/lib/tapioca/runtime/reflection.rb +25 -31
- data/lib/tapioca/runtime/trackers/autoload.rb +0 -3
- data/lib/tapioca/runtime/trackers/constant_definition.rb +30 -8
- data/lib/tapioca/runtime/trackers/method_definition.rb +4 -5
- data/lib/tapioca/runtime/trackers/mixin.rb +5 -8
- data/lib/tapioca/runtime/trackers/required_ancestor.rb +2 -4
- data/lib/tapioca/runtime/trackers/tracker.rb +1 -4
- data/lib/tapioca/runtime/trackers.rb +0 -4
- data/lib/tapioca/sorbet_ext/generic_name_patch.rb +1 -3
- data/lib/tapioca/static/requires_compiler.rb +1 -3
- data/lib/tapioca/static/symbol_loader.rb +0 -1
- data/lib/tapioca/static/symbol_table_parser.rb +0 -4
- data/lib/tapioca/version.rb +1 -1
- data/lib/tapioca.rb +0 -2
- metadata +18 -5
- data/lib/tapioca/helpers/source_uri.rb +0 -84
- data/lib/tapioca/runtime/attached_class_of_32.rb +0 -20
- data/lib/tapioca/runtime/attached_class_of_legacy.rb +0 -24
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tapioca
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.18.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ufuk Kayserilioglu
|
|
@@ -152,6 +152,20 @@ dependencies:
|
|
|
152
152
|
- - ">="
|
|
153
153
|
- !ruby/object:Gem::Version
|
|
154
154
|
version: 1.7.9
|
|
155
|
+
- !ruby/object:Gem::Dependency
|
|
156
|
+
name: tsort
|
|
157
|
+
requirement: !ruby/object:Gem::Requirement
|
|
158
|
+
requirements:
|
|
159
|
+
- - ">="
|
|
160
|
+
- !ruby/object:Gem::Version
|
|
161
|
+
version: '0'
|
|
162
|
+
type: :runtime
|
|
163
|
+
prerelease: false
|
|
164
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
165
|
+
requirements:
|
|
166
|
+
- - ">="
|
|
167
|
+
- !ruby/object:Gem::Version
|
|
168
|
+
version: '0'
|
|
155
169
|
email:
|
|
156
170
|
- ruby@shopify.com
|
|
157
171
|
executables:
|
|
@@ -210,6 +224,7 @@ files:
|
|
|
210
224
|
- lib/tapioca/dsl/compilers/active_storage.rb
|
|
211
225
|
- lib/tapioca/dsl/compilers/active_support_concern.rb
|
|
212
226
|
- lib/tapioca/dsl/compilers/active_support_current_attributes.rb
|
|
227
|
+
- lib/tapioca/dsl/compilers/active_support_environment_inquirer.rb
|
|
213
228
|
- lib/tapioca/dsl/compilers/active_support_time_ext.rb
|
|
214
229
|
- lib/tapioca/dsl/compilers/config.rb
|
|
215
230
|
- lib/tapioca/dsl/compilers/frozen_record.rb
|
|
@@ -260,10 +275,10 @@ files:
|
|
|
260
275
|
- lib/tapioca/helpers/env_helper.rb
|
|
261
276
|
- lib/tapioca/helpers/gem_helper.rb
|
|
262
277
|
- lib/tapioca/helpers/git_attributes.rb
|
|
278
|
+
- lib/tapioca/helpers/package_url.rb
|
|
263
279
|
- lib/tapioca/helpers/rbi_files_helper.rb
|
|
264
280
|
- lib/tapioca/helpers/rbi_helper.rb
|
|
265
281
|
- lib/tapioca/helpers/sorbet_helper.rb
|
|
266
|
-
- lib/tapioca/helpers/source_uri.rb
|
|
267
282
|
- lib/tapioca/helpers/test/content.rb
|
|
268
283
|
- lib/tapioca/helpers/test/dsl_compiler.rb
|
|
269
284
|
- lib/tapioca/helpers/test/isolation.rb
|
|
@@ -276,8 +291,6 @@ files:
|
|
|
276
291
|
- lib/tapioca/rbi_formatter.rb
|
|
277
292
|
- lib/tapioca/rbs/rewriter.rb
|
|
278
293
|
- lib/tapioca/repo_index.rb
|
|
279
|
-
- lib/tapioca/runtime/attached_class_of_32.rb
|
|
280
|
-
- lib/tapioca/runtime/attached_class_of_legacy.rb
|
|
281
294
|
- lib/tapioca/runtime/dynamic_mixin_compiler.rb
|
|
282
295
|
- lib/tapioca/runtime/generic_type_registry.rb
|
|
283
296
|
- lib/tapioca/runtime/helpers.rb
|
|
@@ -317,7 +330,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
317
330
|
- !ruby/object:Gem::Version
|
|
318
331
|
version: '0'
|
|
319
332
|
requirements: []
|
|
320
|
-
rubygems_version:
|
|
333
|
+
rubygems_version: 4.0.3
|
|
321
334
|
specification_version: 4
|
|
322
335
|
summary: A Ruby Interface file generator for gems, core types and the Ruby standard
|
|
323
336
|
library
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
# typed: true
|
|
2
|
-
# frozen_string_literal: true
|
|
3
|
-
|
|
4
|
-
require "uri/file"
|
|
5
|
-
|
|
6
|
-
module Tapioca
|
|
7
|
-
class SourceURI < URI::File
|
|
8
|
-
extend T::Sig
|
|
9
|
-
|
|
10
|
-
COMPONENT = [
|
|
11
|
-
:scheme,
|
|
12
|
-
:gem_name,
|
|
13
|
-
:gem_version,
|
|
14
|
-
:path,
|
|
15
|
-
:line_number,
|
|
16
|
-
].freeze #: Array[Symbol]
|
|
17
|
-
|
|
18
|
-
# `uri` for Ruby 3.4 switched the default parser from RFC2396 to RFC3986. The new parser emits a deprecation
|
|
19
|
-
# warning on a few methods and delegates them to RFC2396, namely `extract`/`make_regexp`/`escape`/`unescape`.
|
|
20
|
-
# On earlier versions of the uri gem, the RFC2396_PARSER constant doesn't exist, so it needs some special
|
|
21
|
-
# handling to select a parser that doesn't emit deprecations. While it was backported to Ruby 3.1, users may
|
|
22
|
-
# have the uri gem in their own bundle and thus not use a compatible version.
|
|
23
|
-
PARSER = const_defined?(:RFC2396_PARSER) ? RFC2396_PARSER : DEFAULT_PARSER #: RFC2396_Parser
|
|
24
|
-
|
|
25
|
-
#: String?
|
|
26
|
-
attr_reader :gem_version
|
|
27
|
-
|
|
28
|
-
class << self
|
|
29
|
-
extend T::Sig
|
|
30
|
-
|
|
31
|
-
#: (gem_name: String, gem_version: String?, path: String, line_number: String?) -> instance
|
|
32
|
-
def build(gem_name:, gem_version:, path:, line_number:)
|
|
33
|
-
super(
|
|
34
|
-
{
|
|
35
|
-
scheme: "source",
|
|
36
|
-
host: gem_name,
|
|
37
|
-
path: PARSER.escape("/#{gem_version}/#{path}"),
|
|
38
|
-
fragment: line_number,
|
|
39
|
-
}
|
|
40
|
-
)
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
#: -> String?
|
|
45
|
-
def gem_name
|
|
46
|
-
host
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
#: -> String?
|
|
50
|
-
def line_number
|
|
51
|
-
fragment
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
#: (String? v) -> void
|
|
55
|
-
def set_path(v) # rubocop:disable Naming/AccessorMethodName
|
|
56
|
-
return if v.nil?
|
|
57
|
-
|
|
58
|
-
@gem_version, @path = v.split("/", 2)
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
#: (String? v) -> bool
|
|
62
|
-
def check_host(v)
|
|
63
|
-
return true unless v
|
|
64
|
-
|
|
65
|
-
if /[A-Za-z][A-Za-z0-9\-_]*/ !~ v
|
|
66
|
-
raise InvalidComponentError,
|
|
67
|
-
"bad component(expected gem name): #{v}"
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
true
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
#: -> String
|
|
74
|
-
def to_s
|
|
75
|
-
"source://#{gem_name}/#{gem_version}#{path}##{line_number}"
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
if URI.respond_to?(:register_scheme)
|
|
79
|
-
URI.register_scheme("SOURCE", self)
|
|
80
|
-
else
|
|
81
|
-
@@schemes["SOURCE"] = self
|
|
82
|
-
end
|
|
83
|
-
end
|
|
84
|
-
end
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# typed: true
|
|
2
|
-
# frozen_string_literal: true
|
|
3
|
-
|
|
4
|
-
module Tapioca
|
|
5
|
-
module Runtime
|
|
6
|
-
# This module should only be included when running Ruby version 3.2
|
|
7
|
-
# or newer. It relies on the Class#attached_object method, which was
|
|
8
|
-
# added in Ruby 3.2 and fetches the attached object of a singleton
|
|
9
|
-
# class without having to iterate through all of ObjectSpace.
|
|
10
|
-
module AttachedClassOf
|
|
11
|
-
extend T::Sig
|
|
12
|
-
|
|
13
|
-
#: (Class singleton_class) -> Module?
|
|
14
|
-
def attached_class_of(singleton_class)
|
|
15
|
-
result = singleton_class.attached_object
|
|
16
|
-
Module === result ? result : nil
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# typed: true
|
|
2
|
-
# frozen_string_literal: true
|
|
3
|
-
|
|
4
|
-
module Tapioca
|
|
5
|
-
module Runtime
|
|
6
|
-
# This module should only be included when running versions of Ruby
|
|
7
|
-
# older than 3.2. Because the Class#attached_object method is not
|
|
8
|
-
# available, it implements finding the attached class of a singleton
|
|
9
|
-
# class by iterating through ObjectSpace.
|
|
10
|
-
# @requires_ancestor: Tapioca::Runtime::Reflection
|
|
11
|
-
module AttachedClassOf
|
|
12
|
-
extend T::Sig
|
|
13
|
-
#: (Class singleton_class) -> Module?
|
|
14
|
-
def attached_class_of(singleton_class)
|
|
15
|
-
# https://stackoverflow.com/a/36622320/98634
|
|
16
|
-
result = ObjectSpace.each_object(singleton_class).find do |klass|
|
|
17
|
-
singleton_class_of(T.cast(klass, Module)) == singleton_class
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
T.cast(result, T.nilable(Module))
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|