rbs_rails 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/sig/generated/actionpack.rbs +9 -9
- data/assets/sig/generated/actionview.rbs +1 -1
- data/assets/sig/generated/activemodel.rbs +1 -1
- data/assets/sig/generated/activerecord.rbs +8 -8
- data/assets/sig/generated/activesupport.rbs +5 -5
- data/assets/sig/generated/railties.rbs +3 -3
- data/bin/add-type-params.rb +1 -1
- data/bin/generate_rbs_from_rails_source_code.rb +11 -5
- data/bin/postprocess.rb +1 -1
- data/lib/rbs_rails/active_record.rb +1 -1
- data/lib/rbs_rails/version.rb +1 -1
- data/rbs_rails.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a95c070dd8a694d1226c7985be11458ebea02c89fda95c6bc0842c84fd44b69a
|
4
|
+
data.tar.gz: 6e29540a2c6e0cb76b01ca08aa6081e4144260380900ecb632113eab04326ed6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5ef79213cc6cbdb1e4d20ea901ccd65071c6c2fea5c9dc28cc80cb75739e712534ad2d7b19fa9c4174d7fee5da50e787d7ccb742933e51e7f337b4fc285838c
|
7
|
+
data.tar.gz: ed7492f9b9b61fca7bc4d0ee52ebf9646d3127cf82c73d6b64d136d6c2cf248be86fa49a4324769bbde6d2304c5325be1e7cd6e7b6753e55d612f21627133f07
|
@@ -4936,7 +4936,7 @@ module ActionDispatch
|
|
4936
4936
|
|
4937
4937
|
HTTP_HEADER: untyped
|
4938
4938
|
|
4939
|
-
include Enumerable[untyped
|
4939
|
+
include Enumerable[untyped]
|
4940
4940
|
|
4941
4941
|
def self.from_hash: (untyped hash) -> untyped
|
4942
4942
|
|
@@ -5063,7 +5063,7 @@ end
|
|
5063
5063
|
|
5064
5064
|
module Mime
|
5065
5065
|
class Mimes
|
5066
|
-
include Enumerable[untyped
|
5066
|
+
include Enumerable[untyped]
|
5067
5067
|
|
5068
5068
|
def initialize: () -> untyped
|
5069
5069
|
|
@@ -6371,7 +6371,7 @@ module ActionDispatch
|
|
6371
6371
|
# :nodoc:
|
6372
6372
|
# :nodoc:
|
6373
6373
|
# :nodoc:
|
6374
|
-
include Enumerable[untyped
|
6374
|
+
include Enumerable[untyped]
|
6375
6375
|
|
6376
6376
|
attr_accessor left: untyped
|
6377
6377
|
|
@@ -6879,7 +6879,7 @@ module ActionDispatch
|
|
6879
6879
|
# The Routing table. Contains all routes for a system. Routes can be
|
6880
6880
|
# added to the table by calling Routes#add_route.
|
6881
6881
|
# :nodoc:
|
6882
|
-
include Enumerable[untyped
|
6882
|
+
include Enumerable[untyped]
|
6883
6883
|
|
6884
6884
|
attr_reader routes: untyped
|
6885
6885
|
|
@@ -7338,7 +7338,7 @@ module ActionDispatch
|
|
7338
7338
|
|
7339
7339
|
class CookieJar
|
7340
7340
|
# nodoc:
|
7341
|
-
include Enumerable[untyped
|
7341
|
+
include Enumerable[untyped]
|
7342
7342
|
|
7343
7343
|
# nodoc:
|
7344
7344
|
include ChainedCookieJars
|
@@ -7715,7 +7715,7 @@ module ActionDispatch
|
|
7715
7715
|
end
|
7716
7716
|
|
7717
7717
|
class FlashHash
|
7718
|
-
include Enumerable[untyped
|
7718
|
+
include Enumerable[untyped]
|
7719
7719
|
|
7720
7720
|
def self.from_session_value: (untyped value) -> untyped
|
7721
7721
|
|
@@ -8310,7 +8310,7 @@ module ActionDispatch
|
|
8310
8310
|
def call: (untyped env) -> untyped
|
8311
8311
|
end
|
8312
8312
|
|
8313
|
-
include Enumerable[untyped
|
8313
|
+
include Enumerable[untyped]
|
8314
8314
|
|
8315
8315
|
attr_accessor middlewares: untyped
|
8316
8316
|
|
@@ -9909,7 +9909,7 @@ module ActionDispatch
|
|
9909
9909
|
|
9910
9910
|
def []: (untyped key) -> untyped
|
9911
9911
|
|
9912
|
-
include Enumerable[untyped
|
9912
|
+
include Enumerable[untyped]
|
9913
9913
|
|
9914
9914
|
def each: () { (untyped) -> untyped } -> untyped
|
9915
9915
|
|
@@ -10228,7 +10228,7 @@ module ActionDispatch
|
|
10228
10228
|
# maintains an anonymous module that can be used to install helpers for the
|
10229
10229
|
# named routes.
|
10230
10230
|
class NamedRouteCollection
|
10231
|
-
include Enumerable[untyped
|
10231
|
+
include Enumerable[untyped]
|
10232
10232
|
|
10233
10233
|
attr_reader routes: untyped
|
10234
10234
|
|
@@ -1879,7 +1879,7 @@ module ActiveRecord
|
|
1879
1879
|
# operations (for example a has_and_belongs_to_many JoinAssociation would result in
|
1880
1880
|
# two; one for the join table and one for the target table).
|
1881
1881
|
# :nodoc:
|
1882
|
-
include Enumerable[untyped
|
1882
|
+
include Enumerable[untyped]
|
1883
1883
|
|
1884
1884
|
# The Active Record class which this join part is associated 'about'; for a JoinBase
|
1885
1885
|
# this is the actual base model, for a JoinAssociation this is the target model of the
|
@@ -11613,7 +11613,7 @@ module ActiveRecord
|
|
11613
11613
|
module ConnectionAdapters
|
11614
11614
|
class StatementPool
|
11615
11615
|
# :nodoc:
|
11616
|
-
include Enumerable[untyped
|
11616
|
+
include Enumerable[untyped]
|
11617
11617
|
|
11618
11618
|
DEFAULT_STATEMENT_LIMIT: ::Integer
|
11619
11619
|
|
@@ -12836,7 +12836,7 @@ module ActiveRecord
|
|
12836
12836
|
class FixtureSet
|
12837
12837
|
class File
|
12838
12838
|
# :nodoc:
|
12839
|
-
include Enumerable[untyped
|
12839
|
+
include Enumerable[untyped]
|
12840
12840
|
|
12841
12841
|
#
|
12842
12842
|
# Open a fixture file named +file+. When called with a block, the block
|
@@ -13465,7 +13465,7 @@ module ActiveRecord
|
|
13465
13465
|
|
13466
13466
|
class Fixture
|
13467
13467
|
# nodoc:
|
13468
|
-
include Enumerable[untyped
|
13468
|
+
include Enumerable[untyped]
|
13469
13469
|
|
13470
13470
|
class FixtureError < StandardError
|
13471
13471
|
end
|
@@ -17286,7 +17286,7 @@ end
|
|
17286
17286
|
module ActiveRecord
|
17287
17287
|
module Batches
|
17288
17288
|
class BatchEnumerator
|
17289
|
-
include Enumerable[untyped
|
17289
|
+
include Enumerable[untyped]
|
17290
17290
|
|
17291
17291
|
def initialize: (relation: untyped relation, ?of: ::Integer of, ?start: untyped? start, ?finish: untyped? finish) -> untyped
|
17292
17292
|
|
@@ -19192,7 +19192,7 @@ module ActiveRecord
|
|
19192
19192
|
|
19193
19193
|
VALUE_METHODS: untyped
|
19194
19194
|
|
19195
|
-
include Enumerable[untyped
|
19195
|
+
include Enumerable[untyped]
|
19196
19196
|
|
19197
19197
|
include FinderMethods
|
19198
19198
|
|
@@ -19693,7 +19693,7 @@ module ActiveRecord
|
|
19693
19693
|
# puts row['title'] + " " + row['body']
|
19694
19694
|
# end
|
19695
19695
|
class Result
|
19696
|
-
include Enumerable[untyped
|
19696
|
+
include Enumerable[untyped]
|
19697
19697
|
|
19698
19698
|
attr_reader columns: untyped
|
19699
19699
|
|
@@ -22777,7 +22777,7 @@ module Arel
|
|
22777
22777
|
class Node
|
22778
22778
|
include Arel::FactoryMethods
|
22779
22779
|
|
22780
|
-
include Enumerable[untyped
|
22780
|
+
include Enumerable[untyped]
|
22781
22781
|
|
22782
22782
|
# #
|
22783
22783
|
# Factory method to create a Nodes::Not node that has the recipient of
|
@@ -1383,7 +1383,7 @@ module ActiveSupport
|
|
1383
1383
|
|
1384
1384
|
class CallbackChain
|
1385
1385
|
# nodoc:#
|
1386
|
-
include Enumerable[untyped
|
1386
|
+
include Enumerable[untyped]
|
1387
1387
|
|
1388
1388
|
attr_reader name: untyped
|
1389
1389
|
|
@@ -2985,7 +2985,7 @@ module Digest
|
|
2985
2985
|
end
|
2986
2986
|
end
|
2987
2987
|
|
2988
|
-
module Enumerable[unchecked out Elem
|
2988
|
+
module Enumerable[unchecked out Elem]
|
2989
2989
|
INDEX_WITH_DEFAULT: untyped
|
2990
2990
|
|
2991
2991
|
# We can't use Refinements here because Refinements with Module which will be prepended
|
@@ -4843,7 +4843,7 @@ class Regexp
|
|
4843
4843
|
def as_json: (?untyped? options) -> untyped
|
4844
4844
|
end
|
4845
4845
|
|
4846
|
-
module Enumerable[unchecked out Elem
|
4846
|
+
module Enumerable[unchecked out Elem]
|
4847
4847
|
def as_json: (?untyped? options) -> untyped
|
4848
4848
|
end
|
4849
4849
|
|
@@ -6505,7 +6505,7 @@ module ActiveSupport
|
|
6505
6505
|
# This is handled by walking back up the watch stack and adding the constants
|
6506
6506
|
# found by child.rb to the list of original constants in parent.rb.
|
6507
6507
|
class WatchStack
|
6508
|
-
include Enumerable[untyped
|
6508
|
+
include Enumerable[untyped]
|
6509
6509
|
|
6510
6510
|
attr_reader watching: untyped
|
6511
6511
|
|
@@ -7108,7 +7108,7 @@ module ActiveSupport
|
|
7108
7108
|
class DescendantsArray
|
7109
7109
|
# DescendantsArray is an array that contains weak references to classes.
|
7110
7110
|
# :nodoc:
|
7111
|
-
include Enumerable[untyped
|
7111
|
+
include Enumerable[untyped]
|
7112
7112
|
|
7113
7113
|
def initialize: () -> untyped
|
7114
7114
|
|
@@ -623,7 +623,7 @@ end
|
|
623
623
|
|
624
624
|
module Rails
|
625
625
|
module Autoloaders
|
626
|
-
include Enumerable[untyped
|
626
|
+
include Enumerable[untyped]
|
627
627
|
|
628
628
|
def self.main: () -> untyped
|
629
629
|
|
@@ -1504,7 +1504,7 @@ end
|
|
1504
1504
|
module Rails
|
1505
1505
|
class Engine < Railtie
|
1506
1506
|
class Railties
|
1507
|
-
include Enumerable[untyped
|
1507
|
+
include Enumerable[untyped]
|
1508
1508
|
|
1509
1509
|
attr_reader _all: untyped
|
1510
1510
|
|
@@ -4065,7 +4065,7 @@ module Rails
|
|
4065
4065
|
end
|
4066
4066
|
|
4067
4067
|
class Path
|
4068
|
-
include Enumerable[untyped
|
4068
|
+
include Enumerable[untyped]
|
4069
4069
|
|
4070
4070
|
attr_accessor glob: untyped
|
4071
4071
|
|
data/bin/add-type-params.rb
CHANGED
@@ -166,7 +166,7 @@ def patch!(name, rbs)
|
|
166
166
|
end
|
167
167
|
end
|
168
168
|
|
169
|
-
def
|
169
|
+
def generate1!(rails_code_dir, name)
|
170
170
|
files = Pathname(rails_code_dir).join(name, 'lib').glob('**/*.rb').map(&:to_s)
|
171
171
|
generated_rbs_path = SIG_DIR.join("#{name}.rbs")
|
172
172
|
|
@@ -176,6 +176,11 @@ def generate!(rails_code_dir, name)
|
|
176
176
|
patch! name, rbs
|
177
177
|
generated_rbs_path.write(rbs)
|
178
178
|
|
179
|
+
end
|
180
|
+
|
181
|
+
def generate2!(rails_code_dir, name)
|
182
|
+
generated_rbs_path = SIG_DIR.join("#{name}.rbs")
|
183
|
+
|
179
184
|
rbs = sh! 'ruby', bin('add-type-params.rb'), generated_rbs_path.to_s
|
180
185
|
generated_rbs_path.write(rbs)
|
181
186
|
|
@@ -184,11 +189,12 @@ end
|
|
184
189
|
|
185
190
|
def main(rails_code_dir, name)
|
186
191
|
if name == 'all'
|
187
|
-
%w[actionpack activejob
|
188
|
-
|
189
|
-
|
192
|
+
gems = %w[activesupport actionpack activejob activemodel actionview activerecord railties]
|
193
|
+
gems.each { |n| generate1!(rails_code_dir, n) }
|
194
|
+
gems.each { |n| generate2!(rails_code_dir, n) }
|
190
195
|
else
|
191
|
-
|
196
|
+
generate1!(rails_code_dir, name)
|
197
|
+
generate2!(rails_code_dir, name)
|
192
198
|
end
|
193
199
|
end
|
194
200
|
|
data/bin/postprocess.rb
CHANGED
@@ -35,7 +35,7 @@ module RbsRails
|
|
35
35
|
<<~RBS
|
36
36
|
class #{relation_class_name} < ActiveRecord::Relation
|
37
37
|
include _ActiveRecord_Relation[#{klass.name}]
|
38
|
-
include Enumerable[#{klass.name}
|
38
|
+
include Enumerable[#{klass.name}]
|
39
39
|
#{enum_scope_methods(singleton: false).indent(2)}
|
40
40
|
#{scopes(singleton: false).indent(2)}
|
41
41
|
end
|
data/lib/rbs_rails/version.rb
CHANGED
data/rbs_rails.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbs_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masataka Pocke Kuwabara
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rbs
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.17'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.17'
|
27
41
|
description: A RBS files generator for Rails application
|
28
42
|
email:
|
29
43
|
- kuwabara@pocke.me
|