assistant 0.0.1 → 0.0.2
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 +45 -0
- data/.github/dependabot.yml +11 -0
- data/.gitignore +2 -0
- data/.rubocop.yml +59 -4
- data/.rubocop_todo.yml +0 -0
- data/.ruby-version +1 -1
- data/Gemfile.lock +77 -45
- data/Rakefile +5 -3
- data/assistant.gemspec +25 -24
- data/bin/console +3 -3
- data/bin/version +14 -9
- data/lib/assistant/log_item.rb +49 -0
- data/lib/assistant/log_list.rb +20 -0
- data/lib/assistant/service.rb +17 -1
- data/lib/assistant/version.rb +1 -1
- data/lib/assistant.rb +4 -1
- metadata +119 -31
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 57d148f4abcc7a6b10a3641ca2e75b0b4dfe0141a6536f062f1c8665f6bf5e2f
|
|
4
|
+
data.tar.gz: eed5fdf9f3e02724a342b109d8ef14e50b8b3fd359074ab5bb2475d1a08d88b0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a067fca9874e1eae78d65c49fe3b583e186a8a19e0c08c31128683a7e351758f4c839edf0a70cb0bb2feb01521b55bc4d74782e4bfaf51272d7736daad44b517
|
|
7
|
+
data.tar.gz: 721b623f02e50b972bc9eb58ee25640e3d5092195c57d4e5f0f0c79bcb093eee82d49d1d0ebc84c5493af1a04755df6996c212edc055b35c21b6e68c99ff73d6
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
version: 2.1 # Use 2.1 to enable using orbs and other features.
|
|
3
|
+
|
|
4
|
+
commands:
|
|
5
|
+
install_ruby_deps:
|
|
6
|
+
steps:
|
|
7
|
+
- checkout
|
|
8
|
+
- ruby/install-deps:
|
|
9
|
+
key: gems-v1
|
|
10
|
+
|
|
11
|
+
orbs:
|
|
12
|
+
ruby: circleci/ruby@2.0.0
|
|
13
|
+
executors:
|
|
14
|
+
ruby-executor:
|
|
15
|
+
working_directory: ~/assistant
|
|
16
|
+
docker:
|
|
17
|
+
- image: cimg/ruby:2.7.6
|
|
18
|
+
jobs:
|
|
19
|
+
build-ruby:
|
|
20
|
+
executor: ruby-executor
|
|
21
|
+
steps:
|
|
22
|
+
- install_ruby_deps
|
|
23
|
+
ruby-unit-test:
|
|
24
|
+
executor: ruby-executor
|
|
25
|
+
steps:
|
|
26
|
+
- install_ruby_deps
|
|
27
|
+
- run:
|
|
28
|
+
name: Run Unit Tests
|
|
29
|
+
command: bundle exec rspec
|
|
30
|
+
rubocop-check:
|
|
31
|
+
executor: ruby-executor
|
|
32
|
+
steps:
|
|
33
|
+
- install_ruby_deps
|
|
34
|
+
- ruby/rubocop-check
|
|
35
|
+
|
|
36
|
+
workflows:
|
|
37
|
+
build_check_and_test:
|
|
38
|
+
jobs:
|
|
39
|
+
- build-ruby
|
|
40
|
+
- ruby-unit-test:
|
|
41
|
+
requires:
|
|
42
|
+
- build-ruby
|
|
43
|
+
- rubocop-check:
|
|
44
|
+
requires:
|
|
45
|
+
- build-ruby
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# To get started with Dependabot version updates, you'll need to specify which
|
|
2
|
+
# package ecosystems to update and where the package manifests are located.
|
|
3
|
+
# Please see the documentation for all configuration options:
|
|
4
|
+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
|
5
|
+
|
|
6
|
+
version: 2
|
|
7
|
+
updates:
|
|
8
|
+
- package-ecosystem: "bundler" # See documentation for possible values
|
|
9
|
+
directory: "/" # Location of package manifests
|
|
10
|
+
schedule:
|
|
11
|
+
interval: "weekly"
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
# This is the configuration used to check the rubocop source code.
|
|
2
|
+
|
|
3
|
+
inherit_from: .rubocop_todo.yml
|
|
2
4
|
require:
|
|
3
5
|
- rubocop/cop/internal_affairs
|
|
4
6
|
- rubocop-performance
|
|
5
7
|
- rubocop-rspec
|
|
6
|
-
- rubocop-
|
|
8
|
+
- rubocop-rake
|
|
7
9
|
|
|
8
10
|
AllCops:
|
|
9
11
|
NewCops: enable
|
|
@@ -13,9 +15,12 @@ AllCops:
|
|
|
13
15
|
- 'tmp/**/*'
|
|
14
16
|
- '.git/**/*'
|
|
15
17
|
- 'bin/*'
|
|
16
|
-
TargetRubyVersion: 2.
|
|
18
|
+
TargetRubyVersion: 2.7
|
|
17
19
|
SuggestExtensions: false
|
|
18
20
|
|
|
21
|
+
Gemspec/DevelopmentDependencies:
|
|
22
|
+
EnforcedStyle: gemspec
|
|
23
|
+
|
|
19
24
|
Naming/PredicateName:
|
|
20
25
|
# Method define macros for dynamically generated method.
|
|
21
26
|
MethodDefinitionMacros:
|
|
@@ -38,7 +43,7 @@ Style/FormatStringToken:
|
|
|
38
43
|
Style/IpAddresses:
|
|
39
44
|
# The test for this cop includes strings that would cause offenses
|
|
40
45
|
Exclude:
|
|
41
|
-
|
|
46
|
+
- spec/rubocop/cop/style/ip_addresses_spec.rb
|
|
42
47
|
|
|
43
48
|
Layout/EndOfLine:
|
|
44
49
|
EnforcedStyle: lf
|
|
@@ -66,7 +71,7 @@ Layout/HashAlignment:
|
|
|
66
71
|
|
|
67
72
|
Layout/LineLength:
|
|
68
73
|
Max: 120
|
|
69
|
-
|
|
74
|
+
AllowedPatterns:
|
|
70
75
|
- !ruby/regexp /\A +(it|describe|context|shared_examples|include_examples|it_behaves_like) ["']/
|
|
71
76
|
|
|
72
77
|
Lint/InterpolationCheck:
|
|
@@ -78,6 +83,11 @@ Lint/UselessAccessModifier:
|
|
|
78
83
|
- 'def_matcher'
|
|
79
84
|
- 'def_node_matcher'
|
|
80
85
|
|
|
86
|
+
Lint/EmptyFile:
|
|
87
|
+
Exclude:
|
|
88
|
+
# This file is intentionally empty to catch rubocop cops failing on empty files.
|
|
89
|
+
- spec/rubocop/intentionally_empty_file.rb
|
|
90
|
+
|
|
81
91
|
Metrics/BlockLength:
|
|
82
92
|
Exclude:
|
|
83
93
|
- 'Rakefile'
|
|
@@ -88,18 +98,49 @@ Metrics/BlockLength:
|
|
|
88
98
|
Metrics/ClassLength:
|
|
89
99
|
Exclude:
|
|
90
100
|
- lib/rubocop/config_obsoletion.rb
|
|
101
|
+
- lib/rubocop/options.rb
|
|
91
102
|
|
|
92
103
|
Metrics/ModuleLength:
|
|
93
104
|
Exclude:
|
|
94
105
|
- 'spec/**/*.rb'
|
|
95
106
|
|
|
96
107
|
Naming/InclusiveLanguage:
|
|
108
|
+
Enabled: true
|
|
109
|
+
CheckStrings: true
|
|
97
110
|
FlaggedTerms:
|
|
111
|
+
' a offense':
|
|
112
|
+
Suggestions:
|
|
113
|
+
- an offense
|
|
114
|
+
auto-correct:
|
|
115
|
+
Suggestions:
|
|
116
|
+
- autocorrect
|
|
117
|
+
auto_correct:
|
|
118
|
+
Suggestions:
|
|
119
|
+
- autocorrect
|
|
120
|
+
behaviour:
|
|
121
|
+
Suggestions:
|
|
122
|
+
- behavior
|
|
98
123
|
offence:
|
|
99
124
|
Suggestions:
|
|
100
125
|
- offense
|
|
126
|
+
'does not registers':
|
|
127
|
+
Suggestions:
|
|
128
|
+
- does not register
|
|
101
129
|
Exclude:
|
|
102
130
|
- lib/rubocop/cop/naming/inclusive_language.rb
|
|
131
|
+
- lib/rubocop/cop/mixin/auto_corrector.rb
|
|
132
|
+
- spec/rubocop/cop/naming/inclusive_language_spec.rb
|
|
133
|
+
|
|
134
|
+
RSpec:
|
|
135
|
+
Language:
|
|
136
|
+
Expectations:
|
|
137
|
+
- expect_autocorrect_options_for_autocorrect
|
|
138
|
+
- expect_autocorrect_options_for_autocorrect_all
|
|
139
|
+
- expect_autocorrect_options_for_fix_layout
|
|
140
|
+
- expect_correction
|
|
141
|
+
- expect_feature_loader
|
|
142
|
+
- expect_no_offenses
|
|
143
|
+
- expect_offense
|
|
103
144
|
|
|
104
145
|
RSpec/FilePath:
|
|
105
146
|
Exclude:
|
|
@@ -136,6 +177,10 @@ InternalAffairs/ExampleDescription:
|
|
|
136
177
|
Include:
|
|
137
178
|
- 'spec/rubocop/cop/**/*.rb'
|
|
138
179
|
|
|
180
|
+
InternalAffairs/ExampleHeredocDelimiter:
|
|
181
|
+
Include:
|
|
182
|
+
- 'spec/rubocop/cop/**/*.rb'
|
|
183
|
+
|
|
139
184
|
InternalAffairs/UndefinedConfig:
|
|
140
185
|
Include:
|
|
141
186
|
- 'lib/rubocop/cop/**/*.rb'
|
|
@@ -146,3 +191,13 @@ InternalAffairs/UndefinedConfig:
|
|
|
146
191
|
InternalAffairs/StyleDetectedApiUse:
|
|
147
192
|
Exclude:
|
|
148
193
|
- 'lib/rubocop/cop/mixin/percent_array.rb'
|
|
194
|
+
|
|
195
|
+
InternalAffairs/NumblockHandler:
|
|
196
|
+
Exclude:
|
|
197
|
+
- 'lib/rubocop/cop/internal_affairs/*.rb'
|
|
198
|
+
|
|
199
|
+
Gemspec/DependencyVersion:
|
|
200
|
+
Enabled: true
|
|
201
|
+
|
|
202
|
+
Style/RequireOrder:
|
|
203
|
+
Enabled: true
|
data/.rubocop_todo.yml
ADDED
|
File without changes
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.
|
|
1
|
+
2.7.6
|
data/Gemfile.lock
CHANGED
|
@@ -1,83 +1,115 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
assistant (0.0.
|
|
4
|
+
assistant (0.0.2)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
8
8
|
specs:
|
|
9
|
+
activesupport (7.0.4.3)
|
|
10
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
11
|
+
i18n (>= 1.6, < 2)
|
|
12
|
+
minitest (>= 5.1)
|
|
13
|
+
tzinfo (~> 2.0)
|
|
9
14
|
ast (2.4.2)
|
|
10
|
-
brakeman (5.
|
|
15
|
+
brakeman (5.4.0)
|
|
16
|
+
byebug (11.1.3)
|
|
11
17
|
colorize (0.8.1)
|
|
12
|
-
concurrent-ruby (1.
|
|
18
|
+
concurrent-ruby (1.2.2)
|
|
13
19
|
diff-lcs (1.5.0)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
20
|
+
factory_bot (6.2.1)
|
|
21
|
+
activesupport (>= 5.0.0)
|
|
22
|
+
faker (2.22.0)
|
|
23
|
+
i18n (>= 1.8.11, < 2)
|
|
24
|
+
fasterer (0.10.1)
|
|
17
25
|
colorize (~> 0.7)
|
|
18
|
-
ruby_parser (>= 3.
|
|
19
|
-
i18n (1.
|
|
26
|
+
ruby_parser (>= 3.19.1)
|
|
27
|
+
i18n (1.13.0)
|
|
20
28
|
concurrent-ruby (~> 1.0)
|
|
21
|
-
|
|
22
|
-
|
|
29
|
+
json (2.6.3)
|
|
30
|
+
minitest (5.18.0)
|
|
31
|
+
parallel (1.23.0)
|
|
32
|
+
parser (3.2.2.1)
|
|
23
33
|
ast (~> 2.4.1)
|
|
24
34
|
rainbow (3.1.1)
|
|
25
35
|
rake (13.0.6)
|
|
26
|
-
regexp_parser (2.
|
|
36
|
+
regexp_parser (2.8.0)
|
|
27
37
|
rexml (3.2.5)
|
|
28
|
-
rspec (3.
|
|
29
|
-
rspec-core (~> 3.
|
|
30
|
-
rspec-expectations (~> 3.
|
|
31
|
-
rspec-mocks (~> 3.
|
|
32
|
-
rspec-
|
|
33
|
-
rspec-
|
|
34
|
-
rspec-
|
|
38
|
+
rspec (3.12.0)
|
|
39
|
+
rspec-core (~> 3.12.0)
|
|
40
|
+
rspec-expectations (~> 3.12.0)
|
|
41
|
+
rspec-mocks (~> 3.12.0)
|
|
42
|
+
rspec-collection_matchers (1.2.0)
|
|
43
|
+
rspec-expectations (>= 2.99.0.beta1)
|
|
44
|
+
rspec-core (3.12.0)
|
|
45
|
+
rspec-support (~> 3.12.0)
|
|
46
|
+
rspec-expectations (3.12.1)
|
|
35
47
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
36
|
-
rspec-support (~> 3.
|
|
37
|
-
rspec-mocks (3.
|
|
48
|
+
rspec-support (~> 3.12.0)
|
|
49
|
+
rspec-mocks (3.12.1)
|
|
38
50
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
39
|
-
rspec-support (~> 3.
|
|
40
|
-
rspec-support (3.
|
|
41
|
-
|
|
51
|
+
rspec-support (~> 3.12.0)
|
|
52
|
+
rspec-support (3.12.0)
|
|
53
|
+
rspec_junit_formatter (0.6.0)
|
|
54
|
+
rspec-core (>= 2, < 4, != 2.12.0)
|
|
55
|
+
rubocop (1.51.0)
|
|
56
|
+
json (~> 2.3)
|
|
42
57
|
parallel (~> 1.10)
|
|
43
|
-
parser (>= 3.
|
|
58
|
+
parser (>= 3.2.0.0)
|
|
44
59
|
rainbow (>= 2.2.2, < 4.0)
|
|
45
60
|
regexp_parser (>= 1.8, < 3.0)
|
|
46
|
-
rexml
|
|
47
|
-
rubocop-ast (>= 1.
|
|
61
|
+
rexml (>= 3.2.5, < 4.0)
|
|
62
|
+
rubocop-ast (>= 1.28.0, < 2.0)
|
|
48
63
|
ruby-progressbar (~> 1.7)
|
|
49
|
-
unicode-display_width (>=
|
|
50
|
-
rubocop-ast (1.
|
|
51
|
-
parser (>= 3.
|
|
64
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
|
65
|
+
rubocop-ast (1.28.1)
|
|
66
|
+
parser (>= 3.2.1.0)
|
|
67
|
+
rubocop-capybara (2.18.0)
|
|
68
|
+
rubocop (~> 1.41)
|
|
69
|
+
rubocop-factory_bot (2.22.0)
|
|
70
|
+
rubocop (~> 1.33)
|
|
52
71
|
rubocop-faker (1.1.0)
|
|
53
72
|
faker (>= 2.12.0)
|
|
54
73
|
rubocop (>= 0.82.0)
|
|
55
|
-
rubocop-performance (1.
|
|
74
|
+
rubocop-performance (1.17.1)
|
|
56
75
|
rubocop (>= 1.7.0, < 2.0)
|
|
57
76
|
rubocop-ast (>= 0.4.0)
|
|
58
|
-
rubocop-
|
|
59
|
-
rubocop (~> 1.
|
|
60
|
-
|
|
61
|
-
|
|
77
|
+
rubocop-rake (0.6.0)
|
|
78
|
+
rubocop (~> 1.0)
|
|
79
|
+
rubocop-rspec (2.22.0)
|
|
80
|
+
rubocop (~> 1.33)
|
|
81
|
+
rubocop-capybara (~> 2.17)
|
|
82
|
+
rubocop-factory_bot (~> 2.22)
|
|
83
|
+
ruby-progressbar (1.13.0)
|
|
84
|
+
ruby_parser (3.20.0)
|
|
62
85
|
sexp_processor (~> 4.16)
|
|
63
|
-
sexp_processor (4.
|
|
64
|
-
|
|
86
|
+
sexp_processor (4.17.0)
|
|
87
|
+
tzinfo (2.0.6)
|
|
88
|
+
concurrent-ruby (~> 1.0)
|
|
89
|
+
unicode-display_width (2.4.2)
|
|
65
90
|
|
|
66
91
|
PLATFORMS
|
|
67
|
-
|
|
92
|
+
arm64-darwin-22
|
|
93
|
+
x86_64-darwin-21
|
|
94
|
+
x86_64-linux
|
|
68
95
|
|
|
69
96
|
DEPENDENCIES
|
|
70
97
|
assistant!
|
|
71
|
-
brakeman (~> 5.2)
|
|
72
|
-
bundler (~> 2.3, >= 2.3.
|
|
98
|
+
brakeman (~> 5.2, >= 5.2.3)
|
|
99
|
+
bundler (~> 2.3, >= 2.3.19)
|
|
100
|
+
byebug (~> 11.1, >= 11.1.3)
|
|
73
101
|
colorize (~> 0.8.1)
|
|
74
|
-
|
|
102
|
+
factory_bot (~> 6.2, >= 6.2.1)
|
|
103
|
+
fasterer (~> 0.10.1)
|
|
75
104
|
rake (~> 13.0, >= 13.0.6)
|
|
76
|
-
rspec (~> 3.
|
|
77
|
-
|
|
105
|
+
rspec (~> 3.12)
|
|
106
|
+
rspec-collection_matchers (~> 1.2)
|
|
107
|
+
rspec_junit_formatter (~> 0.6.0)
|
|
108
|
+
rubocop (~> 1.51)
|
|
78
109
|
rubocop-faker (~> 1.1)
|
|
79
|
-
rubocop-performance (~> 1.
|
|
80
|
-
rubocop-
|
|
110
|
+
rubocop-performance (~> 1.17, >= 1.17.1)
|
|
111
|
+
rubocop-rake (~> 0.6.0)
|
|
112
|
+
rubocop-rspec (~> 2.22)
|
|
81
113
|
|
|
82
114
|
BUNDLED WITH
|
|
83
|
-
2.3.
|
|
115
|
+
2.3.19
|
data/Rakefile
CHANGED
data/assistant.gemspec
CHANGED
|
@@ -6,45 +6,46 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
|
6
6
|
require 'assistant/version'
|
|
7
7
|
|
|
8
8
|
Gem::Specification.new do |spec|
|
|
9
|
+
raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.' unless spec.respond_to?(:metadata)
|
|
10
|
+
|
|
9
11
|
spec.name = 'assistant'
|
|
10
12
|
spec.version = Assistant::VERSION
|
|
11
13
|
spec.authors = ['Ramon Rodrigues']
|
|
12
14
|
spec.email = ['cerberus.ramon@gmail.com']
|
|
13
15
|
|
|
14
|
-
spec.summary = 'Simple, composable services'
|
|
16
|
+
spec.summary = 'Simple, soft fail enabled, composable services'
|
|
15
17
|
spec.description = 'Simple, composable services'
|
|
16
18
|
spec.homepage = 'https://github.com/ramongr/assistant'
|
|
17
19
|
spec.license = 'MIT'
|
|
18
|
-
spec.required_ruby_version = '>= 2.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
spec.metadata['homepage_uri'] = spec.homepage
|
|
26
|
-
spec.metadata['source_code_uri'] = 'https://github.com/ramongr/assistant'
|
|
27
|
-
else
|
|
28
|
-
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
|
29
|
-
'public gem pushes.'
|
|
30
|
-
end
|
|
20
|
+
spec.required_ruby_version = '>= 2.7.6'
|
|
21
|
+
|
|
22
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
|
23
|
+
spec.metadata['changelog_uri'] = 'https://github.com/ramongr/assistant/blob/main/CODE_OF_CONDUCT.md'
|
|
24
|
+
spec.metadata['homepage_uri'] = 'https://github.com/ramongr/assistant'
|
|
25
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
|
26
|
+
spec.metadata['source_code_uri'] = 'https://github.com/ramongr/assistant'
|
|
31
27
|
|
|
32
28
|
# Specify which files should be added to the gem when it is released.
|
|
33
29
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
34
30
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
|
35
31
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
36
32
|
end
|
|
37
|
-
|
|
38
|
-
spec.
|
|
39
|
-
|
|
40
|
-
spec.add_development_dependency 'brakeman', '~> 5.2'
|
|
33
|
+
|
|
34
|
+
spec.require_paths = 'lib'
|
|
35
|
+
|
|
36
|
+
spec.add_development_dependency 'brakeman', '~> 5.2', '>= 5.2.3'
|
|
37
|
+
spec.add_development_dependency 'bundler', '~> 2.3', '>= 2.3.19'
|
|
38
|
+
spec.add_development_dependency 'byebug', '~> 11.1', '>= 11.1.3'
|
|
41
39
|
spec.add_development_dependency 'colorize', '~> 0.8.1'
|
|
42
|
-
spec.add_development_dependency '
|
|
43
|
-
spec.add_development_dependency 'fasterer', '~> 0.
|
|
40
|
+
spec.add_development_dependency 'factory_bot', '~> 6.2', '>= 6.2.1'
|
|
41
|
+
spec.add_development_dependency 'fasterer', '~> 0.10.1'
|
|
44
42
|
spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6'
|
|
45
|
-
spec.add_development_dependency 'rspec', '~> 3.
|
|
46
|
-
spec.add_development_dependency '
|
|
43
|
+
spec.add_development_dependency 'rspec', '~> 3.12'
|
|
44
|
+
spec.add_development_dependency 'rspec-collection_matchers', '~> 1.2'
|
|
45
|
+
spec.add_development_dependency 'rspec_junit_formatter', '~> 0.6.0'
|
|
46
|
+
spec.add_development_dependency 'rubocop', '~> 1.51'
|
|
47
47
|
spec.add_development_dependency 'rubocop-faker', '~> 1.1'
|
|
48
|
-
spec.add_development_dependency 'rubocop-performance', '~> 1.
|
|
49
|
-
spec.add_development_dependency 'rubocop-
|
|
48
|
+
spec.add_development_dependency 'rubocop-performance', '~> 1.17', '>= 1.17.1'
|
|
49
|
+
spec.add_development_dependency 'rubocop-rake', '~> 0.6.0'
|
|
50
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 2.22'
|
|
50
51
|
end
|
data/bin/console
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
|
-
require
|
|
4
|
-
require
|
|
3
|
+
require 'bundler/setup'
|
|
4
|
+
require 'assistant'
|
|
5
5
|
|
|
6
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
|
@@ -10,5 +10,5 @@ require "assistant"
|
|
|
10
10
|
# require "pry"
|
|
11
11
|
# Pry.start
|
|
12
12
|
|
|
13
|
-
require
|
|
13
|
+
require 'irb'
|
|
14
14
|
IRB.start(__FILE__)
|
data/bin/version
CHANGED
|
@@ -8,16 +8,12 @@ def process_command(argument)
|
|
|
8
8
|
original_version = version_arr.join('.')
|
|
9
9
|
case argument
|
|
10
10
|
when '-h', '--help'
|
|
11
|
-
puts
|
|
12
|
-
|
|
13
|
-
puts '--bump-minor-version --minor Bumps the minor version and sets the patch version to 0'
|
|
14
|
-
puts '--bump-major-version --version Bumps the major version sets all other values to 0'
|
|
15
|
-
return
|
|
16
|
-
when '--bump-patch-version', '--patch'
|
|
11
|
+
return puts help_message
|
|
12
|
+
when '--patch-version', '--patch'
|
|
17
13
|
bumped_version = [version_arr[0], version_arr[1], version_arr[2] + 1].join('.')
|
|
18
|
-
when '--
|
|
14
|
+
when '--minor-version', '--minor'
|
|
19
15
|
bumped_version = [version_arr[0], version_arr[1] + 1, 0].join('.')
|
|
20
|
-
when '--
|
|
16
|
+
when '--major-version', '--version'
|
|
21
17
|
bumped_version = [version_arr[0] + 1, 0, 0].join('.')
|
|
22
18
|
else
|
|
23
19
|
return puts "Invalid command #{argument}, use --help to see all available commands".colorize(:red)
|
|
@@ -27,6 +23,15 @@ def process_command(argument)
|
|
|
27
23
|
write_file(bumped_version_file)
|
|
28
24
|
end
|
|
29
25
|
|
|
26
|
+
private
|
|
27
|
+
|
|
28
|
+
def help_message
|
|
29
|
+
puts "\t\t\t\t\tVERSION BUMP OPTIONS\t\t\t\t\t"
|
|
30
|
+
puts "--patch-version --patch\t\tBumps the patch version\t\t\t\t\t"
|
|
31
|
+
puts "--minor-version --minor\t\tBumps the minor version and sets the patch version to 0 "
|
|
32
|
+
puts "--major-version --version\t\tBumps the major version sets all other values to 0\t"
|
|
33
|
+
end
|
|
34
|
+
|
|
30
35
|
def write_file(text)
|
|
31
36
|
File.write(VERSION_FILE, text)
|
|
32
37
|
end
|
|
@@ -45,4 +50,4 @@ end
|
|
|
45
50
|
|
|
46
51
|
ARGV.each do |argument|
|
|
47
52
|
process_command(argument)
|
|
48
|
-
end
|
|
53
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Assistant
|
|
4
|
+
# Log base class
|
|
5
|
+
class LogItem
|
|
6
|
+
VALID_LEVELS = %i[info warning error].freeze
|
|
7
|
+
|
|
8
|
+
attr_reader :level, :source, :detail, :message, :trace
|
|
9
|
+
|
|
10
|
+
def initialize(level:, source:, detail:, message:, trace: nil)
|
|
11
|
+
@level = level.to_sym
|
|
12
|
+
@source = source.to_sym
|
|
13
|
+
@detail = detail.to_sym
|
|
14
|
+
@message = message.to_s
|
|
15
|
+
@trace = trace
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def valid?
|
|
19
|
+
[valid_level?, valid_source?, valid_detail?, valid_message?].all?
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def item
|
|
23
|
+
{ level: level, source: source, detail: detail, message: message, trace: trace }
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
VALID_LEVELS.each do |valid_level|
|
|
27
|
+
# info? warning? error?
|
|
28
|
+
define_method("#{valid_level}?") do
|
|
29
|
+
level == valid_level
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def valid_level?
|
|
34
|
+
VALID_LEVELS.include?(level)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def valid_source?
|
|
38
|
+
source.size.positive? && detail != source
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def valid_detail?
|
|
42
|
+
detail.size.positive? && source != detail
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def valid_message?
|
|
46
|
+
message.size.positive?
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Assistant
|
|
4
|
+
# Service level list of logs
|
|
5
|
+
module LogList
|
|
6
|
+
def add_log(level:, source:, detail:, message:, trace: nil)
|
|
7
|
+
@logs << Assistant::LogItem.new(level: level, source: source, detail: detail, message: message, trace: trace)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def merge_logs(other_logs)
|
|
11
|
+
@logs.concat(other_logs)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
::Assistant::LogItem::VALID_LEVELS.each do |level|
|
|
15
|
+
define_method("#{level}s") do
|
|
16
|
+
@logs.select { |log| log.send("#{level}?") }
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
data/lib/assistant/service.rb
CHANGED
|
@@ -3,16 +3,32 @@
|
|
|
3
3
|
module Assistant
|
|
4
4
|
# Base class for the Assistant gem
|
|
5
5
|
class Service
|
|
6
|
+
include ::Assistant::LogList
|
|
7
|
+
|
|
8
|
+
class << self
|
|
9
|
+
def run(*args)
|
|
10
|
+
new(*args).run
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
6
14
|
def initialize(*args)
|
|
7
15
|
@inputs = args
|
|
16
|
+
@logs = []
|
|
8
17
|
end
|
|
9
18
|
|
|
10
19
|
def run
|
|
11
|
-
|
|
20
|
+
validate
|
|
21
|
+
{ result: execute, status: status, warnings: warnings } if errors.empty?
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def status
|
|
25
|
+
warnings.empty? ? :ok : :with_warnings
|
|
12
26
|
end
|
|
13
27
|
|
|
14
28
|
protected
|
|
15
29
|
|
|
16
30
|
def execute; end
|
|
31
|
+
|
|
32
|
+
def validate; end
|
|
17
33
|
end
|
|
18
34
|
end
|
data/lib/assistant/version.rb
CHANGED
data/lib/assistant.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: assistant
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ramon Rodrigues
|
|
8
|
-
autorequire:
|
|
9
|
-
bindir:
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2023-05-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: brakeman
|
|
@@ -17,6 +17,9 @@ dependencies:
|
|
|
17
17
|
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
19
|
version: '5.2'
|
|
20
|
+
- - ">="
|
|
21
|
+
- !ruby/object:Gem::Version
|
|
22
|
+
version: 5.2.3
|
|
20
23
|
type: :development
|
|
21
24
|
prerelease: false
|
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -24,6 +27,49 @@ dependencies:
|
|
|
24
27
|
- - "~>"
|
|
25
28
|
- !ruby/object:Gem::Version
|
|
26
29
|
version: '5.2'
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: 5.2.3
|
|
33
|
+
- !ruby/object:Gem::Dependency
|
|
34
|
+
name: bundler
|
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - "~>"
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '2.3'
|
|
40
|
+
- - ">="
|
|
41
|
+
- !ruby/object:Gem::Version
|
|
42
|
+
version: 2.3.19
|
|
43
|
+
type: :development
|
|
44
|
+
prerelease: false
|
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
46
|
+
requirements:
|
|
47
|
+
- - "~>"
|
|
48
|
+
- !ruby/object:Gem::Version
|
|
49
|
+
version: '2.3'
|
|
50
|
+
- - ">="
|
|
51
|
+
- !ruby/object:Gem::Version
|
|
52
|
+
version: 2.3.19
|
|
53
|
+
- !ruby/object:Gem::Dependency
|
|
54
|
+
name: byebug
|
|
55
|
+
requirement: !ruby/object:Gem::Requirement
|
|
56
|
+
requirements:
|
|
57
|
+
- - "~>"
|
|
58
|
+
- !ruby/object:Gem::Version
|
|
59
|
+
version: '11.1'
|
|
60
|
+
- - ">="
|
|
61
|
+
- !ruby/object:Gem::Version
|
|
62
|
+
version: 11.1.3
|
|
63
|
+
type: :development
|
|
64
|
+
prerelease: false
|
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
66
|
+
requirements:
|
|
67
|
+
- - "~>"
|
|
68
|
+
- !ruby/object:Gem::Version
|
|
69
|
+
version: '11.1'
|
|
70
|
+
- - ">="
|
|
71
|
+
- !ruby/object:Gem::Version
|
|
72
|
+
version: 11.1.3
|
|
27
73
|
- !ruby/object:Gem::Dependency
|
|
28
74
|
name: colorize
|
|
29
75
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -39,39 +85,39 @@ dependencies:
|
|
|
39
85
|
- !ruby/object:Gem::Version
|
|
40
86
|
version: 0.8.1
|
|
41
87
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
88
|
+
name: factory_bot
|
|
43
89
|
requirement: !ruby/object:Gem::Requirement
|
|
44
90
|
requirements:
|
|
45
91
|
- - "~>"
|
|
46
92
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '2
|
|
93
|
+
version: '6.2'
|
|
48
94
|
- - ">="
|
|
49
95
|
- !ruby/object:Gem::Version
|
|
50
|
-
version: 2.
|
|
96
|
+
version: 6.2.1
|
|
51
97
|
type: :development
|
|
52
98
|
prerelease: false
|
|
53
99
|
version_requirements: !ruby/object:Gem::Requirement
|
|
54
100
|
requirements:
|
|
55
101
|
- - "~>"
|
|
56
102
|
- !ruby/object:Gem::Version
|
|
57
|
-
version: '2
|
|
103
|
+
version: '6.2'
|
|
58
104
|
- - ">="
|
|
59
105
|
- !ruby/object:Gem::Version
|
|
60
|
-
version: 2.
|
|
106
|
+
version: 6.2.1
|
|
61
107
|
- !ruby/object:Gem::Dependency
|
|
62
108
|
name: fasterer
|
|
63
109
|
requirement: !ruby/object:Gem::Requirement
|
|
64
110
|
requirements:
|
|
65
111
|
- - "~>"
|
|
66
112
|
- !ruby/object:Gem::Version
|
|
67
|
-
version: 0.
|
|
113
|
+
version: 0.10.1
|
|
68
114
|
type: :development
|
|
69
115
|
prerelease: false
|
|
70
116
|
version_requirements: !ruby/object:Gem::Requirement
|
|
71
117
|
requirements:
|
|
72
118
|
- - "~>"
|
|
73
119
|
- !ruby/object:Gem::Version
|
|
74
|
-
version: 0.
|
|
120
|
+
version: 0.10.1
|
|
75
121
|
- !ruby/object:Gem::Dependency
|
|
76
122
|
name: rake
|
|
77
123
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -98,34 +144,56 @@ dependencies:
|
|
|
98
144
|
requirements:
|
|
99
145
|
- - "~>"
|
|
100
146
|
- !ruby/object:Gem::Version
|
|
101
|
-
version: '3.
|
|
147
|
+
version: '3.12'
|
|
102
148
|
type: :development
|
|
103
149
|
prerelease: false
|
|
104
150
|
version_requirements: !ruby/object:Gem::Requirement
|
|
105
151
|
requirements:
|
|
106
152
|
- - "~>"
|
|
107
153
|
- !ruby/object:Gem::Version
|
|
108
|
-
version: '3.
|
|
154
|
+
version: '3.12'
|
|
109
155
|
- !ruby/object:Gem::Dependency
|
|
110
|
-
name:
|
|
156
|
+
name: rspec-collection_matchers
|
|
111
157
|
requirement: !ruby/object:Gem::Requirement
|
|
112
158
|
requirements:
|
|
113
159
|
- - "~>"
|
|
114
160
|
- !ruby/object:Gem::Version
|
|
115
|
-
version: '1.
|
|
116
|
-
|
|
161
|
+
version: '1.2'
|
|
162
|
+
type: :development
|
|
163
|
+
prerelease: false
|
|
164
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
165
|
+
requirements:
|
|
166
|
+
- - "~>"
|
|
117
167
|
- !ruby/object:Gem::Version
|
|
118
|
-
version: 1.
|
|
168
|
+
version: '1.2'
|
|
169
|
+
- !ruby/object:Gem::Dependency
|
|
170
|
+
name: rspec_junit_formatter
|
|
171
|
+
requirement: !ruby/object:Gem::Requirement
|
|
172
|
+
requirements:
|
|
173
|
+
- - "~>"
|
|
174
|
+
- !ruby/object:Gem::Version
|
|
175
|
+
version: 0.6.0
|
|
119
176
|
type: :development
|
|
120
177
|
prerelease: false
|
|
121
178
|
version_requirements: !ruby/object:Gem::Requirement
|
|
122
179
|
requirements:
|
|
123
180
|
- - "~>"
|
|
124
181
|
- !ruby/object:Gem::Version
|
|
125
|
-
version:
|
|
126
|
-
|
|
182
|
+
version: 0.6.0
|
|
183
|
+
- !ruby/object:Gem::Dependency
|
|
184
|
+
name: rubocop
|
|
185
|
+
requirement: !ruby/object:Gem::Requirement
|
|
186
|
+
requirements:
|
|
187
|
+
- - "~>"
|
|
127
188
|
- !ruby/object:Gem::Version
|
|
128
|
-
version: 1.
|
|
189
|
+
version: '1.51'
|
|
190
|
+
type: :development
|
|
191
|
+
prerelease: false
|
|
192
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
193
|
+
requirements:
|
|
194
|
+
- - "~>"
|
|
195
|
+
- !ruby/object:Gem::Version
|
|
196
|
+
version: '1.51'
|
|
129
197
|
- !ruby/object:Gem::Dependency
|
|
130
198
|
name: rubocop-faker
|
|
131
199
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -146,34 +214,48 @@ dependencies:
|
|
|
146
214
|
requirements:
|
|
147
215
|
- - "~>"
|
|
148
216
|
- !ruby/object:Gem::Version
|
|
149
|
-
version: '1.
|
|
217
|
+
version: '1.17'
|
|
150
218
|
- - ">="
|
|
151
219
|
- !ruby/object:Gem::Version
|
|
152
|
-
version: 1.
|
|
220
|
+
version: 1.17.1
|
|
153
221
|
type: :development
|
|
154
222
|
prerelease: false
|
|
155
223
|
version_requirements: !ruby/object:Gem::Requirement
|
|
156
224
|
requirements:
|
|
157
225
|
- - "~>"
|
|
158
226
|
- !ruby/object:Gem::Version
|
|
159
|
-
version: '1.
|
|
227
|
+
version: '1.17'
|
|
160
228
|
- - ">="
|
|
161
229
|
- !ruby/object:Gem::Version
|
|
162
|
-
version: 1.
|
|
230
|
+
version: 1.17.1
|
|
231
|
+
- !ruby/object:Gem::Dependency
|
|
232
|
+
name: rubocop-rake
|
|
233
|
+
requirement: !ruby/object:Gem::Requirement
|
|
234
|
+
requirements:
|
|
235
|
+
- - "~>"
|
|
236
|
+
- !ruby/object:Gem::Version
|
|
237
|
+
version: 0.6.0
|
|
238
|
+
type: :development
|
|
239
|
+
prerelease: false
|
|
240
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
241
|
+
requirements:
|
|
242
|
+
- - "~>"
|
|
243
|
+
- !ruby/object:Gem::Version
|
|
244
|
+
version: 0.6.0
|
|
163
245
|
- !ruby/object:Gem::Dependency
|
|
164
246
|
name: rubocop-rspec
|
|
165
247
|
requirement: !ruby/object:Gem::Requirement
|
|
166
248
|
requirements:
|
|
167
249
|
- - "~>"
|
|
168
250
|
- !ruby/object:Gem::Version
|
|
169
|
-
version: '2.
|
|
251
|
+
version: '2.22'
|
|
170
252
|
type: :development
|
|
171
253
|
prerelease: false
|
|
172
254
|
version_requirements: !ruby/object:Gem::Requirement
|
|
173
255
|
requirements:
|
|
174
256
|
- - "~>"
|
|
175
257
|
- !ruby/object:Gem::Version
|
|
176
|
-
version: '2.
|
|
258
|
+
version: '2.22'
|
|
177
259
|
description: Simple, composable services
|
|
178
260
|
email:
|
|
179
261
|
- cerberus.ramon@gmail.com
|
|
@@ -181,10 +263,13 @@ executables: []
|
|
|
181
263
|
extensions: []
|
|
182
264
|
extra_rdoc_files: []
|
|
183
265
|
files:
|
|
266
|
+
- ".circleci/config.yml"
|
|
184
267
|
- ".fasterer.yml"
|
|
268
|
+
- ".github/dependabot.yml"
|
|
185
269
|
- ".gitignore"
|
|
186
270
|
- ".rspec"
|
|
187
271
|
- ".rubocop.yml"
|
|
272
|
+
- ".rubocop_todo.yml"
|
|
188
273
|
- ".ruby-version"
|
|
189
274
|
- CODE_OF_CONDUCT.md
|
|
190
275
|
- Gemfile
|
|
@@ -197,6 +282,8 @@ files:
|
|
|
197
282
|
- bin/setup
|
|
198
283
|
- bin/version
|
|
199
284
|
- lib/assistant.rb
|
|
285
|
+
- lib/assistant/log_item.rb
|
|
286
|
+
- lib/assistant/log_list.rb
|
|
200
287
|
- lib/assistant/service.rb
|
|
201
288
|
- lib/assistant/version.rb
|
|
202
289
|
homepage: https://github.com/ramongr/assistant
|
|
@@ -206,8 +293,9 @@ metadata:
|
|
|
206
293
|
allowed_push_host: https://rubygems.org
|
|
207
294
|
changelog_uri: https://github.com/ramongr/assistant/blob/main/CODE_OF_CONDUCT.md
|
|
208
295
|
homepage_uri: https://github.com/ramongr/assistant
|
|
296
|
+
rubygems_mfa_required: 'true'
|
|
209
297
|
source_code_uri: https://github.com/ramongr/assistant
|
|
210
|
-
post_install_message:
|
|
298
|
+
post_install_message:
|
|
211
299
|
rdoc_options: []
|
|
212
300
|
require_paths:
|
|
213
301
|
- lib
|
|
@@ -215,15 +303,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
215
303
|
requirements:
|
|
216
304
|
- - ">="
|
|
217
305
|
- !ruby/object:Gem::Version
|
|
218
|
-
version: 2.
|
|
306
|
+
version: 2.7.6
|
|
219
307
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
220
308
|
requirements:
|
|
221
309
|
- - ">="
|
|
222
310
|
- !ruby/object:Gem::Version
|
|
223
311
|
version: '0'
|
|
224
312
|
requirements: []
|
|
225
|
-
rubygems_version: 3.
|
|
226
|
-
signing_key:
|
|
313
|
+
rubygems_version: 3.1.6
|
|
314
|
+
signing_key:
|
|
227
315
|
specification_version: 4
|
|
228
|
-
summary: Simple, composable services
|
|
316
|
+
summary: Simple, soft fail enabled, composable services
|
|
229
317
|
test_files: []
|