creed 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +148 -130
- data/README.md +4 -2
- data/creed.gemspec +1 -1
- data/lib/creed/command.rb +1 -3
- data/lib/creed/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 142bda2468e83474617488e14f28fce49c552ea94ba3e9b99b95daa5c6dc4f98
|
4
|
+
data.tar.gz: 511174e192536a8602e58891a8892f80e53a5f3d9e1907ed42271819ebb4c291
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f92e13c94071929759e3575e8f3b214292865ca42a65bc6a9a7b2ec1a842215744db9b36f9924a9d7747f35439270d0d7907f19b38c9b74eec5f2d5be7020df1
|
7
|
+
data.tar.gz: 74d58707ce0286211045f34d8670c93bd4d295275f8b3b5ac96194413ff2745a36568209d7071f9e79b759a47de0bd9fb6f26946ef215a242c2f6878018ae785
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
creed (0.
|
4
|
+
creed (0.4.2)
|
5
5
|
actionpack (>= 6.0)
|
6
6
|
dry-initializer
|
7
7
|
dry-initializer-rails
|
@@ -12,189 +12,207 @@ PATH
|
|
12
12
|
GEM
|
13
13
|
remote: https://rubygems.org/
|
14
14
|
specs:
|
15
|
-
actioncable (
|
16
|
-
actionpack (=
|
15
|
+
actioncable (7.0.3)
|
16
|
+
actionpack (= 7.0.3)
|
17
|
+
activesupport (= 7.0.3)
|
17
18
|
nio4r (~> 2.0)
|
18
19
|
websocket-driver (>= 0.6.1)
|
19
|
-
actionmailbox (
|
20
|
-
actionpack (=
|
21
|
-
activejob (=
|
22
|
-
activerecord (=
|
23
|
-
activestorage (=
|
24
|
-
activesupport (=
|
20
|
+
actionmailbox (7.0.3)
|
21
|
+
actionpack (= 7.0.3)
|
22
|
+
activejob (= 7.0.3)
|
23
|
+
activerecord (= 7.0.3)
|
24
|
+
activestorage (= 7.0.3)
|
25
|
+
activesupport (= 7.0.3)
|
25
26
|
mail (>= 2.7.1)
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
net-imap
|
28
|
+
net-pop
|
29
|
+
net-smtp
|
30
|
+
actionmailer (7.0.3)
|
31
|
+
actionpack (= 7.0.3)
|
32
|
+
actionview (= 7.0.3)
|
33
|
+
activejob (= 7.0.3)
|
34
|
+
activesupport (= 7.0.3)
|
30
35
|
mail (~> 2.5, >= 2.5.4)
|
36
|
+
net-imap
|
37
|
+
net-pop
|
38
|
+
net-smtp
|
31
39
|
rails-dom-testing (~> 2.0)
|
32
|
-
actionpack (
|
33
|
-
actionview (=
|
34
|
-
activesupport (=
|
35
|
-
rack (~> 2.0, >= 2.0
|
40
|
+
actionpack (7.0.3)
|
41
|
+
actionview (= 7.0.3)
|
42
|
+
activesupport (= 7.0.3)
|
43
|
+
rack (~> 2.0, >= 2.2.0)
|
36
44
|
rack-test (>= 0.6.3)
|
37
45
|
rails-dom-testing (~> 2.0)
|
38
46
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
39
|
-
actiontext (
|
40
|
-
actionpack (=
|
41
|
-
activerecord (=
|
42
|
-
activestorage (=
|
43
|
-
activesupport (=
|
47
|
+
actiontext (7.0.3)
|
48
|
+
actionpack (= 7.0.3)
|
49
|
+
activerecord (= 7.0.3)
|
50
|
+
activestorage (= 7.0.3)
|
51
|
+
activesupport (= 7.0.3)
|
52
|
+
globalid (>= 0.6.0)
|
44
53
|
nokogiri (>= 1.8.5)
|
45
|
-
actionview (
|
46
|
-
activesupport (=
|
54
|
+
actionview (7.0.3)
|
55
|
+
activesupport (= 7.0.3)
|
47
56
|
builder (~> 3.1)
|
48
57
|
erubi (~> 1.4)
|
49
58
|
rails-dom-testing (~> 2.0)
|
50
59
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
51
|
-
activejob (
|
52
|
-
activesupport (=
|
60
|
+
activejob (7.0.3)
|
61
|
+
activesupport (= 7.0.3)
|
53
62
|
globalid (>= 0.3.6)
|
54
|
-
activemodel (
|
55
|
-
activesupport (=
|
56
|
-
activerecord (
|
57
|
-
activemodel (=
|
58
|
-
activesupport (=
|
59
|
-
activestorage (
|
60
|
-
actionpack (=
|
61
|
-
activejob (=
|
62
|
-
activerecord (=
|
63
|
-
|
64
|
-
|
63
|
+
activemodel (7.0.3)
|
64
|
+
activesupport (= 7.0.3)
|
65
|
+
activerecord (7.0.3)
|
66
|
+
activemodel (= 7.0.3)
|
67
|
+
activesupport (= 7.0.3)
|
68
|
+
activestorage (7.0.3)
|
69
|
+
actionpack (= 7.0.3)
|
70
|
+
activejob (= 7.0.3)
|
71
|
+
activerecord (= 7.0.3)
|
72
|
+
activesupport (= 7.0.3)
|
73
|
+
marcel (~> 1.0)
|
74
|
+
mini_mime (>= 1.1.0)
|
75
|
+
activesupport (7.0.3)
|
65
76
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
66
|
-
i18n (>=
|
67
|
-
minitest (
|
68
|
-
tzinfo (~>
|
69
|
-
zeitwerk (~> 2.2, >= 2.2.2)
|
77
|
+
i18n (>= 1.6, < 2)
|
78
|
+
minitest (>= 5.1)
|
79
|
+
tzinfo (~> 2.0)
|
70
80
|
ansi (1.5.0)
|
71
|
-
ast (2.4.
|
81
|
+
ast (2.4.2)
|
72
82
|
builder (3.2.4)
|
73
|
-
concurrent-ruby (1.1.
|
83
|
+
concurrent-ruby (1.1.10)
|
74
84
|
crass (1.0.6)
|
75
|
-
|
85
|
+
digest (3.1.0)
|
86
|
+
dry-configurable (0.15.0)
|
76
87
|
concurrent-ruby (~> 1.0)
|
77
|
-
dry-core (~> 0.
|
78
|
-
|
79
|
-
dry-container (0.7.2)
|
88
|
+
dry-core (~> 0.6)
|
89
|
+
dry-container (0.9.0)
|
80
90
|
concurrent-ruby (~> 1.0)
|
81
|
-
dry-configurable (~> 0.
|
82
|
-
dry-core (0.
|
91
|
+
dry-configurable (~> 0.13, >= 0.13.0)
|
92
|
+
dry-core (0.7.1)
|
83
93
|
concurrent-ruby (~> 1.0)
|
84
|
-
dry-
|
85
|
-
dry-
|
86
|
-
dry-initializer (3.0.3)
|
94
|
+
dry-inflector (0.2.1)
|
95
|
+
dry-initializer (3.1.1)
|
87
96
|
dry-initializer-rails (3.1.1)
|
88
97
|
dry-initializer (>= 2.4, < 4)
|
89
98
|
rails (> 3.0)
|
90
|
-
dry-logic (1.0
|
99
|
+
dry-logic (1.2.0)
|
91
100
|
concurrent-ruby (~> 1.0)
|
92
|
-
dry-core (~> 0.
|
93
|
-
|
94
|
-
dry-types (1.4.0)
|
101
|
+
dry-core (~> 0.5, >= 0.5)
|
102
|
+
dry-types (1.5.1)
|
95
103
|
concurrent-ruby (~> 1.0)
|
96
104
|
dry-container (~> 0.3)
|
97
|
-
dry-core (~> 0.
|
98
|
-
dry-equalizer (~> 0.3)
|
105
|
+
dry-core (~> 0.5, >= 0.5)
|
99
106
|
dry-inflector (~> 0.1, >= 0.1.2)
|
100
107
|
dry-logic (~> 1.0, >= 1.0.2)
|
101
|
-
erubi (1.
|
102
|
-
globalid (0.
|
103
|
-
activesupport (>=
|
104
|
-
i18n (1.
|
108
|
+
erubi (1.10.0)
|
109
|
+
globalid (1.0.0)
|
110
|
+
activesupport (>= 5.0)
|
111
|
+
i18n (1.10.0)
|
105
112
|
concurrent-ruby (~> 1.0)
|
106
|
-
|
113
|
+
json (2.6.2)
|
114
|
+
loofah (2.18.0)
|
107
115
|
crass (~> 1.0.2)
|
108
116
|
nokogiri (>= 1.5.9)
|
109
117
|
mail (2.7.1)
|
110
118
|
mini_mime (>= 0.1.1)
|
111
|
-
marcel (0.
|
112
|
-
mimemagic (~> 0.3.2)
|
119
|
+
marcel (1.0.2)
|
113
120
|
method_source (1.0.0)
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
minitest (
|
118
|
-
minitest-focus (1.2.1)
|
121
|
+
mini_mime (1.1.2)
|
122
|
+
mini_portile2 (2.8.0)
|
123
|
+
minitest (5.16.2)
|
124
|
+
minitest-focus (1.3.1)
|
119
125
|
minitest (>= 4, < 6)
|
120
|
-
minitest-reporters (1.
|
126
|
+
minitest-reporters (1.5.0)
|
121
127
|
ansi
|
122
128
|
builder
|
123
129
|
minitest (>= 5.0)
|
124
130
|
ruby-progressbar
|
125
|
-
mocha (1.
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
+
mocha (1.14.0)
|
132
|
+
net-imap (0.2.3)
|
133
|
+
digest
|
134
|
+
net-protocol
|
135
|
+
strscan
|
136
|
+
net-pop (0.1.1)
|
137
|
+
digest
|
138
|
+
net-protocol
|
139
|
+
timeout
|
140
|
+
net-protocol (0.1.3)
|
141
|
+
timeout
|
142
|
+
net-smtp (0.3.1)
|
143
|
+
digest
|
144
|
+
net-protocol
|
145
|
+
timeout
|
146
|
+
nio4r (2.5.8)
|
147
|
+
nokogiri (1.13.6)
|
148
|
+
mini_portile2 (~> 2.8.0)
|
149
|
+
racc (~> 1.4)
|
150
|
+
parallel (1.22.1)
|
151
|
+
parser (3.1.2.0)
|
131
152
|
ast (~> 2.4.1)
|
132
|
-
|
133
|
-
rack
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
153
|
+
racc (1.6.0)
|
154
|
+
rack (2.2.4)
|
155
|
+
rack-test (2.0.2)
|
156
|
+
rack (>= 1.3)
|
157
|
+
rails (7.0.3)
|
158
|
+
actioncable (= 7.0.3)
|
159
|
+
actionmailbox (= 7.0.3)
|
160
|
+
actionmailer (= 7.0.3)
|
161
|
+
actionpack (= 7.0.3)
|
162
|
+
actiontext (= 7.0.3)
|
163
|
+
actionview (= 7.0.3)
|
164
|
+
activejob (= 7.0.3)
|
165
|
+
activemodel (= 7.0.3)
|
166
|
+
activerecord (= 7.0.3)
|
167
|
+
activestorage (= 7.0.3)
|
168
|
+
activesupport (= 7.0.3)
|
169
|
+
bundler (>= 1.15.0)
|
170
|
+
railties (= 7.0.3)
|
150
171
|
rails-dom-testing (2.0.3)
|
151
172
|
activesupport (>= 4.2.0)
|
152
173
|
nokogiri (>= 1.6)
|
153
|
-
rails-html-sanitizer (1.3
|
174
|
+
rails-html-sanitizer (1.4.3)
|
154
175
|
loofah (~> 2.3)
|
155
|
-
railties (
|
156
|
-
actionpack (=
|
157
|
-
activesupport (=
|
176
|
+
railties (7.0.3)
|
177
|
+
actionpack (= 7.0.3)
|
178
|
+
activesupport (= 7.0.3)
|
158
179
|
method_source
|
159
|
-
rake (>=
|
160
|
-
thor (
|
161
|
-
|
162
|
-
|
163
|
-
|
180
|
+
rake (>= 12.2)
|
181
|
+
thor (~> 1.0)
|
182
|
+
zeitwerk (~> 2.5)
|
183
|
+
rainbow (3.1.1)
|
184
|
+
rake (13.0.6)
|
185
|
+
regexp_parser (2.5.0)
|
164
186
|
responders (3.0.1)
|
165
187
|
actionpack (>= 5.0)
|
166
188
|
railties (>= 5.0)
|
167
|
-
rexml (3.2.
|
168
|
-
rubocop (
|
189
|
+
rexml (3.2.5)
|
190
|
+
rubocop (1.31.1)
|
191
|
+
json (~> 2.3)
|
169
192
|
parallel (~> 1.10)
|
170
|
-
parser (>=
|
193
|
+
parser (>= 3.1.0.0)
|
171
194
|
rainbow (>= 2.2.2, < 4.0)
|
172
|
-
regexp_parser (>= 1.
|
173
|
-
rexml
|
174
|
-
rubocop-ast (>=
|
195
|
+
regexp_parser (>= 1.8, < 3.0)
|
196
|
+
rexml (>= 3.2.5, < 4.0)
|
197
|
+
rubocop-ast (>= 1.18.0, < 2.0)
|
175
198
|
ruby-progressbar (~> 1.7)
|
176
|
-
unicode-display_width (>= 1.4.0, <
|
177
|
-
rubocop-ast (
|
178
|
-
parser (>=
|
179
|
-
rubocop-performance (1.
|
180
|
-
rubocop (>=
|
181
|
-
|
182
|
-
|
199
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
200
|
+
rubocop-ast (1.18.0)
|
201
|
+
parser (>= 3.1.1.0)
|
202
|
+
rubocop-performance (1.14.2)
|
203
|
+
rubocop (>= 1.7.0, < 2.0)
|
204
|
+
rubocop-ast (>= 0.4.0)
|
205
|
+
ruby-progressbar (1.11.0)
|
206
|
+
strscan (3.0.3)
|
207
|
+
thor (1.2.1)
|
208
|
+
timeout (0.3.0)
|
209
|
+
tzinfo (2.0.4)
|
183
210
|
concurrent-ruby (~> 1.0)
|
184
|
-
|
185
|
-
|
186
|
-
actionpack (>= 4.0)
|
187
|
-
activesupport (>= 4.0)
|
188
|
-
sprockets (>= 3.0.0)
|
189
|
-
thor (1.0.1)
|
190
|
-
thread_safe (0.3.6)
|
191
|
-
tzinfo (1.2.7)
|
192
|
-
thread_safe (~> 0.1)
|
193
|
-
unicode-display_width (1.7.0)
|
194
|
-
websocket-driver (0.7.3)
|
211
|
+
unicode-display_width (2.2.0)
|
212
|
+
websocket-driver (0.7.5)
|
195
213
|
websocket-extensions (>= 0.1.0)
|
196
214
|
websocket-extensions (0.1.5)
|
197
|
-
zeitwerk (2.
|
215
|
+
zeitwerk (2.6.0)
|
198
216
|
|
199
217
|
PLATFORMS
|
200
218
|
ruby
|
@@ -211,4 +229,4 @@ DEPENDENCIES
|
|
211
229
|
rubocop-performance
|
212
230
|
|
213
231
|
BUNDLED WITH
|
214
|
-
2.
|
232
|
+
2.3.17
|
data/README.md
CHANGED
@@ -20,7 +20,7 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
Create your Command classes in `app/commands`, extending `Creed::Command`, and implementing a `perform` method. Optionally defining params and/or options that can be passed when performing the command.
|
23
|
+
Create your Command classes in `app/commands`, extending `Creed::Command`, and implementing a `perform` method. Optionally defining params and/or options that can be passed when performing the command. Unknown arguments will raise an exception.
|
24
24
|
|
25
25
|
```ruby
|
26
26
|
class CreateUser < Creed::Command
|
@@ -28,7 +28,9 @@ class CreateUser < Creed::Command
|
|
28
28
|
param :user_params, Creed::Types.Instance(ActionController::Parameters)
|
29
29
|
option :validate, default: true
|
30
30
|
|
31
|
-
|
31
|
+
# #perform has access to all options and params and named attributes. You can also pass it a
|
32
|
+
# block.
|
33
|
+
def perform(&block)
|
32
34
|
# Do something here...
|
33
35
|
end
|
34
36
|
end
|
data/creed.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.summary = 'Command pattern for Rails'
|
12
12
|
spec.homepage = 'https://github.com/joelmoss/creed'
|
13
13
|
spec.license = 'MIT'
|
14
|
-
spec.required_ruby_version = Gem::Requirement.new('>= 2.
|
14
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 2.7.0')
|
15
15
|
|
16
16
|
# spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
17
17
|
|
data/lib/creed/command.rb
CHANGED
@@ -17,11 +17,9 @@ class Creed::Command
|
|
17
17
|
# Raise on unknown options.
|
18
18
|
unknown_keys = options.keys - dry_initializer.options.map(&:source)
|
19
19
|
raise ArgumentError, "unknown keys: `#{unknown_keys.join '`, `'}`" if unknown_keys.any?
|
20
|
-
|
21
|
-
context << options
|
22
20
|
end
|
23
21
|
|
24
|
-
new(*context).perform(&block)
|
22
|
+
(options.empty? ? new(*context) : new(*context, **options)).perform(&block)
|
25
23
|
end
|
26
24
|
|
27
25
|
def perform
|
data/lib/creed/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: creed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joel Moss
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -94,7 +94,7 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
-
description:
|
97
|
+
description:
|
98
98
|
email:
|
99
99
|
- joel@developwithstyle.com
|
100
100
|
executables: []
|
@@ -126,7 +126,7 @@ metadata:
|
|
126
126
|
homepage_uri: https://github.com/joelmoss/creed
|
127
127
|
source_code_uri: https://github.com/joelmoss/creed
|
128
128
|
changelog_uri: https://github.com/joelmoss/creed/releases
|
129
|
-
post_install_message:
|
129
|
+
post_install_message:
|
130
130
|
rdoc_options: []
|
131
131
|
require_paths:
|
132
132
|
- lib
|
@@ -134,15 +134,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
134
134
|
requirements:
|
135
135
|
- - ">="
|
136
136
|
- !ruby/object:Gem::Version
|
137
|
-
version: 2.
|
137
|
+
version: 2.7.0
|
138
138
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
139
139
|
requirements:
|
140
140
|
- - ">="
|
141
141
|
- !ruby/object:Gem::Version
|
142
142
|
version: '0'
|
143
143
|
requirements: []
|
144
|
-
rubygems_version: 3.
|
145
|
-
signing_key:
|
144
|
+
rubygems_version: 3.3.7
|
145
|
+
signing_key:
|
146
146
|
specification_version: 4
|
147
147
|
summary: Command pattern for Rails
|
148
148
|
test_files: []
|