auxiliary_rails 0.1.6 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.gitlab-ci.yml +26 -0
  3. data/.rubocop.yml +27 -2
  4. data/.rubocop_todo.yml +5 -15
  5. data/.yardopts +5 -0
  6. data/CHANGELOG.md +39 -3
  7. data/CONTRIBUTING.md +0 -6
  8. data/Gemfile.lock +116 -92
  9. data/README.md +213 -6
  10. data/auxiliary_rails.gemspec +13 -12
  11. data/bin/rubocop +29 -0
  12. data/bitbucket-pipelines.yml +35 -0
  13. data/lib/auxiliary_rails.rb +5 -3
  14. data/lib/auxiliary_rails/application/command.rb +56 -0
  15. data/lib/auxiliary_rails/application/error.rb +10 -0
  16. data/lib/auxiliary_rails/application/form.rb +30 -0
  17. data/lib/auxiliary_rails/application/query.rb +71 -0
  18. data/lib/auxiliary_rails/cli.rb +18 -5
  19. data/lib/auxiliary_rails/concerns/errorable.rb +22 -0
  20. data/lib/auxiliary_rails/concerns/performable.rb +128 -0
  21. data/lib/auxiliary_rails/version.rb +1 -1
  22. data/lib/generators/auxiliary_rails/api_resource_generator.rb +10 -1
  23. data/lib/generators/auxiliary_rails/command_generator.rb +44 -0
  24. data/lib/generators/auxiliary_rails/install_commands_generator.rb +6 -1
  25. data/lib/generators/auxiliary_rails/install_generator.rb +0 -1
  26. data/lib/generators/auxiliary_rails/templates/apis/api_entity_template.rb.erb +2 -1
  27. data/lib/generators/auxiliary_rails/templates/apis/api_resource_spec_template.rb.erb +36 -9
  28. data/lib/generators/auxiliary_rails/templates/apis/api_resource_template.rb.erb +12 -6
  29. data/lib/generators/auxiliary_rails/templates/application_error_template.rb +1 -1
  30. data/lib/generators/auxiliary_rails/templates/commands/application_command_template.rb +2 -0
  31. data/lib/generators/auxiliary_rails/templates/commands/command_spec_template.rb +11 -0
  32. data/lib/generators/auxiliary_rails/templates/commands/command_template.rb +6 -0
  33. data/lib/generators/auxiliary_rails/templates/commands/commands.en_template.yml +5 -0
  34. data/templates/rails/elementary.rb +40 -10
  35. metadata +81 -24
  36. data/lib/auxiliary_rails/abstract_command.rb +0 -96
  37. data/lib/auxiliary_rails/abstract_error.rb +0 -7
  38. data/lib/generators/auxiliary_rails/install_rubocop_generator.rb +0 -29
  39. data/lib/generators/auxiliary_rails/templates/application_command_template.rb +0 -2
  40. data/lib/generators/auxiliary_rails/templates/rubocop/rubocop_auxiliary_rails_template.yml +0 -51
  41. data/lib/generators/auxiliary_rails/templates/rubocop/rubocop_template.yml +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10bf9425fca5d5db8bc1165679479bb68235fca8d5b98e044c8fce1b9046d719
4
- data.tar.gz: 1d5dae27ee43d35db611fca2fdda64a10f55d0d3b0570c341c33ed5a86237d9e
3
+ metadata.gz: 96acec32159316a20cb54c5f2e456fb7c87b6e1f058f6944df4fb1bdeeca2517
4
+ data.tar.gz: 3ca5ea02af552fb200555f1ab40160b86394b255ecbe2550aebb50e1ac0571b1
5
5
  SHA512:
6
- metadata.gz: d1ff270855fee39b2cadf2043bcc50e8f8714c9ff24c35b6309391b074fdec0654566a3d9cd2dbc54c401a3c9d19ee2479d13afbefa9126bf81004ceb706f383
7
- data.tar.gz: ee2960e8df4235fdaad9c879c21ff2753044f2064f1b7d4b8604ff5d47105bca682ce22f1c3f9d884bedadcdfb42783f4eb725cd643ddd01f60a633489506fce
6
+ metadata.gz: b6c230d4ceadb59c9ad3260c575d571ddb6b190ff7bac76e597cf6334fdcec2a033e8a467893336ad9c1dc21efbc9c2c1c17823861ac4f954d51856066465461
7
+ data.tar.gz: 05c3be9386e85591ed4afbcd6f178d41a460dd20348580fa443393d736196fca7affa1db32a5ee6eca3b33d52f62e27a55e896620c26c14feca7b63799920438
@@ -0,0 +1,26 @@
1
+ image: ruby:2.6
2
+
3
+ cache:
4
+ paths:
5
+ - vendor/bundle
6
+ - vendor/ruby
7
+
8
+ before_script:
9
+ - ruby -v
10
+ - gem install bundler --no-document
11
+ - bundle config set path 'vendor'
12
+ - bundle install --jobs $(nproc)
13
+
14
+ rspec:
15
+ stage: test
16
+ script:
17
+ - bundle exec rspec
18
+
19
+ rubocop:
20
+ stage: test
21
+ allow_failure: true
22
+ script:
23
+ - bundle exec rubocop
24
+
25
+ stages:
26
+ - test
@@ -7,19 +7,32 @@ require:
7
7
 
8
8
  AllCops:
9
9
  Exclude:
10
- - vendor/bundle/**/* # fix for running on Travis CI
10
+ - bin/rubocop
11
+ - lib/generators/auxiliary_rails/templates/**/*
12
+ - vendor/**/* # fix for CI
11
13
 
12
14
  #################### Layout ##############################
13
15
 
14
- Layout/AlignArguments:
16
+ Layout/ArgumentAlignment:
15
17
  EnforcedStyle: with_fixed_indentation
16
18
 
19
+ Layout/MultilineMethodCallIndentation:
20
+ EnforcedStyle: indented
21
+
17
22
  #################### Metrics ##############################
18
23
 
19
24
  Metrics/BlockLength:
20
25
  ExcludedMethods:
21
26
  - describe
22
27
 
28
+ #################### RSpec ################################
29
+
30
+ RSpec/ExampleLength:
31
+ Max: 10
32
+
33
+ RSpec/MultipleExpectations:
34
+ Max: 3
35
+
23
36
  #################### Style ###############################
24
37
 
25
38
  Style/Documentation:
@@ -27,3 +40,15 @@ Style/Documentation:
27
40
 
28
41
  Style/FrozenStringLiteralComment:
29
42
  Enabled: false
43
+
44
+ Style/HashEachMethods:
45
+ Enabled: true
46
+
47
+ Style/HashTransformKeys:
48
+ Enabled: true
49
+
50
+ Style/HashTransformValues:
51
+ Enabled: true
52
+
53
+ Style/NegatedIf:
54
+ EnforcedStyle: postfix
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2019-05-12 09:23:17 +0300 using RuboCop version 0.68.1.
3
+ # on 2020-03-13 22:32:38 +0200 using RuboCop version 0.80.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -8,20 +8,10 @@
8
8
 
9
9
  # Offense count: 1
10
10
  # Cop supports --auto-correct.
11
- # Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
12
- Layout/ExtraSpacing:
11
+ Lint/SendWithMixinArgument:
13
12
  Exclude:
14
- - 'auxiliary_rails.gemspec'
13
+ - 'lib/auxiliary_rails/railtie.rb'
15
14
 
16
15
  # Offense count: 1
17
- # Cop supports --auto-correct.
18
- # Configuration parameters: AllowForAlignment.
19
- Layout/SpaceAroundOperators:
20
- Exclude:
21
- - 'auxiliary_rails.gemspec'
22
-
23
- # Offense count: 1
24
- # Configuration parameters: MinBodyLength.
25
- Style/GuardClause:
26
- Exclude:
27
- - 'auxiliary_rails.gemspec'
16
+ RSpec/NestedGroups:
17
+ Max: 4
@@ -0,0 +1,5 @@
1
+ --title "AuxiliaryRails"
2
+ --private --protected
3
+ --exclude lib/generators/*
4
+ --exclude lib/auxiliary_rails.rb
5
+ --exclude lib/auxiliary_rails/railtie.rb
@@ -1,5 +1,41 @@
1
1
  # AuxiliaryRails Changelog
2
2
 
3
+ ## [Unreleased]
4
+
5
+ ## v0.3.1
6
+
7
+ ### Added
8
+ - Errorable concern
9
+
10
+ ### Changed
11
+ - Remove validation failed default error #25
12
+
13
+ ## v0.3.0
14
+
15
+ ### Added
16
+ - Form Objects
17
+ - Query Objects
18
+ - Performable concern
19
+ - YARD docs and link to API documentation
20
+ - Commands usage examples
21
+ - Commands: `arguments` helper to get hash of all `param`s
22
+
23
+ ### Changed
24
+ - Namespace `Application` instead of `Abstract` prefixes for classes
25
+ - Commands migrate from `#call` to `#perform` method
26
+ - Commands: force validations
27
+
28
+ ### Removed
29
+ - RuboCop generator replaced with `rubocop-ergoserv` gem
30
+
31
+ ## v0.2.0
32
+
33
+ * Commands migration to `dry-initializer`
34
+
35
+ ## v0.1.7
36
+
37
+ * Bundle update (nokogiri 1.10.4, rake 12)
38
+
3
39
  ## v0.1.6
4
40
 
5
41
  * API Resource generator
@@ -7,7 +43,7 @@
7
43
 
8
44
  ## v0.1.5
9
45
 
10
- * Fix Gemfile.lock
46
+ * Fix `Gemfile.lock`
11
47
 
12
48
  ## v0.1.4
13
49
 
@@ -17,14 +53,14 @@
17
53
 
18
54
  ## v0.1.3
19
55
 
20
- * Upgrate `rubocop` gem and its configs
56
+ * Upgrade `rubocop` gem and its configs
21
57
  * `rubocop-rspec` and `rubocop-performance` gem iteration
22
58
  * Added basic Rails application template
23
59
  * CLI with `create_rails_app` command
24
60
 
25
61
  ## v0.1.2
26
62
 
27
- * Fix Gemfile.lock
63
+ * Fix `Gemfile.lock`
28
64
 
29
65
  ## v0.1.1
30
66
 
@@ -1,7 +1 @@
1
1
  # Contributing to AuxiliaryRails
2
-
3
- ## Rubocop Templates
4
-
5
- ### Versioning
6
-
7
- File `rubocop_auxiliary_rails_template.yml` contains a basic template of Rubocop config. After making any changes to this file the line `Version: N` should be updated and `N` (version number) should be incremented by one.
@@ -1,67 +1,90 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- auxiliary_rails (0.1.6)
4
+ auxiliary_rails (0.3.1)
5
+ dry-core
6
+ dry-initializer
7
+ dry-initializer-rails
8
+ rails (>= 5.2, < 7)
5
9
  thor
6
10
 
7
11
  GEM
8
12
  remote: https://rubygems.org/
9
13
  specs:
10
- actioncable (5.2.3)
11
- actionpack (= 5.2.3)
14
+ actioncable (6.0.2.1)
15
+ actionpack (= 6.0.2.1)
12
16
  nio4r (~> 2.0)
13
17
  websocket-driver (>= 0.6.1)
14
- actionmailer (5.2.3)
15
- actionpack (= 5.2.3)
16
- actionview (= 5.2.3)
17
- activejob (= 5.2.3)
18
+ actionmailbox (6.0.2.1)
19
+ actionpack (= 6.0.2.1)
20
+ activejob (= 6.0.2.1)
21
+ activerecord (= 6.0.2.1)
22
+ activestorage (= 6.0.2.1)
23
+ activesupport (= 6.0.2.1)
24
+ mail (>= 2.7.1)
25
+ actionmailer (6.0.2.1)
26
+ actionpack (= 6.0.2.1)
27
+ actionview (= 6.0.2.1)
28
+ activejob (= 6.0.2.1)
18
29
  mail (~> 2.5, >= 2.5.4)
19
30
  rails-dom-testing (~> 2.0)
20
- actionpack (5.2.3)
21
- actionview (= 5.2.3)
22
- activesupport (= 5.2.3)
23
- rack (~> 2.0)
31
+ actionpack (6.0.2.1)
32
+ actionview (= 6.0.2.1)
33
+ activesupport (= 6.0.2.1)
34
+ rack (~> 2.0, >= 2.0.8)
24
35
  rack-test (>= 0.6.3)
25
36
  rails-dom-testing (~> 2.0)
26
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
27
- actionview (5.2.3)
28
- activesupport (= 5.2.3)
37
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
38
+ actiontext (6.0.2.1)
39
+ actionpack (= 6.0.2.1)
40
+ activerecord (= 6.0.2.1)
41
+ activestorage (= 6.0.2.1)
42
+ activesupport (= 6.0.2.1)
43
+ nokogiri (>= 1.8.5)
44
+ actionview (6.0.2.1)
45
+ activesupport (= 6.0.2.1)
29
46
  builder (~> 3.1)
30
47
  erubi (~> 1.4)
31
48
  rails-dom-testing (~> 2.0)
32
- rails-html-sanitizer (~> 1.0, >= 1.0.3)
33
- activejob (5.2.3)
34
- activesupport (= 5.2.3)
49
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
50
+ activejob (6.0.2.1)
51
+ activesupport (= 6.0.2.1)
35
52
  globalid (>= 0.3.6)
36
- activemodel (5.2.3)
37
- activesupport (= 5.2.3)
38
- activerecord (5.2.3)
39
- activemodel (= 5.2.3)
40
- activesupport (= 5.2.3)
41
- arel (>= 9.0)
42
- activestorage (5.2.3)
43
- actionpack (= 5.2.3)
44
- activerecord (= 5.2.3)
53
+ activemodel (6.0.2.1)
54
+ activesupport (= 6.0.2.1)
55
+ activerecord (6.0.2.1)
56
+ activemodel (= 6.0.2.1)
57
+ activesupport (= 6.0.2.1)
58
+ activestorage (6.0.2.1)
59
+ actionpack (= 6.0.2.1)
60
+ activejob (= 6.0.2.1)
61
+ activerecord (= 6.0.2.1)
45
62
  marcel (~> 0.3.1)
46
- activesupport (5.2.3)
63
+ activesupport (6.0.2.1)
47
64
  concurrent-ruby (~> 1.0, >= 1.0.2)
48
65
  i18n (>= 0.7, < 2)
49
66
  minitest (~> 5.1)
50
67
  tzinfo (~> 1.1)
51
- arel (9.0.0)
68
+ zeitwerk (~> 2.2)
52
69
  ast (2.4.0)
53
- builder (3.2.3)
70
+ builder (3.2.4)
54
71
  coderay (1.1.2)
55
- concurrent-ruby (1.1.5)
56
- crass (1.0.4)
72
+ concurrent-ruby (1.1.6)
73
+ crass (1.0.6)
57
74
  diff-lcs (1.3)
58
- erubi (1.8.0)
75
+ dry-core (0.4.9)
76
+ concurrent-ruby (~> 1.0)
77
+ dry-initializer (3.0.3)
78
+ dry-initializer-rails (3.1.1)
79
+ dry-initializer (>= 2.4, < 4)
80
+ rails (> 3.0)
81
+ erubi (1.9.0)
59
82
  globalid (0.4.2)
60
83
  activesupport (>= 4.2.0)
61
- i18n (1.6.0)
84
+ i18n (1.8.2)
62
85
  concurrent-ruby (~> 1.0)
63
- jaro_winkler (1.5.2)
64
- loofah (2.2.3)
86
+ jaro_winkler (1.5.4)
87
+ loofah (2.4.0)
65
88
  crass (~> 1.0.2)
66
89
  nokogiri (>= 1.5.9)
67
90
  mail (2.7.1)
@@ -69,91 +92,93 @@ GEM
69
92
  marcel (0.3.3)
70
93
  mimemagic (~> 0.3.2)
71
94
  method_source (0.9.2)
72
- ast (~> 2.4.0)
73
- mimemagic (0.3.3)
95
+ mimemagic (0.3.4)
74
96
  mini_mime (1.0.2)
75
97
  mini_portile2 (2.4.0)
76
- minitest (5.11.3)
77
- nio4r (2.4.0)
78
- nokogiri (1.10.3)
98
+ minitest (5.14.0)
99
+ nio4r (2.5.2)
100
+ nokogiri (1.10.9)
79
101
  mini_portile2 (~> 2.4.0)
80
- parallel (1.17.0)
81
- parser (2.6.3.0)
102
+ parallel (1.19.1)
103
+ parser (2.7.0.4)
82
104
  ast (~> 2.4.0)
83
105
  pry (0.12.2)
84
106
  coderay (~> 1.1.0)
85
107
  method_source (~> 0.9.0)
86
- psych (3.1.0)
87
- rack (2.0.7)
108
+ rack (2.2.3)
88
109
  rack-test (1.1.0)
89
110
  rack (>= 1.0, < 3)
90
- rails (5.2.3)
91
- actioncable (= 5.2.3)
92
- actionmailer (= 5.2.3)
93
- actionpack (= 5.2.3)
94
- actionview (= 5.2.3)
95
- activejob (= 5.2.3)
96
- activemodel (= 5.2.3)
97
- activerecord (= 5.2.3)
98
- activestorage (= 5.2.3)
99
- activesupport (= 5.2.3)
111
+ rails (6.0.2.1)
112
+ actioncable (= 6.0.2.1)
113
+ actionmailbox (= 6.0.2.1)
114
+ actionmailer (= 6.0.2.1)
115
+ actionpack (= 6.0.2.1)
116
+ actiontext (= 6.0.2.1)
117
+ actionview (= 6.0.2.1)
118
+ activejob (= 6.0.2.1)
119
+ activemodel (= 6.0.2.1)
120
+ activerecord (= 6.0.2.1)
121
+ activestorage (= 6.0.2.1)
122
+ activesupport (= 6.0.2.1)
100
123
  bundler (>= 1.3.0)
101
- railties (= 5.2.3)
124
+ railties (= 6.0.2.1)
102
125
  sprockets-rails (>= 2.0.0)
103
126
  rails-dom-testing (2.0.3)
104
127
  activesupport (>= 4.2.0)
105
128
  nokogiri (>= 1.6)
106
- rails-html-sanitizer (1.0.4)
107
- loofah (~> 2.2, >= 2.2.2)
108
- railties (5.2.3)
109
- actionpack (= 5.2.3)
110
- activesupport (= 5.2.3)
129
+ rails-html-sanitizer (1.3.0)
130
+ loofah (~> 2.3)
131
+ railties (6.0.2.1)
132
+ actionpack (= 6.0.2.1)
133
+ activesupport (= 6.0.2.1)
111
134
  method_source
112
135
  rake (>= 0.8.7)
113
- thor (>= 0.19.0, < 2.0)
136
+ thor (>= 0.20.3, < 2.0)
114
137
  rainbow (3.0.0)
115
- rake (10.5.0)
116
- rspec (3.8.0)
117
- rspec-core (~> 3.8.0)
118
- rspec-expectations (~> 3.8.0)
119
- rspec-mocks (~> 3.8.0)
120
- rspec-core (3.8.0)
121
- rspec-support (~> 3.8.0)
122
- rspec-expectations (3.8.3)
138
+ rake (13.0.1)
139
+ rexml (3.2.4)
140
+ rspec (3.9.0)
141
+ rspec-core (~> 3.9.0)
142
+ rspec-expectations (~> 3.9.0)
143
+ rspec-mocks (~> 3.9.0)
144
+ rspec-core (3.9.1)
145
+ rspec-support (~> 3.9.1)
146
+ rspec-expectations (3.9.0)
123
147
  diff-lcs (>= 1.2.0, < 2.0)
124
- rspec-support (~> 3.8.0)
125
- rspec-mocks (3.8.0)
148
+ rspec-support (~> 3.9.0)
149
+ rspec-mocks (3.9.1)
126
150
  diff-lcs (>= 1.2.0, < 2.0)
127
- rspec-support (~> 3.8.0)
128
- rspec-support (3.8.0)
129
- rubocop (0.68.1)
151
+ rspec-support (~> 3.9.0)
152
+ rspec-support (3.9.2)
153
+ rubocop (0.80.1)
130
154
  jaro_winkler (~> 1.5.1)
131
155
  parallel (~> 1.10)
132
- parser (>= 2.5, != 2.5.1.1)
133
- psych (>= 3.1.0)
156
+ parser (>= 2.7.0.1)
134
157
  rainbow (>= 2.2.2, < 4.0)
158
+ rexml
135
159
  ruby-progressbar (~> 1.7)
136
- unicode-display_width (>= 1.4.0, < 1.6)
137
- rubocop-performance (1.2.0)
138
- rubocop (>= 0.68.0)
139
- rubocop-rspec (1.32.0)
140
- rubocop (>= 0.60.0)
141
- ruby-progressbar (1.10.0)
142
- sprockets (3.7.2)
160
+ unicode-display_width (>= 1.4.0, < 1.7)
161
+ rubocop-performance (1.5.2)
162
+ rubocop (>= 0.71.0)
163
+ rubocop-rspec (1.38.1)
164
+ rubocop (>= 0.68.1)
165
+ ruby-progressbar (1.10.1)
166
+ sprockets (4.0.0)
143
167
  concurrent-ruby (~> 1.0)
144
168
  rack (> 1, < 3)
145
169
  sprockets-rails (3.2.1)
146
170
  actionpack (>= 4.0)
147
171
  activesupport (>= 4.0)
148
172
  sprockets (>= 3.0.0)
149
- thor (0.20.3)
173
+ thor (1.0.1)
150
174
  thread_safe (0.3.6)
151
- tzinfo (1.2.5)
175
+ tzinfo (1.2.6)
152
176
  thread_safe (~> 0.1)
153
- unicode-display_width (1.5.0)
177
+ unicode-display_width (1.6.1)
154
178
  websocket-driver (0.7.1)
155
179
  websocket-extensions (>= 0.1.0)
156
- websocket-extensions (0.1.4)
180
+ websocket-extensions (0.1.5)
181
+ zeitwerk (2.3.0)
157
182
 
158
183
  PLATFORMS
159
184
  ruby
@@ -162,12 +187,11 @@ DEPENDENCIES
162
187
  auxiliary_rails!
163
188
  bundler (~> 2.0)
164
189
  pry
165
- rails (~> 5.2)
166
- rake (~> 10.0)
167
- rspec (~> 3.0)
168
- rubocop
190
+ rake
191
+ rspec (~> 3.8)
192
+ rubocop (~> 0.80)
169
193
  rubocop-performance
170
194
  rubocop-rspec
171
195
 
172
196
  BUNDLED WITH
173
- 2.0.2
197
+ 2.1.4