g2_command 2.4.0 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +5 -13
- data/.github/workflows/linters.yml +12 -9
- data/.rubocop.yml +1 -1
- data/.tool-versions +1 -1
- data/Appraisals +4 -14
- data/Gemfile.lock +110 -96
- data/README.md +24 -0
- data/g2_command.gemspec +3 -3
- data/gemfiles/rails_6.1.gemfile.lock +84 -88
- data/gemfiles/{rails_6.0.gemfile → rails_7.0.gemfile} +1 -1
- data/gemfiles/rails_7.0.gemfile.lock +242 -0
- data/lib/command/input_middleware/symbolizer.rb +0 -2
- data/lib/command/test_helper.rb +22 -0
- data/lib/command/version.rb +1 -1
- data/lib/command.rb +5 -3
- metadata +11 -16
- data/.github/config/rubocop_linter_action.yml +0 -17
- data/.ruby-version +0 -1
- data/gemfiles/rails_5.1.gemfile +0 -16
- data/gemfiles/rails_5.1.gemfile.lock +0 -203
- data/gemfiles/rails_5.2.gemfile +0 -16
- data/gemfiles/rails_5.2.gemfile.lock +0 -211
- data/gemfiles/rails_6.0.gemfile.lock +0 -226
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f755a4e98e7f55bf7f8c22fe555c535af406c8c3875fedc86fd8d5f6e7af336
|
4
|
+
data.tar.gz: a8143c988052583c9ecbb5e59cf3b20190657c58687947779f770c75833c6c08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5563fca17f8952a6a88af5508964e0f899e1df2c583032e781f2472609a6fa14683589815532ca3f93cb1b233457dfacedbb519e1674b860dd2047096665aaae
|
7
|
+
data.tar.gz: 961832db2ed4b0cf607f3c8199baef7b34395d2acbd4e1d2c7a59837aca309d20732b69f5c642940ab9fb7e4128ef6f7d8e3bdfe19dd8eae4097b56b1f631ff1
|
data/.circleci/config.yml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
version: 2.1
|
2
2
|
|
3
3
|
orbs:
|
4
|
-
ruby: g2crowd/ruby@0.0
|
4
|
+
ruby: g2crowd/ruby@0.1.0
|
5
5
|
|
6
6
|
workflows:
|
7
7
|
version: 2
|
@@ -11,20 +11,12 @@ workflows:
|
|
11
11
|
context: g2crowd-global
|
12
12
|
matrix:
|
13
13
|
parameters:
|
14
|
-
ruby: ['2.5
|
14
|
+
ruby: ['2.7.5', '3.0.3', '3.1.0']
|
15
15
|
appraisal:
|
16
|
-
- rails_5.1
|
17
|
-
- rails_5.2
|
18
|
-
- rails_6.0
|
19
16
|
- rails_6.1
|
20
|
-
|
21
|
-
- ruby: '3.0.0'
|
22
|
-
appraisal: rails_5.1
|
23
|
-
- ruby: '3.0.0'
|
24
|
-
appraisal: rails_5.2
|
25
|
-
- ruby: '3.0.0'
|
26
|
-
appraisal: rails_6.0
|
17
|
+
- rails_7.0
|
27
18
|
- ruby/build:
|
28
19
|
context: g2crowd-global
|
20
|
+
ruby: '3.1.0'
|
29
21
|
setup-database: false
|
30
|
-
bundler-version: '2.
|
22
|
+
bundler-version: '2.3.6'
|
@@ -1,17 +1,20 @@
|
|
1
1
|
name: Linters
|
2
2
|
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
branches-ignore:
|
6
|
-
- main
|
3
|
+
on: [pull_request]
|
7
4
|
|
8
5
|
jobs:
|
9
6
|
build:
|
10
7
|
runs-on: ubuntu-latest
|
11
8
|
steps:
|
12
|
-
- uses: actions/checkout@
|
9
|
+
- uses: actions/checkout@v2
|
13
10
|
|
14
|
-
- name:
|
15
|
-
uses:
|
16
|
-
|
17
|
-
|
11
|
+
- name: Set up Ruby
|
12
|
+
uses: ruby/setup-ruby@v1
|
13
|
+
|
14
|
+
- name: RuboCop Linter
|
15
|
+
uses: reviewdog/action-rubocop@v2.1.0
|
16
|
+
with:
|
17
|
+
rubocop_version: gemfile
|
18
|
+
rubocop_extensions: rubocop-rails:gemfile rubocop-rspec:gemfile rubocop-g2:gemfile
|
19
|
+
rubocop_flags: '--parallel --force-exclusion'
|
20
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
data/.rubocop.yml
CHANGED
data/.tool-versions
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby 3.
|
1
|
+
ruby 3.1.0
|
data/Appraisals
CHANGED
@@ -1,17 +1,7 @@
|
|
1
|
-
appraise 'rails_5.1' do
|
2
|
-
gem 'rails', '~> 5.1', '< 5.2'
|
3
|
-
gem 'sprockets', '~> 3'
|
4
|
-
end
|
5
|
-
|
6
|
-
appraise 'rails_5.2' do
|
7
|
-
gem 'rails', '~> 5.2'
|
8
|
-
gem 'sprockets', '~> 3'
|
9
|
-
end
|
10
|
-
|
11
|
-
appraise 'rails_6.0' do
|
12
|
-
gem 'rails', '~> 6.0.3'
|
13
|
-
end
|
14
|
-
|
15
1
|
appraise 'rails_6.1' do
|
16
2
|
gem 'rails', '~> 6.1.0'
|
17
3
|
end
|
4
|
+
|
5
|
+
appraise 'rails_7.0' do
|
6
|
+
gem 'rails', '~> 7.0.0'
|
7
|
+
end
|
data/Gemfile.lock
CHANGED
@@ -1,115 +1,134 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
g2_command (2.
|
5
|
-
activemodel (>= 5.0, < 7)
|
6
|
-
activesupport (>= 5.0, < 7)
|
4
|
+
g2_command (3.2.0)
|
5
|
+
activemodel (>= 5.0, < 7.1)
|
6
|
+
activesupport (>= 5.0, < 7.1)
|
7
7
|
dry-initializer (~> 3.0)
|
8
8
|
dry-monads (~> 1.3)
|
9
9
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
actioncable (
|
14
|
-
actionpack (=
|
15
|
-
activesupport (=
|
13
|
+
actioncable (7.0.1)
|
14
|
+
actionpack (= 7.0.1)
|
15
|
+
activesupport (= 7.0.1)
|
16
16
|
nio4r (~> 2.0)
|
17
17
|
websocket-driver (>= 0.6.1)
|
18
|
-
actionmailbox (
|
19
|
-
actionpack (=
|
20
|
-
activejob (=
|
21
|
-
activerecord (=
|
22
|
-
activestorage (=
|
23
|
-
activesupport (=
|
18
|
+
actionmailbox (7.0.1)
|
19
|
+
actionpack (= 7.0.1)
|
20
|
+
activejob (= 7.0.1)
|
21
|
+
activerecord (= 7.0.1)
|
22
|
+
activestorage (= 7.0.1)
|
23
|
+
activesupport (= 7.0.1)
|
24
24
|
mail (>= 2.7.1)
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
25
|
+
net-imap
|
26
|
+
net-pop
|
27
|
+
net-smtp
|
28
|
+
actionmailer (7.0.1)
|
29
|
+
actionpack (= 7.0.1)
|
30
|
+
actionview (= 7.0.1)
|
31
|
+
activejob (= 7.0.1)
|
32
|
+
activesupport (= 7.0.1)
|
30
33
|
mail (~> 2.5, >= 2.5.4)
|
34
|
+
net-imap
|
35
|
+
net-pop
|
36
|
+
net-smtp
|
31
37
|
rails-dom-testing (~> 2.0)
|
32
|
-
actionpack (
|
33
|
-
actionview (=
|
34
|
-
activesupport (=
|
35
|
-
rack (~> 2.0, >= 2.0
|
38
|
+
actionpack (7.0.1)
|
39
|
+
actionview (= 7.0.1)
|
40
|
+
activesupport (= 7.0.1)
|
41
|
+
rack (~> 2.0, >= 2.2.0)
|
36
42
|
rack-test (>= 0.6.3)
|
37
43
|
rails-dom-testing (~> 2.0)
|
38
44
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
39
|
-
actiontext (
|
40
|
-
actionpack (=
|
41
|
-
activerecord (=
|
42
|
-
activestorage (=
|
43
|
-
activesupport (=
|
45
|
+
actiontext (7.0.1)
|
46
|
+
actionpack (= 7.0.1)
|
47
|
+
activerecord (= 7.0.1)
|
48
|
+
activestorage (= 7.0.1)
|
49
|
+
activesupport (= 7.0.1)
|
50
|
+
globalid (>= 0.6.0)
|
44
51
|
nokogiri (>= 1.8.5)
|
45
|
-
actionview (
|
46
|
-
activesupport (=
|
52
|
+
actionview (7.0.1)
|
53
|
+
activesupport (= 7.0.1)
|
47
54
|
builder (~> 3.1)
|
48
55
|
erubi (~> 1.4)
|
49
56
|
rails-dom-testing (~> 2.0)
|
50
57
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
51
|
-
activejob (
|
52
|
-
activesupport (=
|
58
|
+
activejob (7.0.1)
|
59
|
+
activesupport (= 7.0.1)
|
53
60
|
globalid (>= 0.3.6)
|
54
|
-
activemodel (
|
55
|
-
activesupport (=
|
56
|
-
activerecord (
|
57
|
-
activemodel (=
|
58
|
-
activesupport (=
|
59
|
-
activestorage (
|
60
|
-
actionpack (=
|
61
|
-
activejob (=
|
62
|
-
activerecord (=
|
63
|
-
activesupport (=
|
64
|
-
marcel (~> 0
|
65
|
-
|
66
|
-
activesupport (
|
61
|
+
activemodel (7.0.1)
|
62
|
+
activesupport (= 7.0.1)
|
63
|
+
activerecord (7.0.1)
|
64
|
+
activemodel (= 7.0.1)
|
65
|
+
activesupport (= 7.0.1)
|
66
|
+
activestorage (7.0.1)
|
67
|
+
actionpack (= 7.0.1)
|
68
|
+
activejob (= 7.0.1)
|
69
|
+
activerecord (= 7.0.1)
|
70
|
+
activesupport (= 7.0.1)
|
71
|
+
marcel (~> 1.0)
|
72
|
+
mini_mime (>= 1.1.0)
|
73
|
+
activesupport (7.0.1)
|
67
74
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
68
75
|
i18n (>= 1.6, < 2)
|
69
76
|
minitest (>= 5.1)
|
70
77
|
tzinfo (~> 2.0)
|
71
|
-
|
72
|
-
appraisal (2.3.0)
|
78
|
+
appraisal (2.4.1)
|
73
79
|
bundler
|
74
80
|
rake
|
75
81
|
thor (>= 0.14.0)
|
76
82
|
ast (2.4.1)
|
77
83
|
builder (3.2.4)
|
78
84
|
coderay (1.1.2)
|
79
|
-
concurrent-ruby (1.1.
|
85
|
+
concurrent-ruby (1.1.9)
|
80
86
|
crass (1.0.6)
|
81
87
|
diff-lcs (1.4.4)
|
88
|
+
digest (3.1.0)
|
82
89
|
docile (1.3.2)
|
83
|
-
dry-core (0.
|
90
|
+
dry-core (0.7.1)
|
84
91
|
concurrent-ruby (~> 1.0)
|
85
|
-
dry-equalizer (0.3.0)
|
86
92
|
dry-initializer (3.0.4)
|
87
|
-
dry-monads (1.
|
93
|
+
dry-monads (1.4.0)
|
88
94
|
concurrent-ruby (~> 1.0)
|
89
|
-
dry-core (~> 0.
|
90
|
-
dry-equalizer
|
95
|
+
dry-core (~> 0.7)
|
91
96
|
erubi (1.10.0)
|
92
97
|
fivemat (1.3.7)
|
93
|
-
globalid (0.
|
94
|
-
activesupport (>=
|
95
|
-
i18n (1.
|
98
|
+
globalid (1.0.0)
|
99
|
+
activesupport (>= 5.0)
|
100
|
+
i18n (1.9.1)
|
96
101
|
concurrent-ruby (~> 1.0)
|
102
|
+
io-wait (0.2.1)
|
97
103
|
json (2.3.0)
|
98
|
-
loofah (2.
|
104
|
+
loofah (2.13.0)
|
99
105
|
crass (~> 1.0.2)
|
100
106
|
nokogiri (>= 1.5.9)
|
101
107
|
mail (2.7.1)
|
102
108
|
mini_mime (>= 0.1.1)
|
103
|
-
marcel (0.
|
104
|
-
mimemagic (~> 0.3.2)
|
109
|
+
marcel (1.0.2)
|
105
110
|
method_source (0.9.2)
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
111
|
+
mini_mime (1.1.2)
|
112
|
+
mini_portile2 (2.7.1)
|
113
|
+
minitest (5.15.0)
|
114
|
+
net-imap (0.2.3)
|
115
|
+
digest
|
116
|
+
net-protocol
|
117
|
+
strscan
|
118
|
+
net-pop (0.1.1)
|
119
|
+
digest
|
120
|
+
net-protocol
|
121
|
+
timeout
|
122
|
+
net-protocol (0.1.2)
|
123
|
+
io-wait
|
124
|
+
timeout
|
125
|
+
net-smtp (0.3.1)
|
126
|
+
digest
|
127
|
+
net-protocol
|
128
|
+
timeout
|
129
|
+
nio4r (2.5.8)
|
130
|
+
nokogiri (1.13.1)
|
131
|
+
mini_portile2 (~> 2.7.0)
|
113
132
|
racc (~> 1.4)
|
114
133
|
parallel (1.19.2)
|
115
134
|
parser (2.7.2.0)
|
@@ -117,40 +136,40 @@ GEM
|
|
117
136
|
pry (0.12.2)
|
118
137
|
coderay (~> 1.1.0)
|
119
138
|
method_source (~> 0.9.0)
|
120
|
-
racc (1.
|
139
|
+
racc (1.6.0)
|
121
140
|
rack (2.2.3)
|
122
141
|
rack-test (1.1.0)
|
123
142
|
rack (>= 1.0, < 3)
|
124
|
-
rails (
|
125
|
-
actioncable (=
|
126
|
-
actionmailbox (=
|
127
|
-
actionmailer (=
|
128
|
-
actionpack (=
|
129
|
-
actiontext (=
|
130
|
-
actionview (=
|
131
|
-
activejob (=
|
132
|
-
activemodel (=
|
133
|
-
activerecord (=
|
134
|
-
activestorage (=
|
135
|
-
activesupport (=
|
143
|
+
rails (7.0.1)
|
144
|
+
actioncable (= 7.0.1)
|
145
|
+
actionmailbox (= 7.0.1)
|
146
|
+
actionmailer (= 7.0.1)
|
147
|
+
actionpack (= 7.0.1)
|
148
|
+
actiontext (= 7.0.1)
|
149
|
+
actionview (= 7.0.1)
|
150
|
+
activejob (= 7.0.1)
|
151
|
+
activemodel (= 7.0.1)
|
152
|
+
activerecord (= 7.0.1)
|
153
|
+
activestorage (= 7.0.1)
|
154
|
+
activesupport (= 7.0.1)
|
136
155
|
bundler (>= 1.15.0)
|
137
|
-
railties (=
|
138
|
-
sprockets-rails (>= 2.0.0)
|
156
|
+
railties (= 7.0.1)
|
139
157
|
rails-dom-testing (2.0.3)
|
140
158
|
activesupport (>= 4.2.0)
|
141
159
|
nokogiri (>= 1.6)
|
142
|
-
rails-html-sanitizer (1.
|
160
|
+
rails-html-sanitizer (1.4.2)
|
143
161
|
loofah (~> 2.3)
|
144
|
-
railties (
|
145
|
-
actionpack (=
|
146
|
-
activesupport (=
|
162
|
+
railties (7.0.1)
|
163
|
+
actionpack (= 7.0.1)
|
164
|
+
activesupport (= 7.0.1)
|
147
165
|
method_source
|
148
|
-
rake (>=
|
166
|
+
rake (>= 12.2)
|
149
167
|
thor (~> 1.0)
|
168
|
+
zeitwerk (~> 2.5)
|
150
169
|
rainbow (3.0.0)
|
151
170
|
rake (12.3.3)
|
152
171
|
regexp_parser (1.8.2)
|
153
|
-
rexml (3.2.
|
172
|
+
rexml (3.2.5)
|
154
173
|
rspec (3.10.0)
|
155
174
|
rspec-core (~> 3.10.0)
|
156
175
|
rspec-expectations (~> 3.10.0)
|
@@ -194,21 +213,16 @@ GEM
|
|
194
213
|
json (>= 1.8, < 3)
|
195
214
|
simplecov-html (~> 0.10.0)
|
196
215
|
simplecov-html (0.10.2)
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
sprockets-rails (3.2.2)
|
201
|
-
actionpack (>= 4.0)
|
202
|
-
activesupport (>= 4.0)
|
203
|
-
sprockets (>= 3.0.0)
|
204
|
-
thor (1.1.0)
|
216
|
+
strscan (3.0.1)
|
217
|
+
thor (1.2.1)
|
218
|
+
timeout (0.2.0)
|
205
219
|
tzinfo (2.0.4)
|
206
220
|
concurrent-ruby (~> 1.0)
|
207
221
|
unicode-display_width (1.7.0)
|
208
|
-
websocket-driver (0.7.
|
222
|
+
websocket-driver (0.7.5)
|
209
223
|
websocket-extensions (>= 0.1.0)
|
210
224
|
websocket-extensions (0.1.5)
|
211
|
-
zeitwerk (2.4
|
225
|
+
zeitwerk (2.5.4)
|
212
226
|
|
213
227
|
PLATFORMS
|
214
228
|
ruby
|
@@ -226,4 +240,4 @@ DEPENDENCIES
|
|
226
240
|
simplecov (= 0.16.1)
|
227
241
|
|
228
242
|
BUNDLED WITH
|
229
|
-
2.
|
243
|
+
2.3.6
|
data/README.md
CHANGED
@@ -22,6 +22,30 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
TODO: Write usage instructions here
|
24
24
|
|
25
|
+
## RSpec Helper
|
26
|
+
|
27
|
+
In `spec_helper.rb`:
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
require 'command/test_helper'
|
31
|
+
|
32
|
+
RSpec.configure do |config|
|
33
|
+
config.include Command::TestHelper
|
34
|
+
end
|
35
|
+
```
|
36
|
+
|
37
|
+
Create a Success outcome object:
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
let(:outcome) { create_outcome(value: 'Return value') }
|
41
|
+
```
|
42
|
+
|
43
|
+
Create a Failure outcome object:
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
let(:outcome) { create_outcome(errors: { user: 'is invalid' }) }
|
47
|
+
```
|
48
|
+
|
25
49
|
## Development
|
26
50
|
|
27
51
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/g2_command.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.summary = 'An implementation of the command pattern using dry-rb'
|
12
12
|
spec.homepage = 'https://github.com/g2crowd/g2_command'
|
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['homepage_uri'] = spec.homepage
|
17
17
|
spec.metadata['source_code_uri'] = 'https://github.com/g2crowd/g2_command'
|
@@ -25,8 +25,8 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
26
26
|
spec.require_paths = ['lib']
|
27
27
|
|
28
|
-
spec.add_dependency 'activemodel', '>= 5.0', '< 7'
|
29
|
-
spec.add_dependency 'activesupport', '>= 5.0', '< 7'
|
28
|
+
spec.add_dependency 'activemodel', '>= 5.0', '< 7.1'
|
29
|
+
spec.add_dependency 'activesupport', '>= 5.0', '< 7.1'
|
30
30
|
spec.add_dependency 'dry-initializer', '~> 3.0'
|
31
31
|
spec.add_dependency 'dry-monads', '~> 1.3'
|
32
32
|
end
|