auxiliary_rails 0.2.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +26 -0
- data/.rubocop.yml +31 -3
- data/.rubocop_todo.yml +3 -19
- data/.ruby-version +1 -1
- data/.yardopts +5 -0
- data/CHANGELOG.md +39 -2
- data/CODE_OF_CONDUCT.md +128 -0
- data/CONTRIBUTING.md +0 -6
- data/Gemfile.lock +164 -132
- data/README.md +267 -5
- data/auxiliary_rails.gemspec +18 -13
- data/bin/rspec +29 -0
- data/bin/rubocop +29 -0
- data/bitbucket-pipelines.yml +35 -0
- data/lib/auxiliary_rails/application/command.rb +53 -0
- data/lib/auxiliary_rails/application/error.rb +50 -0
- data/lib/auxiliary_rails/application/form.rb +31 -0
- data/lib/auxiliary_rails/application/query.rb +75 -0
- data/lib/auxiliary_rails/application/service.rb +42 -0
- data/lib/auxiliary_rails/cli.rb +18 -5
- data/lib/auxiliary_rails/concerns/callable.rb +23 -0
- data/lib/auxiliary_rails/concerns/errorable.rb +22 -0
- data/lib/auxiliary_rails/concerns/performable.rb +120 -0
- data/lib/auxiliary_rails/railtie.rb +2 -1
- data/lib/auxiliary_rails/version.rb +1 -1
- data/lib/auxiliary_rails/view_helpers/display_helper.rb +30 -0
- data/lib/auxiliary_rails/view_helpers.rb +4 -0
- data/lib/auxiliary_rails.rb +7 -3
- data/lib/generators/auxiliary_rails/command_generator.rb +1 -1
- data/lib/generators/auxiliary_rails/install_commands_generator.rb +5 -0
- data/lib/generators/auxiliary_rails/install_errors_controller_generator.rb +31 -0
- data/lib/generators/auxiliary_rails/install_generator.rb +1 -1
- data/lib/generators/auxiliary_rails/service_generator.rb +48 -0
- data/lib/generators/auxiliary_rails/templates/application_error_template.rb +1 -1
- data/lib/generators/auxiliary_rails/templates/commands/application_command_template.rb +1 -1
- data/lib/generators/auxiliary_rails/templates/commands/command_spec_template.rb +1 -1
- data/lib/generators/auxiliary_rails/templates/commands/command_template.rb +2 -2
- data/lib/generators/auxiliary_rails/templates/commands/commands.en_template.yml +5 -0
- data/lib/generators/auxiliary_rails/templates/errors_controller/errors_controller_template.rb +15 -0
- data/lib/generators/auxiliary_rails/templates/errors_controller/not_found_template.html.erb +2 -0
- data/lib/generators/auxiliary_rails/templates/errors_controller/show_template.html.erb +1 -0
- data/lib/generators/auxiliary_rails/templates/errors_controller/unacceptable_template.html.erb +2 -0
- data/lib/generators/auxiliary_rails/templates/services/service_spec_template.rb +5 -0
- data/lib/generators/auxiliary_rails/templates/services/service_template.rb +10 -0
- data/templates/rails/elementary.rb +39 -10
- metadata +87 -32
- data/lib/auxiliary_rails/abstract_command.rb +0 -95
- data/lib/auxiliary_rails/abstract_error.rb +0 -7
- data/lib/generators/auxiliary_rails/install_rubocop_generator.rb +0 -29
- data/lib/generators/auxiliary_rails/templates/rubocop/rubocop_auxiliary_rails_template.yml +0 -65
- data/lib/generators/auxiliary_rails/templates/rubocop/rubocop_template.yml +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9da4081f14b301b1f3afaf5583089107f0874f7393b2586fe5db91323a9f783
|
4
|
+
data.tar.gz: 11b3e55c61f19b8a0fcc0581147f7dccdd869602ab8fb72f479450ebcf5086d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 809eef68d020df68ebb2909d6a3ad648cf31eefeda9206d25d663ba886d81360fd8f9622a9a83a109b3960362a76ec0d59a758def6fa95dccb53ae8d91c57f85
|
7
|
+
data.tar.gz: 6a03196d6b77686fb9e4b3c606d2939ed0b3b583f34f764c0d1117f779c33585aee862a8c3a90a2868fd602f187ed17059b896c1378f20f40d1d2645fe19123f
|
data/.gitlab-ci.yml
ADDED
@@ -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
|
data/.rubocop.yml
CHANGED
@@ -7,21 +7,34 @@ require:
|
|
7
7
|
|
8
8
|
AllCops:
|
9
9
|
Exclude:
|
10
|
-
-
|
10
|
+
- bin/rspec
|
11
|
+
- bin/rubocop
|
12
|
+
- lib/generators/auxiliary_rails/templates/**/*
|
13
|
+
- vendor/**/* # fix for CI
|
14
|
+
NewCops: enable
|
15
|
+
TargetRubyVersion: 2.5
|
11
16
|
|
12
17
|
#################### Layout ##############################
|
13
18
|
|
14
|
-
Layout/
|
19
|
+
Layout/ArgumentAlignment:
|
15
20
|
EnforcedStyle: with_fixed_indentation
|
16
21
|
|
22
|
+
Layout/LineEndStringConcatenationIndentation:
|
23
|
+
EnforcedStyle: indented
|
24
|
+
|
25
|
+
Layout/MultilineMethodCallIndentation:
|
26
|
+
EnforcedStyle: indented
|
27
|
+
|
17
28
|
#################### Metrics ##############################
|
18
29
|
|
19
30
|
Metrics/BlockLength:
|
20
|
-
|
31
|
+
IgnoredMethods:
|
21
32
|
- describe
|
22
33
|
|
23
34
|
#################### RSpec ################################
|
24
35
|
|
36
|
+
RSpec/ExampleLength:
|
37
|
+
Max: 10
|
25
38
|
|
26
39
|
RSpec/MultipleExpectations:
|
27
40
|
Max: 3
|
@@ -31,5 +44,20 @@ RSpec/MultipleExpectations:
|
|
31
44
|
Style/Documentation:
|
32
45
|
Enabled: false
|
33
46
|
|
47
|
+
Style/IfUnlessModifier:
|
48
|
+
Enabled: false
|
49
|
+
|
34
50
|
Style/FrozenStringLiteralComment:
|
35
51
|
Enabled: false
|
52
|
+
|
53
|
+
Style/HashEachMethods:
|
54
|
+
Enabled: true
|
55
|
+
|
56
|
+
Style/HashTransformKeys:
|
57
|
+
Enabled: true
|
58
|
+
|
59
|
+
Style/HashTransformValues:
|
60
|
+
Enabled: true
|
61
|
+
|
62
|
+
Style/NegatedIf:
|
63
|
+
EnforcedStyle: postfix
|
data/.rubocop_todo.yml
CHANGED
@@ -1,27 +1,11 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on
|
3
|
+
# on 2021-11-19 20:08:00 UTC using RuboCop version 1.20.0.
|
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
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
9
|
# Offense count: 1
|
10
|
-
|
11
|
-
|
12
|
-
Layout/ExtraSpacing:
|
13
|
-
Exclude:
|
14
|
-
- 'auxiliary_rails.gemspec'
|
15
|
-
|
16
|
-
# 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'
|
10
|
+
RSpec/NestedGroups:
|
11
|
+
Max: 4
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.7.4
|
data/.yardopts
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,46 @@
|
|
1
1
|
# AuxiliaryRails Changelog
|
2
2
|
|
3
|
+
## [Unreleased]
|
4
|
+
|
5
|
+
## [0.4.0] - 2022-08-28
|
6
|
+
|
7
|
+
### Added
|
8
|
+
|
9
|
+
- `AuxiliaryRails::Application::Error` significantly extended
|
10
|
+
- `AuxiliaryRails::Application::Service` added
|
11
|
+
- `AuxiliaryRails::Concerns::Callable` added
|
12
|
+
- `ErrorsController` template (custom error pages)
|
13
|
+
- View helper: `display_name`
|
14
|
+
|
15
|
+
## v0.3.1
|
16
|
+
|
17
|
+
### Added
|
18
|
+
- Errorable concern
|
19
|
+
|
20
|
+
### Changed
|
21
|
+
- Remove validation failed default error #25
|
22
|
+
|
23
|
+
## v0.3.0
|
24
|
+
|
25
|
+
### Added
|
26
|
+
- Form Objects
|
27
|
+
- Query Objects
|
28
|
+
- Performable concern
|
29
|
+
- YARD docs and link to API documentation
|
30
|
+
- Commands usage examples
|
31
|
+
- Commands: `arguments` helper to get hash of all `param`s
|
32
|
+
|
33
|
+
### Changed
|
34
|
+
- Namespace `Application` instead of `Abstract` prefixes for classes
|
35
|
+
- Commands migrate from `#call` to `#perform` method
|
36
|
+
- Commands: force validations
|
37
|
+
|
38
|
+
### Removed
|
39
|
+
- RuboCop generator moved to [rubocop-ergoserv](https://github.com/ergoserv/rubocop-ergoserv) gem
|
40
|
+
|
3
41
|
## v0.2.0
|
4
42
|
|
5
43
|
* Commands migration to `dry-initializer`
|
6
|
-
* Commands usage examples
|
7
44
|
|
8
45
|
## v0.1.7
|
9
46
|
|
@@ -26,7 +63,7 @@
|
|
26
63
|
|
27
64
|
## v0.1.3
|
28
65
|
|
29
|
-
*
|
66
|
+
* Upgrade `rubocop` gem and its configs
|
30
67
|
* `rubocop-rspec` and `rubocop-performance` gem iteration
|
31
68
|
* Added basic Rails application template
|
32
69
|
* CLI with `create_rails_app` command
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,128 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity
|
10
|
+
and orientation.
|
11
|
+
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
13
|
+
diverse, inclusive, and healthy community.
|
14
|
+
|
15
|
+
## Our Standards
|
16
|
+
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
18
|
+
community include:
|
19
|
+
|
20
|
+
* Demonstrating empathy and kindness toward other people
|
21
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
22
|
+
* Giving and gracefully accepting constructive feedback
|
23
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
24
|
+
and learning from the experience
|
25
|
+
* Focusing on what is best not just for us as individuals, but for the
|
26
|
+
overall community
|
27
|
+
|
28
|
+
Examples of unacceptable behavior include:
|
29
|
+
|
30
|
+
* The use of sexualized language or imagery, and sexual attention or
|
31
|
+
advances of any kind
|
32
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
33
|
+
* Public or private harassment
|
34
|
+
* Publishing others' private information, such as a physical or email
|
35
|
+
address, without their explicit permission
|
36
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
37
|
+
professional setting
|
38
|
+
|
39
|
+
## Enforcement Responsibilities
|
40
|
+
|
41
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
42
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
43
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
44
|
+
or harmful.
|
45
|
+
|
46
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
47
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
48
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
49
|
+
decisions when appropriate.
|
50
|
+
|
51
|
+
## Scope
|
52
|
+
|
53
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
54
|
+
an individual is officially representing the community in public spaces.
|
55
|
+
Examples of representing our community include using an official e-mail address,
|
56
|
+
posting via an official social media account, or acting as an appointed
|
57
|
+
representative at an online or offline event.
|
58
|
+
|
59
|
+
## Enforcement
|
60
|
+
|
61
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
62
|
+
reported to the community leaders responsible for enforcement at
|
63
|
+
hello@ergoserv.com.
|
64
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
65
|
+
|
66
|
+
All community leaders are obligated to respect the privacy and security of the
|
67
|
+
reporter of any incident.
|
68
|
+
|
69
|
+
## Enforcement Guidelines
|
70
|
+
|
71
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
72
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
73
|
+
|
74
|
+
### 1. Correction
|
75
|
+
|
76
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
77
|
+
unprofessional or unwelcome in the community.
|
78
|
+
|
79
|
+
**Consequence**: A private, written warning from community leaders, providing
|
80
|
+
clarity around the nature of the violation and an explanation of why the
|
81
|
+
behavior was inappropriate. A public apology may be requested.
|
82
|
+
|
83
|
+
### 2. Warning
|
84
|
+
|
85
|
+
**Community Impact**: A violation through a single incident or series
|
86
|
+
of actions.
|
87
|
+
|
88
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
89
|
+
interaction with the people involved, including unsolicited interaction with
|
90
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
91
|
+
includes avoiding interactions in community spaces as well as external channels
|
92
|
+
like social media. Violating these terms may lead to a temporary or
|
93
|
+
permanent ban.
|
94
|
+
|
95
|
+
### 3. Temporary Ban
|
96
|
+
|
97
|
+
**Community Impact**: A serious violation of community standards, including
|
98
|
+
sustained inappropriate behavior.
|
99
|
+
|
100
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
101
|
+
communication with the community for a specified period of time. No public or
|
102
|
+
private interaction with the people involved, including unsolicited interaction
|
103
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
104
|
+
Violating these terms may lead to a permanent ban.
|
105
|
+
|
106
|
+
### 4. Permanent Ban
|
107
|
+
|
108
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
109
|
+
standards, including sustained inappropriate behavior, harassment of an
|
110
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
111
|
+
|
112
|
+
**Consequence**: A permanent ban from any sort of public interaction within
|
113
|
+
the community.
|
114
|
+
|
115
|
+
## Attribution
|
116
|
+
|
117
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
118
|
+
version 2.0, available at
|
119
|
+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
120
|
+
|
121
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
122
|
+
enforcement ladder](https://github.com/mozilla/diversity).
|
123
|
+
|
124
|
+
[homepage]: https://www.contributor-covenant.org
|
125
|
+
|
126
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
127
|
+
https://www.contributor-covenant.org/faq. Translations are available at
|
128
|
+
https://www.contributor-covenant.org/translations.
|
data/CONTRIBUTING.md
CHANGED
@@ -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.
|