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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da26cff3b225c84ec291770b543c71ecff63748becadd4247c4fbf00c96f99f5
4
- data.tar.gz: 8225c8d2cda6cd9844bf0d29da89d70aeb6fba2ad025bcec24a2fa08a12bb47f
3
+ metadata.gz: 142bda2468e83474617488e14f28fce49c552ea94ba3e9b99b95daa5c6dc4f98
4
+ data.tar.gz: 511174e192536a8602e58891a8892f80e53a5f3d9e1907ed42271819ebb4c291
5
5
  SHA512:
6
- metadata.gz: 876bdcf8cdebc0a213c5d1e06f8438ae3a295efb190d08cb46d8b6f746415e094b331f2dfafc60af4a7a39c0055a9c2560bb186abc5e768e59f8802815ea2d1b
7
- data.tar.gz: 80d3518948488755ad4b87d90fb35901e3889ae19c5102491b1097b2eda2966bcb0b73e34abae2a8e05e946502abe2fb7bf62dee56ad4563c5926962c04969ad
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.3.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 (6.0.3.2)
16
- actionpack (= 6.0.3.2)
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 (6.0.3.2)
20
- actionpack (= 6.0.3.2)
21
- activejob (= 6.0.3.2)
22
- activerecord (= 6.0.3.2)
23
- activestorage (= 6.0.3.2)
24
- activesupport (= 6.0.3.2)
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
- actionmailer (6.0.3.2)
27
- actionpack (= 6.0.3.2)
28
- actionview (= 6.0.3.2)
29
- activejob (= 6.0.3.2)
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 (6.0.3.2)
33
- actionview (= 6.0.3.2)
34
- activesupport (= 6.0.3.2)
35
- rack (~> 2.0, >= 2.0.8)
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 (6.0.3.2)
40
- actionpack (= 6.0.3.2)
41
- activerecord (= 6.0.3.2)
42
- activestorage (= 6.0.3.2)
43
- activesupport (= 6.0.3.2)
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 (6.0.3.2)
46
- activesupport (= 6.0.3.2)
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 (6.0.3.2)
52
- activesupport (= 6.0.3.2)
60
+ activejob (7.0.3)
61
+ activesupport (= 7.0.3)
53
62
  globalid (>= 0.3.6)
54
- activemodel (6.0.3.2)
55
- activesupport (= 6.0.3.2)
56
- activerecord (6.0.3.2)
57
- activemodel (= 6.0.3.2)
58
- activesupport (= 6.0.3.2)
59
- activestorage (6.0.3.2)
60
- actionpack (= 6.0.3.2)
61
- activejob (= 6.0.3.2)
62
- activerecord (= 6.0.3.2)
63
- marcel (~> 0.3.1)
64
- activesupport (6.0.3.2)
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 (>= 0.7, < 2)
67
- minitest (~> 5.1)
68
- tzinfo (~> 1.1)
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.1)
81
+ ast (2.4.2)
72
82
  builder (3.2.4)
73
- concurrent-ruby (1.1.7)
83
+ concurrent-ruby (1.1.10)
74
84
  crass (1.0.6)
75
- dry-configurable (0.11.6)
85
+ digest (3.1.0)
86
+ dry-configurable (0.15.0)
76
87
  concurrent-ruby (~> 1.0)
77
- dry-core (~> 0.4, >= 0.4.7)
78
- dry-equalizer (~> 0.2)
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.1, >= 0.1.3)
82
- dry-core (0.4.9)
91
+ dry-configurable (~> 0.13, >= 0.13.0)
92
+ dry-core (0.7.1)
83
93
  concurrent-ruby (~> 1.0)
84
- dry-equalizer (0.3.0)
85
- dry-inflector (0.2.0)
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.7)
99
+ dry-logic (1.2.0)
91
100
  concurrent-ruby (~> 1.0)
92
- dry-core (~> 0.2)
93
- dry-equalizer (~> 0.2)
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.4, >= 0.4.4)
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.9.0)
102
- globalid (0.4.2)
103
- activesupport (>= 4.2.0)
104
- i18n (1.8.5)
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
- loofah (2.6.0)
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.3.3)
112
- mimemagic (~> 0.3.2)
119
+ marcel (1.0.2)
113
120
  method_source (1.0.0)
114
- mimemagic (0.3.5)
115
- mini_mime (1.0.2)
116
- mini_portile2 (2.4.0)
117
- minitest (5.14.1)
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.4.2)
126
+ minitest-reporters (1.5.0)
121
127
  ansi
122
128
  builder
123
129
  minitest (>= 5.0)
124
130
  ruby-progressbar
125
- mocha (1.11.2)
126
- nio4r (2.5.2)
127
- nokogiri (1.10.10)
128
- mini_portile2 (~> 2.4.0)
129
- parallel (1.19.2)
130
- parser (2.7.1.4)
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
- rack (2.2.3)
133
- rack-test (1.1.0)
134
- rack (>= 1.0, < 3)
135
- rails (6.0.3.2)
136
- actioncable (= 6.0.3.2)
137
- actionmailbox (= 6.0.3.2)
138
- actionmailer (= 6.0.3.2)
139
- actionpack (= 6.0.3.2)
140
- actiontext (= 6.0.3.2)
141
- actionview (= 6.0.3.2)
142
- activejob (= 6.0.3.2)
143
- activemodel (= 6.0.3.2)
144
- activerecord (= 6.0.3.2)
145
- activestorage (= 6.0.3.2)
146
- activesupport (= 6.0.3.2)
147
- bundler (>= 1.3.0)
148
- railties (= 6.0.3.2)
149
- sprockets-rails (>= 2.0.0)
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.0)
174
+ rails-html-sanitizer (1.4.3)
154
175
  loofah (~> 2.3)
155
- railties (6.0.3.2)
156
- actionpack (= 6.0.3.2)
157
- activesupport (= 6.0.3.2)
176
+ railties (7.0.3)
177
+ actionpack (= 7.0.3)
178
+ activesupport (= 7.0.3)
158
179
  method_source
159
- rake (>= 0.8.7)
160
- thor (>= 0.20.3, < 2.0)
161
- rainbow (3.0.0)
162
- rake (13.0.1)
163
- regexp_parser (1.7.1)
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.4)
168
- rubocop (0.89.1)
189
+ rexml (3.2.5)
190
+ rubocop (1.31.1)
191
+ json (~> 2.3)
169
192
  parallel (~> 1.10)
170
- parser (>= 2.7.1.1)
193
+ parser (>= 3.1.0.0)
171
194
  rainbow (>= 2.2.2, < 4.0)
172
- regexp_parser (>= 1.7)
173
- rexml
174
- rubocop-ast (>= 0.3.0, < 1.0)
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, < 2.0)
177
- rubocop-ast (0.3.0)
178
- parser (>= 2.7.1.4)
179
- rubocop-performance (1.7.1)
180
- rubocop (>= 0.82.0)
181
- ruby-progressbar (1.10.1)
182
- sprockets (4.0.2)
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
- rack (> 1, < 3)
185
- sprockets-rails (3.2.1)
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.4.0)
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.1.4
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
- def perform
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.3.0')
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Creed
4
- VERSION = '0.4.0'
4
+ VERSION = '0.5.0'
5
5
  end
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.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: 2020-08-19 00:00:00.000000000 Z
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.3.0
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.1.2
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: []