steel_wheel 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +2 -0
- data/Gemfile.lock +44 -47
- data/lib/generators/steel_wheel/application_handler/USAGE +8 -0
- data/lib/generators/steel_wheel/application_handler/application_handler_generator.rb +10 -0
- data/lib/generators/steel_wheel/application_handler/templates/handler_template.rb +3 -0
- data/lib/generators/steel_wheel/command/command_generator.rb +9 -11
- data/lib/generators/steel_wheel/handler/handler_generator.rb +10 -11
- data/lib/generators/steel_wheel/handler/templates/handler_template.rb +6 -2
- data/lib/generators/steel_wheel/params/params_generator.rb +9 -11
- data/lib/generators/steel_wheel/query/query_generator.rb +9 -11
- data/lib/steel_wheel/version.rb +1 -1
- metadata +7 -4
- data/lib/generators/steel_wheel/generic_generator.rb +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13785609cbd9084917cbe11c267122a95e4bcb03578d5c1e67d4bb72b18ab5a3
|
4
|
+
data.tar.gz: 42b38f64b7fc05ebd6b9a03ae529342147b21a218777921b61fb46730e6e3fe4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e97bc94a9f5aff72400db8ea1a23a2303a92855aacdae79f595ee132eea820ffe551a1d870df373e79cbb91ae4ded83403e01a651d3219877b82ddb48942bbc0
|
7
|
+
data.tar.gz: 41dfc695129fa36a886ba8666222cf2d62c244ab00ca516198b9e4f3f94512c810417b01484090909a7a1ff680bca8a814838511e41468246155c0948d58e7b3
|
data/.codeclimate.yml
ADDED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
steel_wheel (0.5.
|
4
|
+
steel_wheel (0.5.2)
|
5
5
|
easy_params (~> 0.1.2)
|
6
6
|
flow_object (~> 0.3.1)
|
7
7
|
memery (~> 1)
|
@@ -10,47 +10,41 @@ PATH
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
actionpack (
|
14
|
-
actionview (=
|
15
|
-
activesupport (=
|
16
|
-
rack (~> 2.0, >= 2.0
|
13
|
+
actionpack (7.0.3.1)
|
14
|
+
actionview (= 7.0.3.1)
|
15
|
+
activesupport (= 7.0.3.1)
|
16
|
+
rack (~> 2.0, >= 2.2.0)
|
17
17
|
rack-test (>= 0.6.3)
|
18
18
|
rails-dom-testing (~> 2.0)
|
19
|
-
rails-html-sanitizer (~> 1.0, >= 1.0
|
20
|
-
actionview (
|
21
|
-
activesupport (=
|
19
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
20
|
+
actionview (7.0.3.1)
|
21
|
+
activesupport (= 7.0.3.1)
|
22
22
|
builder (~> 3.1)
|
23
23
|
erubi (~> 1.4)
|
24
24
|
rails-dom-testing (~> 2.0)
|
25
|
-
rails-html-sanitizer (~> 1.
|
26
|
-
activemodel (
|
27
|
-
activesupport (=
|
28
|
-
activesupport (
|
25
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
26
|
+
activemodel (7.0.3.1)
|
27
|
+
activesupport (= 7.0.3.1)
|
28
|
+
activesupport (7.0.3.1)
|
29
29
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
30
|
-
i18n (>=
|
31
|
-
minitest (
|
32
|
-
tzinfo (~>
|
30
|
+
i18n (>= 1.6, < 2)
|
31
|
+
minitest (>= 5.1)
|
32
|
+
tzinfo (~> 2.0)
|
33
33
|
builder (3.2.4)
|
34
34
|
coderay (1.1.2)
|
35
|
-
concurrent-ruby (1.1.
|
35
|
+
concurrent-ruby (1.1.10)
|
36
36
|
crass (1.0.6)
|
37
37
|
diff-lcs (1.3)
|
38
38
|
docile (1.3.5)
|
39
|
-
dry-
|
39
|
+
dry-container (0.10.1)
|
40
40
|
concurrent-ruby (~> 1.0)
|
41
|
-
|
42
|
-
dry-equalizer (~> 0.2)
|
43
|
-
dry-container (0.7.2)
|
44
|
-
concurrent-ruby (~> 1.0)
|
45
|
-
dry-configurable (~> 0.1, >= 0.1.3)
|
46
|
-
dry-core (0.4.9)
|
41
|
+
dry-core (0.8.1)
|
47
42
|
concurrent-ruby (~> 1.0)
|
48
43
|
dry-equalizer (0.3.0)
|
49
|
-
dry-inflector (0.
|
50
|
-
dry-logic (1.0
|
44
|
+
dry-inflector (0.3.0)
|
45
|
+
dry-logic (1.2.0)
|
51
46
|
concurrent-ruby (~> 1.0)
|
52
|
-
dry-core (~> 0.
|
53
|
-
dry-equalizer (~> 0.2)
|
47
|
+
dry-core (~> 0.5, >= 0.5)
|
54
48
|
dry-struct (1.3.0)
|
55
49
|
dry-core (~> 0.4, >= 0.4.4)
|
56
50
|
dry-equalizer (~> 0.3)
|
@@ -67,42 +61,45 @@ GEM
|
|
67
61
|
activemodel (>= 3.2, < 8)
|
68
62
|
dry-struct (~> 1.3.0)
|
69
63
|
dry-types (~> 1.4.0)
|
70
|
-
erubi (1.
|
64
|
+
erubi (1.11.0)
|
71
65
|
flow_object (0.3.1)
|
72
66
|
hospodar (~> 1)
|
73
67
|
hospodar (1.0.1)
|
74
68
|
dry-inflector (~> 0.1)
|
75
|
-
i18n (1.
|
69
|
+
i18n (1.12.0)
|
76
70
|
concurrent-ruby (~> 1.0)
|
77
71
|
ice_nine (0.11.2)
|
78
72
|
json (2.5.1)
|
79
|
-
loofah (2.
|
73
|
+
loofah (2.18.0)
|
80
74
|
crass (~> 1.0.2)
|
81
75
|
nokogiri (>= 1.5.9)
|
82
|
-
memery (1.
|
76
|
+
memery (1.4.1)
|
83
77
|
ruby2_keywords (~> 0.0.2)
|
84
78
|
method_source (0.9.2)
|
85
|
-
mini_portile2 (2.
|
86
|
-
minitest (5.
|
87
|
-
nokogiri (1.
|
88
|
-
mini_portile2 (~> 2.
|
79
|
+
mini_portile2 (2.8.0)
|
80
|
+
minitest (5.16.3)
|
81
|
+
nokogiri (1.13.8)
|
82
|
+
mini_portile2 (~> 2.8.0)
|
83
|
+
racc (~> 1.4)
|
89
84
|
pry (0.12.2)
|
90
85
|
coderay (~> 1.1.0)
|
91
86
|
method_source (~> 0.9.0)
|
92
|
-
|
93
|
-
rack
|
94
|
-
|
87
|
+
racc (1.6.0)
|
88
|
+
rack (2.2.4)
|
89
|
+
rack-test (2.0.2)
|
90
|
+
rack (>= 1.3)
|
95
91
|
rails-dom-testing (2.0.3)
|
96
92
|
activesupport (>= 4.2.0)
|
97
93
|
nokogiri (>= 1.6)
|
98
|
-
rails-html-sanitizer (1.4.
|
94
|
+
rails-html-sanitizer (1.4.3)
|
99
95
|
loofah (~> 2.3)
|
100
|
-
railties (
|
101
|
-
actionpack (=
|
102
|
-
activesupport (=
|
96
|
+
railties (7.0.3.1)
|
97
|
+
actionpack (= 7.0.3.1)
|
98
|
+
activesupport (= 7.0.3.1)
|
103
99
|
method_source
|
104
|
-
rake (>=
|
105
|
-
thor (
|
100
|
+
rake (>= 12.2)
|
101
|
+
thor (~> 1.0)
|
102
|
+
zeitwerk (~> 2.5)
|
106
103
|
rake (13.0.3)
|
107
104
|
rspec (3.9.0)
|
108
105
|
rspec-core (~> 3.9.0)
|
@@ -126,9 +123,9 @@ GEM
|
|
126
123
|
simplecov-html (~> 0.10.0)
|
127
124
|
simplecov-html (0.10.2)
|
128
125
|
thor (1.2.1)
|
129
|
-
|
130
|
-
|
131
|
-
|
126
|
+
tzinfo (2.0.5)
|
127
|
+
concurrent-ruby (~> 1.0)
|
128
|
+
zeitwerk (2.6.0)
|
132
129
|
|
133
130
|
PLATFORMS
|
134
131
|
ruby
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module SteelWheel
|
2
|
+
class ApplicationHandlerGenerator < Rails::Generators::Base
|
3
|
+
source_root File.expand_path('../templates', __FILE__)
|
4
|
+
|
5
|
+
def copy_files
|
6
|
+
empty_directory Pathname.new('app/handlers')
|
7
|
+
template 'handler_template.rb', "app/handlers/application_handler.rb"
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -1,16 +1,14 @@
|
|
1
|
-
require_relative '../generic_generator'
|
2
|
-
|
3
1
|
module SteelWheel
|
4
|
-
class CommandGenerator <
|
5
|
-
|
6
|
-
|
7
|
-
on_revoke do
|
8
|
-
template 'command_template.rb', "app/commands/#{file_path}_command.rb"
|
9
|
-
end
|
2
|
+
class CommandGenerator < Rails::Generators::NamedBase
|
3
|
+
source_root File.expand_path('../templates', __FILE__)
|
10
4
|
|
11
|
-
|
12
|
-
|
13
|
-
|
5
|
+
def copy_files
|
6
|
+
if behavior == :revoke
|
7
|
+
template 'command_template.rb', "app/commands/#{file_path}_command.rb"
|
8
|
+
elsif behavior == :invoke
|
9
|
+
empty_directory Pathname.new('app/commands').join(*class_path)
|
10
|
+
template 'command_template.rb', "app/commands/#{file_path}_command.rb"
|
11
|
+
end
|
14
12
|
end
|
15
13
|
end
|
16
14
|
end
|
@@ -1,16 +1,15 @@
|
|
1
|
-
require_relative '../generic_generator'
|
2
|
-
|
3
1
|
module SteelWheel
|
4
|
-
class HandlerGenerator <
|
5
|
-
|
6
|
-
|
7
|
-
on_revoke do
|
8
|
-
template 'handler_template.rb', "app/handlers/#{file_path}_handler.rb"
|
9
|
-
end
|
2
|
+
class HandlerGenerator < Rails::Generators::NamedBase
|
3
|
+
source_root File.expand_path('../templates', __FILE__)
|
10
4
|
|
11
|
-
|
12
|
-
|
13
|
-
|
5
|
+
def copy_files
|
6
|
+
if behavior == :revoke
|
7
|
+
template 'handler_template.rb', "app/handlers/#{file_path}_handler.rb"
|
8
|
+
elsif behavior == :invoke
|
9
|
+
empty_directory Pathname.new('app/handlers').join(*class_path)
|
10
|
+
template 'handler_template.rb', "app/handlers/#{file_path}_handler.rb"
|
11
|
+
Rails::Generators.invoke('steel_wheel:application_handler', [], behavior: behavior)
|
12
|
+
end
|
14
13
|
end
|
15
14
|
end
|
16
15
|
end
|
@@ -1,16 +1,14 @@
|
|
1
|
-
require_relative '../generic_generator'
|
2
|
-
|
3
1
|
module SteelWheel
|
4
|
-
class ParamsGenerator <
|
5
|
-
|
6
|
-
|
7
|
-
on_revoke do
|
8
|
-
template 'params_template.rb', "app/params/#{file_path}_params.rb"
|
9
|
-
end
|
2
|
+
class ParamsGenerator < Rails::Generators::NamedBase
|
3
|
+
source_root File.expand_path('../templates', __FILE__)
|
10
4
|
|
11
|
-
|
12
|
-
|
13
|
-
|
5
|
+
def copy_files
|
6
|
+
if behavior == :revoke
|
7
|
+
template 'params_template.rb', "app/params/#{file_path}_params.rb"
|
8
|
+
elsif behavior == :invoke
|
9
|
+
empty_directory Pathname.new('app/params').join(*class_path)
|
10
|
+
template 'params_template.rb', "app/params/#{file_path}_params.rb"
|
11
|
+
end
|
14
12
|
end
|
15
13
|
end
|
16
14
|
end
|
@@ -1,16 +1,14 @@
|
|
1
|
-
require_relative '../generic_generator'
|
2
|
-
|
3
1
|
module SteelWheel
|
4
|
-
class
|
5
|
-
|
6
|
-
|
7
|
-
on_revoke do
|
8
|
-
template 'query_template.rb', "app/queries/#{file_path}_query.rb"
|
9
|
-
end
|
2
|
+
class QueryGenerator < Rails::Generators::NamedBase
|
3
|
+
source_root File.expand_path('../templates', __FILE__)
|
10
4
|
|
11
|
-
|
12
|
-
|
13
|
-
|
5
|
+
def copy_files
|
6
|
+
if behavior == :revoke
|
7
|
+
template 'query_template.rb', "app/queries/#{file_path}_query.rb"
|
8
|
+
elsif behavior == :invoke
|
9
|
+
empty_directory Pathname.new('app/queries').join(*class_path)
|
10
|
+
template 'query_template.rb', "app/queries/#{file_path}_query.rb"
|
11
|
+
end
|
14
12
|
end
|
15
13
|
end
|
16
14
|
end
|
data/lib/steel_wheel/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: steel_wheel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrii Baran
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -163,6 +163,7 @@ executables: []
|
|
163
163
|
extensions: []
|
164
164
|
extra_rdoc_files: []
|
165
165
|
files:
|
166
|
+
- ".codeclimate.yml"
|
166
167
|
- ".github/workflows/ruby.yml"
|
167
168
|
- ".gitignore"
|
168
169
|
- ".rspec"
|
@@ -177,10 +178,12 @@ files:
|
|
177
178
|
- assets/action_diagram.png
|
178
179
|
- bin/console
|
179
180
|
- bin/setup
|
181
|
+
- lib/generators/steel_wheel/application_handler/USAGE
|
182
|
+
- lib/generators/steel_wheel/application_handler/application_handler_generator.rb
|
183
|
+
- lib/generators/steel_wheel/application_handler/templates/handler_template.rb
|
180
184
|
- lib/generators/steel_wheel/command/USAGE
|
181
185
|
- lib/generators/steel_wheel/command/command_generator.rb
|
182
186
|
- lib/generators/steel_wheel/command/templates/command_template.rb
|
183
|
-
- lib/generators/steel_wheel/generic_generator.rb
|
184
187
|
- lib/generators/steel_wheel/handler/USAGE
|
185
188
|
- lib/generators/steel_wheel/handler/handler_generator.rb
|
186
189
|
- lib/generators/steel_wheel/handler/templates/handler_template.rb
|
@@ -221,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
221
224
|
- !ruby/object:Gem::Version
|
222
225
|
version: '0'
|
223
226
|
requirements: []
|
224
|
-
rubygems_version: 3.2.
|
227
|
+
rubygems_version: 3.2.3
|
225
228
|
signing_key:
|
226
229
|
specification_version: 4
|
227
230
|
summary: Adds operations to your rails code
|
@@ -1,23 +0,0 @@
|
|
1
|
-
module SteelWheel
|
2
|
-
class GenericGenerator < Rails::Generators::NamedBase
|
3
|
-
def self.setup_templates_root(templates_relative_path)
|
4
|
-
source_root File.expand_path(templates_relative_path, __dir__)
|
5
|
-
end
|
6
|
-
|
7
|
-
def self.on_revoke(&block)
|
8
|
-
block_given? ? @on_revoke = block : @on_revoke
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.on_invoke(&block)
|
12
|
-
block_given? ? @on_invoke = block : @on_invoke
|
13
|
-
end
|
14
|
-
|
15
|
-
def copy_files
|
16
|
-
if behavior == :revoke
|
17
|
-
instance_eval(&self.class.on_revoke)
|
18
|
-
elsif behavior == :invoke
|
19
|
-
instance_eval(&self.class.on_invoke)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|