rbs_draper 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/.vscode/extensions.json +2 -1
- data/.vscode/settings.json +2 -1
- data/Gemfile +1 -1
- data/Gemfile.lock +5 -5
- data/lib/rbs_draper/decorator.rb +19 -11
- data/lib/rbs_draper/version.rb +1 -1
- data/sig/rbs_draper/decorator.rbs +1 -0
- 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: 8c95d27feecc3c5d521e7a613fe3a9e076e90953f2d0f4f3b639b99d1fe4f48d
|
4
|
+
data.tar.gz: 258c93e835b97785036a214987fb2f91df8186f9f1164ec902b9a06ba0ee919d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 790e0ecb25f3bd26233990ff3bd8e71bfe25a0276f60401d5ebe52d205daf7ad9e0a88ca3234e2d752c29e3d2d30dc7821df67136fbf60747a96f28425ddab9e
|
7
|
+
data.tar.gz: 14aa193094bf45c5ace190831b9c6bacadd24e898462d8e6dbf286f8de80016ddf92813f7101d2fd950bd8e2d492203c5dbfdb20bf1149658304caa243fcb79b
|
data/.rubocop.yml
CHANGED
data/.vscode/extensions.json
CHANGED
data/.vscode/settings.json
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rbs_draper (0.1.
|
4
|
+
rbs_draper (0.1.1)
|
5
5
|
draper
|
6
6
|
rbs_rails
|
7
7
|
|
@@ -76,7 +76,7 @@ GEM
|
|
76
76
|
pry (0.14.2)
|
77
77
|
coderay (~> 1.1)
|
78
78
|
method_source (~> 1.0)
|
79
|
-
racc (1.7.
|
79
|
+
racc (1.7.1)
|
80
80
|
rack (2.2.7)
|
81
81
|
rack-test (2.1.0)
|
82
82
|
rack (>= 1.3)
|
@@ -122,10 +122,10 @@ GEM
|
|
122
122
|
diff-lcs (>= 1.2.0, < 2.0)
|
123
123
|
rspec-support (~> 3.12.0)
|
124
124
|
rspec-support (3.12.0)
|
125
|
-
rubocop (1.52.
|
125
|
+
rubocop (1.52.1)
|
126
126
|
json (~> 2.3)
|
127
127
|
parallel (~> 1.10)
|
128
|
-
parser (>= 3.2.
|
128
|
+
parser (>= 3.2.2.3)
|
129
129
|
rainbow (>= 2.2.2, < 4.0)
|
130
130
|
regexp_parser (>= 1.8, < 3.0)
|
131
131
|
rexml (>= 3.2.5, < 4.0)
|
@@ -172,7 +172,7 @@ DEPENDENCIES
|
|
172
172
|
rbs_draper!
|
173
173
|
rspec
|
174
174
|
rspec-daemon
|
175
|
-
rubocop (~> 1.
|
175
|
+
rubocop (~> 1.52)
|
176
176
|
steep
|
177
177
|
|
178
178
|
BUNDLED WITH
|
data/lib/rbs_draper/decorator.rb
CHANGED
@@ -11,10 +11,11 @@ module RbsDraper
|
|
11
11
|
end
|
12
12
|
|
13
13
|
class Generator
|
14
|
-
attr_reader :klass, :rbs_builder
|
14
|
+
attr_reader :klass, :klass_name, :rbs_builder
|
15
15
|
|
16
16
|
def initialize(klass, rbs_builder)
|
17
17
|
@klass = klass
|
18
|
+
@klass_name = RbsRails::Util.module_name(klass)
|
18
19
|
@rbs_builder = rbs_builder
|
19
20
|
end
|
20
21
|
|
@@ -37,16 +38,23 @@ module RbsDraper
|
|
37
38
|
end
|
38
39
|
|
39
40
|
def header
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
41
|
+
namespace = +""
|
42
|
+
klass_name.split("::").map do |mod_name|
|
43
|
+
namespace += "::#{mod_name}"
|
44
|
+
mod_object = Object.const_get(namespace)
|
45
|
+
case mod_object
|
46
|
+
when Class
|
47
|
+
# @type var superclass: Class
|
48
|
+
superclass = _ = mod_object.superclass
|
49
|
+
superclass_name = RbsRails::Util.module_name(superclass)
|
50
|
+
|
51
|
+
"class #{mod_name} < ::#{superclass_name}"
|
52
|
+
when Module
|
53
|
+
"module #{mod_name}"
|
54
|
+
else
|
55
|
+
raise "unreachable"
|
56
|
+
end
|
57
|
+
end.join("\n")
|
50
58
|
end
|
51
59
|
|
52
60
|
def method_decls
|
data/lib/rbs_draper/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbs_draper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takeshi KOMIYA
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: draper
|