rbs_rails 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitattributes +1 -0
- data/CHANGELOG.md +5 -0
- data/README.md +4 -2
- data/Steepfile +3 -0
- data/bin/add-type-params.rb +1 -0
- data/bin/gem_rbs +1 -1
- data/bin/rbs +1 -1
- data/lib/rbs_rails/active_record.rb +12 -4
- data/lib/rbs_rails/rake_task.rb +1 -11
- data/lib/rbs_rails/version.rb +1 -1
- data/rbs_rails.gemspec +1 -1
- metadata +4 -26
- data/assets/sig/action_mailer.rbs +0 -8
- data/assets/sig/builtin.rbs +0 -7
- data/assets/sig/capybara.rbs +0 -14
- data/assets/sig/concurrent.rbs +0 -4
- data/assets/sig/erb.rbs +0 -4
- data/assets/sig/erubi.rbs +0 -4
- data/assets/sig/i18n.rbs +0 -4
- data/assets/sig/libxml.rbs +0 -10
- data/assets/sig/minitest.rbs +0 -13
- data/assets/sig/nokogiri.rbs +0 -8
- data/assets/sig/pg.rbs +0 -5
- data/assets/sig/que.rbs +0 -4
- data/assets/sig/queue_classic.rbs +0 -4
- data/assets/sig/racc.rbs +0 -4
- data/assets/sig/rack-test.rbs +0 -6
- data/assets/sig/rack.rbs +0 -47
- data/assets/sig/rails.rbs +0 -10
- data/assets/sig/rdoc.rbs +0 -9
- data/assets/sig/sidekiq.rbs +0 -4
- data/assets/sig/sneakers.rbs +0 -4
- data/assets/sig/stdlib.rbs +0 -24
- data/assets/sig/sucker_punch.rbs +0 -4
- data/assets/sig/thor.rbs +0 -12
- data/assets/sig/tzinfo.rbs +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34709bd1892db293d9371b2574c97f5144d97f8b2de661072d7f65fb0616f971
|
4
|
+
data.tar.gz: 68f8207b59c550a6f5e6485ee322c38141154b47026c4d50c6bfe3cee9270494
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01d91fa0f2aaeed8dd4614ec59f5604b125684ed63325f6edbb30c29db62e2ae60cffd450a28b0ef5ec44f32570bb1a25fdbb70230060def0a4ee73fb714ab0f
|
7
|
+
data.tar.gz: 535c957a38bc5644be6e83ccf1bf439a1830110a3355b4dfd4b84453f42d5975a506d85166ac53230d62af207765e1c4cab2f3de0b7564c97c084188e7726304
|
data/.gitattributes
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
gem_rbs/gems/* linguist-generated=true
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
## master (unreleased)
|
4
4
|
|
5
|
+
## 0.8.0 (2020-12-31)
|
6
|
+
|
7
|
+
* **[BREAKING]** Move RBS files that are copied by `rbs_rails:copy_signature_files` task to [ruby/gem_rbs](https://github.com/ruby/gem_rbs) repository [#90](https://github.com/pocke/rbs_rails/pull/90)
|
8
|
+
* Allow all kinds of argument for scope [#89](https://github.com/pocke/rbs_rails/pull/89)
|
9
|
+
|
5
10
|
## 0.7.0 (2020-12-28)
|
6
11
|
|
7
12
|
* **[BREAKING]** Re-structure signature directory. [#86](https://github.com/pocke/rbs_rails/pull/86)
|
data/README.md
CHANGED
@@ -28,9 +28,8 @@ require 'rbs_rails/rake_task'
|
|
28
28
|
RbsRails::RakeTask.new
|
29
29
|
```
|
30
30
|
|
31
|
-
Then, the following
|
31
|
+
Then, the following three tasks are available.
|
32
32
|
|
33
|
-
* `rbs_rails:copy_signature_files`: Copy RBS files for rbs_rails
|
34
33
|
* `rbs_rails:generate_rbs_for_models`: Generate RBS files for Active Record models
|
35
34
|
* `rbs_rails:generate_rbs_for_path_helpers`: Generate RBS files for path helpers
|
36
35
|
* `rbs_rails:all`: Execute all tasks of RBS Rails
|
@@ -56,6 +55,9 @@ target :app do
|
|
56
55
|
library 'logger'
|
57
56
|
library 'mutex_m'
|
58
57
|
library 'date'
|
58
|
+
library 'monitor'
|
59
|
+
library 'singleton'
|
60
|
+
library 'tsort'
|
59
61
|
|
60
62
|
library 'activesupport'
|
61
63
|
library 'actionpack'
|
data/Steepfile
CHANGED
data/bin/add-type-params.rb
CHANGED
data/bin/gem_rbs
CHANGED
data/bin/rbs
CHANGED
@@ -18,7 +18,7 @@ end
|
|
18
18
|
exec(
|
19
19
|
'rbs',
|
20
20
|
# Require stdlibs
|
21
|
-
'-rlogger', '-rpathname', '-rmutex_m', '-rdate',
|
21
|
+
'-rlogger', '-rpathname', '-rmutex_m', '-rdate', '-rmonitor', '-rsingleton', '-rtsort',
|
22
22
|
"--repo=#{repo}",
|
23
23
|
# Require Rails libraries
|
24
24
|
v('-ractivesupport'), v('-ractionpack'), v('-ractivejob'), v('-ractivemodel'), v('-ractionview'), v('-ractiverecord'), v('-rrailties'),
|
@@ -233,28 +233,36 @@ module RbsRails
|
|
233
233
|
next unless body_node.type == :block
|
234
234
|
|
235
235
|
args = args_to_type(body_node.children[1])
|
236
|
-
"def #{singleton ? 'self.' : ''}#{name}:
|
236
|
+
"def #{singleton ? 'self.' : ''}#{name}: #{args} -> #{relation_class_name}"
|
237
237
|
end.compact.join("\n")
|
238
238
|
end
|
239
239
|
|
240
240
|
private def args_to_type(args_node)
|
241
241
|
# @type var res: Array[String]
|
242
242
|
res = []
|
243
|
+
# @type var block: String?
|
244
|
+
block = nil
|
243
245
|
args_node.children.each do |node|
|
244
246
|
case node.type
|
245
247
|
when :arg
|
246
|
-
res << "untyped"
|
248
|
+
res << "untyped #{node.children[0]}"
|
247
249
|
when :optarg
|
248
|
-
res << "?untyped"
|
250
|
+
res << "?untyped #{node.children[0]}"
|
249
251
|
when :kwarg
|
250
252
|
res << "#{node.children[0]}: untyped"
|
251
253
|
when :kwoptarg
|
252
254
|
res << "?#{node.children[0]}: untyped"
|
255
|
+
when :restarg
|
256
|
+
res << "*untyped #{node.children[0]}"
|
257
|
+
when :kwrestarg
|
258
|
+
res << "**untyped #{node.children[0]}"
|
259
|
+
when :blockarg
|
260
|
+
block = " { (*untyped) -> untyped }"
|
253
261
|
else
|
254
262
|
raise "unexpected: #{node}"
|
255
263
|
end
|
256
264
|
end
|
257
|
-
res.join(", ")
|
265
|
+
"(#{res.join(", ")})#{block}"
|
258
266
|
end
|
259
267
|
|
260
268
|
private def parse_model_file
|
data/lib/rbs_rails/rake_task.rb
CHANGED
@@ -14,7 +14,6 @@ module RbsRails
|
|
14
14
|
|
15
15
|
setup_signature_root_dir!
|
16
16
|
|
17
|
-
def_copy_signature_files
|
18
17
|
def_generate_rbs_for_models
|
19
18
|
def_generate_rbs_for_path_helpers
|
20
19
|
def_all
|
@@ -23,19 +22,10 @@ module RbsRails
|
|
23
22
|
def def_all
|
24
23
|
desc 'Run all tasks of rbs_rails'
|
25
24
|
|
26
|
-
deps = [:"#{name}:
|
25
|
+
deps = [:"#{name}:generate_rbs_for_models", :"#{name}:generate_rbs_for_path_helpers"]
|
27
26
|
task("#{name}:all": deps)
|
28
27
|
end
|
29
28
|
|
30
|
-
def def_copy_signature_files
|
31
|
-
desc 'Copy RBS files for rbs_rails'
|
32
|
-
task("#{name}:copy_signature_files": :environment) do
|
33
|
-
require 'rbs_rails'
|
34
|
-
|
35
|
-
RbsRails.copy_signatures(to: signature_root_dir)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
29
|
def def_generate_rbs_for_models
|
40
30
|
desc 'Generate RBS files for Active Record models'
|
41
31
|
task("#{name}:generate_rbs_for_models": :environment) do
|
data/lib/rbs_rails/version.rb
CHANGED
data/rbs_rails.gemspec
CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|
14
14
|
|
15
15
|
spec.metadata["homepage_uri"] = spec.homepage
|
16
16
|
spec.metadata["source_code_uri"] = spec.homepage
|
17
|
-
|
17
|
+
spec.metadata["changelog_uri"] = "https://github.com/pocke/rbs_rails/blob/master/CHANGELOG.md"
|
18
18
|
|
19
19
|
# Specify which files should be added to the gem when it is released.
|
20
20
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
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
|
+
version: 0.8.0
|
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-12-
|
11
|
+
date: 2020-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|
@@ -45,6 +45,7 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
+
- ".gitattributes"
|
48
49
|
- ".github/workflows/ci.yml"
|
49
50
|
- ".gitignore"
|
50
51
|
- ".gitmodules"
|
@@ -54,30 +55,6 @@ files:
|
|
54
55
|
- README.md
|
55
56
|
- Rakefile
|
56
57
|
- Steepfile
|
57
|
-
- assets/sig/action_mailer.rbs
|
58
|
-
- assets/sig/builtin.rbs
|
59
|
-
- assets/sig/capybara.rbs
|
60
|
-
- assets/sig/concurrent.rbs
|
61
|
-
- assets/sig/erb.rbs
|
62
|
-
- assets/sig/erubi.rbs
|
63
|
-
- assets/sig/i18n.rbs
|
64
|
-
- assets/sig/libxml.rbs
|
65
|
-
- assets/sig/minitest.rbs
|
66
|
-
- assets/sig/nokogiri.rbs
|
67
|
-
- assets/sig/pg.rbs
|
68
|
-
- assets/sig/que.rbs
|
69
|
-
- assets/sig/queue_classic.rbs
|
70
|
-
- assets/sig/racc.rbs
|
71
|
-
- assets/sig/rack-test.rbs
|
72
|
-
- assets/sig/rack.rbs
|
73
|
-
- assets/sig/rails.rbs
|
74
|
-
- assets/sig/rdoc.rbs
|
75
|
-
- assets/sig/sidekiq.rbs
|
76
|
-
- assets/sig/sneakers.rbs
|
77
|
-
- assets/sig/stdlib.rbs
|
78
|
-
- assets/sig/sucker_punch.rbs
|
79
|
-
- assets/sig/thor.rbs
|
80
|
-
- assets/sig/tzinfo.rbs
|
81
58
|
- bin/add-type-params.rb
|
82
59
|
- bin/console
|
83
60
|
- bin/gem_rbs
|
@@ -110,6 +87,7 @@ licenses:
|
|
110
87
|
metadata:
|
111
88
|
homepage_uri: https://github.com/pocke/rbs_rails
|
112
89
|
source_code_uri: https://github.com/pocke/rbs_rails
|
90
|
+
changelog_uri: https://github.com/pocke/rbs_rails/blob/master/CHANGELOG.md
|
113
91
|
post_install_message:
|
114
92
|
rdoc_options: []
|
115
93
|
require_paths:
|
data/assets/sig/builtin.rbs
DELETED
data/assets/sig/capybara.rbs
DELETED
data/assets/sig/concurrent.rbs
DELETED
data/assets/sig/erb.rbs
DELETED
data/assets/sig/erubi.rbs
DELETED
data/assets/sig/i18n.rbs
DELETED
data/assets/sig/libxml.rbs
DELETED
data/assets/sig/minitest.rbs
DELETED
data/assets/sig/nokogiri.rbs
DELETED
data/assets/sig/pg.rbs
DELETED
data/assets/sig/que.rbs
DELETED
data/assets/sig/racc.rbs
DELETED
data/assets/sig/rack-test.rbs
DELETED
data/assets/sig/rack.rbs
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
module Rack
|
2
|
-
class Server
|
3
|
-
end
|
4
|
-
|
5
|
-
class Response
|
6
|
-
module Helpers
|
7
|
-
def location: () -> untyped
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
class Request
|
12
|
-
module Helpers
|
13
|
-
end
|
14
|
-
|
15
|
-
module Env
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
module Session
|
20
|
-
module Abstract
|
21
|
-
class SessionHash
|
22
|
-
end
|
23
|
-
|
24
|
-
class PersistedSecure
|
25
|
-
class SecureSessionHash
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
class Persisted
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
class SessionId
|
34
|
-
end
|
35
|
-
|
36
|
-
class Dalli
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
module Cache
|
41
|
-
class MetaStore
|
42
|
-
end
|
43
|
-
|
44
|
-
class EntityStore
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
data/assets/sig/rails.rbs
DELETED
data/assets/sig/rdoc.rbs
DELETED
data/assets/sig/sidekiq.rbs
DELETED
data/assets/sig/sneakers.rbs
DELETED
data/assets/sig/stdlib.rbs
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
module DRb
|
2
|
-
end
|
3
|
-
|
4
|
-
module DRb::DRbUndumped
|
5
|
-
end
|
6
|
-
|
7
|
-
module TSort
|
8
|
-
end
|
9
|
-
|
10
|
-
class SimpleDelegator
|
11
|
-
end
|
12
|
-
|
13
|
-
module Gem
|
14
|
-
class Version
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
module OpenSSL
|
19
|
-
class Cipher
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
module FileUtils
|
24
|
-
end
|
data/assets/sig/sucker_punch.rbs
DELETED
data/assets/sig/thor.rbs
DELETED
data/assets/sig/tzinfo.rbs
DELETED