g2_command 2.0.0 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.circleci/config.yml +30 -0
- data/.github/config/rubocop_linter_action.yml +17 -0
- data/.github/workflows/linters.yml +17 -0
- data/.rubocop.yml +9 -39
- data/.ruby-version +1 -1
- data/.tool-versions +1 -1
- data/Appraisals +17 -0
- data/Gemfile +4 -2
- data/Gemfile.lock +133 -107
- data/README.md +2 -2
- data/g2_command.gemspec +3 -3
- data/gemfiles/.bundle/config +2 -0
- data/gemfiles/rails_5.1.gemfile +16 -0
- data/gemfiles/rails_5.1.gemfile.lock +203 -0
- data/gemfiles/rails_5.2.gemfile +16 -0
- data/gemfiles/rails_5.2.gemfile.lock +211 -0
- data/gemfiles/rails_6.0.gemfile +15 -0
- data/gemfiles/rails_6.0.gemfile.lock +226 -0
- data/gemfiles/rails_6.1.gemfile +15 -0
- data/gemfiles/rails_6.1.gemfile.lock +229 -0
- data/lib/command.rb +3 -4
- data/lib/command/version.rb +1 -1
- data/lib/gem_ext/active_model/errors.rb +10 -0
- metadata +26 -13
- data/.github/workflows/ruby.yml +0 -26
data/lib/command.rb
CHANGED
|
@@ -5,6 +5,7 @@ require 'active_model'
|
|
|
5
5
|
require 'dry-initializer'
|
|
6
6
|
require 'dry-monads'
|
|
7
7
|
|
|
8
|
+
require 'gem_ext/active_model/errors' if ActiveModel.version < Gem::Version.new('5.2')
|
|
8
9
|
require 'command/failure'
|
|
9
10
|
require 'command/input_middleware'
|
|
10
11
|
require 'command/interrupt'
|
|
@@ -12,14 +13,13 @@ require 'command/interrupt'
|
|
|
12
13
|
module Command
|
|
13
14
|
extend ActiveSupport::Concern
|
|
14
15
|
|
|
15
|
-
# rubocop:disable Metrics/BlockLength
|
|
16
16
|
included do
|
|
17
17
|
extend Dry::Initializer
|
|
18
18
|
include Dry::Monads[:result]
|
|
19
19
|
include ActiveModel::Validations
|
|
20
20
|
|
|
21
21
|
def initialize(inputs = {})
|
|
22
|
-
super(Command::InputMiddleware.call(inputs))
|
|
22
|
+
super(**Command::InputMiddleware.call(inputs))
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def execute
|
|
@@ -50,11 +50,10 @@ module Command
|
|
|
50
50
|
self.class.dry_initializer.attributes(self)
|
|
51
51
|
end
|
|
52
52
|
end
|
|
53
|
-
# rubocop:enable Metrics/BlockLength
|
|
54
53
|
|
|
55
54
|
class_methods do
|
|
56
55
|
def run(inputs = {})
|
|
57
|
-
new(inputs).run
|
|
56
|
+
new(**Command::InputMiddleware.call(inputs)).run
|
|
58
57
|
end
|
|
59
58
|
|
|
60
59
|
def run!(inputs = {})
|
data/lib/command/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: g2_command
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Hamed Asghari
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-03-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activemodel
|
|
@@ -16,7 +16,7 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
19
|
+
version: '5.0'
|
|
20
20
|
- - "<"
|
|
21
21
|
- !ruby/object:Gem::Version
|
|
22
22
|
version: '7'
|
|
@@ -26,7 +26,7 @@ dependencies:
|
|
|
26
26
|
requirements:
|
|
27
27
|
- - ">="
|
|
28
28
|
- !ruby/object:Gem::Version
|
|
29
|
-
version: '
|
|
29
|
+
version: '5.0'
|
|
30
30
|
- - "<"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
32
|
version: '7'
|
|
@@ -36,7 +36,7 @@ dependencies:
|
|
|
36
36
|
requirements:
|
|
37
37
|
- - ">="
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: '
|
|
39
|
+
version: '5.0'
|
|
40
40
|
- - "<"
|
|
41
41
|
- !ruby/object:Gem::Version
|
|
42
42
|
version: '7'
|
|
@@ -46,7 +46,7 @@ dependencies:
|
|
|
46
46
|
requirements:
|
|
47
47
|
- - ">="
|
|
48
48
|
- !ruby/object:Gem::Version
|
|
49
|
-
version: '
|
|
49
|
+
version: '5.0'
|
|
50
50
|
- - "<"
|
|
51
51
|
- !ruby/object:Gem::Version
|
|
52
52
|
version: '7'
|
|
@@ -78,19 +78,22 @@ dependencies:
|
|
|
78
78
|
- - "~>"
|
|
79
79
|
- !ruby/object:Gem::Version
|
|
80
80
|
version: '1.3'
|
|
81
|
-
description:
|
|
81
|
+
description:
|
|
82
82
|
email:
|
|
83
83
|
- hasghari@g2.com
|
|
84
84
|
executables: []
|
|
85
85
|
extensions: []
|
|
86
86
|
extra_rdoc_files: []
|
|
87
87
|
files:
|
|
88
|
-
- ".
|
|
88
|
+
- ".circleci/config.yml"
|
|
89
|
+
- ".github/config/rubocop_linter_action.yml"
|
|
90
|
+
- ".github/workflows/linters.yml"
|
|
89
91
|
- ".gitignore"
|
|
90
92
|
- ".rspec"
|
|
91
93
|
- ".rubocop.yml"
|
|
92
94
|
- ".ruby-version"
|
|
93
95
|
- ".tool-versions"
|
|
96
|
+
- Appraisals
|
|
94
97
|
- CODE_OF_CONDUCT.md
|
|
95
98
|
- Gemfile
|
|
96
99
|
- Gemfile.lock
|
|
@@ -100,6 +103,15 @@ files:
|
|
|
100
103
|
- bin/console
|
|
101
104
|
- bin/setup
|
|
102
105
|
- g2_command.gemspec
|
|
106
|
+
- gemfiles/.bundle/config
|
|
107
|
+
- gemfiles/rails_5.1.gemfile
|
|
108
|
+
- gemfiles/rails_5.1.gemfile.lock
|
|
109
|
+
- gemfiles/rails_5.2.gemfile
|
|
110
|
+
- gemfiles/rails_5.2.gemfile.lock
|
|
111
|
+
- gemfiles/rails_6.0.gemfile
|
|
112
|
+
- gemfiles/rails_6.0.gemfile.lock
|
|
113
|
+
- gemfiles/rails_6.1.gemfile
|
|
114
|
+
- gemfiles/rails_6.1.gemfile.lock
|
|
103
115
|
- lib/command.rb
|
|
104
116
|
- lib/command/failure.rb
|
|
105
117
|
- lib/command/input_middleware.rb
|
|
@@ -108,13 +120,14 @@ files:
|
|
|
108
120
|
- lib/command/interrupt.rb
|
|
109
121
|
- lib/command/version.rb
|
|
110
122
|
- lib/g2_command.rb
|
|
123
|
+
- lib/gem_ext/active_model/errors.rb
|
|
111
124
|
homepage: https://github.com/g2crowd/g2_command
|
|
112
125
|
licenses:
|
|
113
126
|
- MIT
|
|
114
127
|
metadata:
|
|
115
128
|
homepage_uri: https://github.com/g2crowd/g2_command
|
|
116
129
|
source_code_uri: https://github.com/g2crowd/g2_command
|
|
117
|
-
post_install_message:
|
|
130
|
+
post_install_message:
|
|
118
131
|
rdoc_options: []
|
|
119
132
|
require_paths:
|
|
120
133
|
- lib
|
|
@@ -122,15 +135,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
122
135
|
requirements:
|
|
123
136
|
- - ">="
|
|
124
137
|
- !ruby/object:Gem::Version
|
|
125
|
-
version: 2.
|
|
138
|
+
version: 2.4.0
|
|
126
139
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
140
|
requirements:
|
|
128
141
|
- - ">="
|
|
129
142
|
- !ruby/object:Gem::Version
|
|
130
143
|
version: '0'
|
|
131
144
|
requirements: []
|
|
132
|
-
rubygems_version: 3.
|
|
133
|
-
signing_key:
|
|
145
|
+
rubygems_version: 3.2.3
|
|
146
|
+
signing_key:
|
|
134
147
|
specification_version: 4
|
|
135
148
|
summary: An implementation of the command pattern using dry-rb
|
|
136
149
|
test_files: []
|
data/.github/workflows/ruby.yml
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
name: Ruby
|
|
2
|
-
|
|
3
|
-
on: [push]
|
|
4
|
-
|
|
5
|
-
jobs:
|
|
6
|
-
build:
|
|
7
|
-
|
|
8
|
-
runs-on: ubuntu-latest
|
|
9
|
-
|
|
10
|
-
steps:
|
|
11
|
-
- uses: actions/checkout@v2
|
|
12
|
-
- name: Set up Ruby
|
|
13
|
-
uses: ruby/setup-ruby@v1
|
|
14
|
-
with:
|
|
15
|
-
ruby-version: 2.6.6
|
|
16
|
-
- name: Configure Bundler
|
|
17
|
-
run: |
|
|
18
|
-
gem install bundler:2.1.4 --no-document
|
|
19
|
-
bundle install --jobs 4 --retry 3
|
|
20
|
-
- name: Run tests with RSpec
|
|
21
|
-
uses: paambaati/codeclimate-action@v2.5.4
|
|
22
|
-
env:
|
|
23
|
-
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
|
|
24
|
-
with:
|
|
25
|
-
coverageCommand: bundle exec rspec
|
|
26
|
-
debug: false
|