operations 0.0.1 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +33 -0
- data/.gitignore +4 -0
- data/.rspec +0 -2
- data/.rubocop.yml +21 -0
- data/.rubocop_todo.yml +30 -0
- data/Appraisals +8 -0
- data/CHANGELOG.md +17 -0
- data/Gemfile +8 -2
- data/README.md +910 -5
- data/Rakefile +3 -1
- data/gemfiles/rails.5.2.gemfile +14 -0
- data/gemfiles/rails.6.0.gemfile +14 -0
- data/gemfiles/rails.6.1.gemfile +14 -0
- data/gemfiles/rails.7.0.gemfile +14 -0
- data/gemfiles/rails.7.1.gemfile +14 -0
- data/lib/operations/command.rb +413 -0
- data/lib/operations/components/base.rb +79 -0
- data/lib/operations/components/callback.rb +55 -0
- data/lib/operations/components/contract.rb +20 -0
- data/lib/operations/components/idempotency.rb +70 -0
- data/lib/operations/components/on_failure.rb +16 -0
- data/lib/operations/components/on_success.rb +35 -0
- data/lib/operations/components/operation.rb +37 -0
- data/lib/operations/components/policies.rb +42 -0
- data/lib/operations/components/prechecks.rb +38 -0
- data/lib/operations/components/preconditions.rb +45 -0
- data/lib/operations/components.rb +5 -0
- data/lib/operations/configuration.rb +15 -0
- data/lib/operations/contract/messages_resolver.rb +11 -0
- data/lib/operations/contract.rb +39 -0
- data/lib/operations/convenience.rb +102 -0
- data/lib/operations/form/attribute.rb +42 -0
- data/lib/operations/form/builder.rb +85 -0
- data/lib/operations/form.rb +194 -0
- data/lib/operations/result.rb +122 -0
- data/lib/operations/test_helpers.rb +71 -0
- data/lib/operations/types.rb +6 -0
- data/lib/operations/version.rb +3 -1
- data/lib/operations.rb +42 -2
- data/operations.gemspec +20 -4
- metadata +164 -9
- data/.travis.yml +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc7557987e49805062efa789a9ecc5b0344839b5f8217b9a59fbd6904246ec8f
|
4
|
+
data.tar.gz: 801b5edbde46dba2c005ef8bad826691ca00ce7adda5654d04f602406d15847f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcec088edb29345af8934525274ddf100a5d0276545c2153ef1eeef4e6a255040dd0eabfd287afc5d68c3b041a4ac335ef8a258d653598cbb449eb2a78b94c63
|
7
|
+
data.tar.gz: b660a95428e98a9e6839f2b154623dd5226532c646a486f606f4c318c71bef8dd7861859a5775a28be47098ffeecd7c54974baaf31195246084d2ace7daeac08
|
@@ -0,0 +1,33 @@
|
|
1
|
+
name: CI
|
2
|
+
on: [push]
|
3
|
+
jobs:
|
4
|
+
rspec:
|
5
|
+
strategy:
|
6
|
+
fail-fast: false
|
7
|
+
matrix:
|
8
|
+
include:
|
9
|
+
- { ruby: '2.7', rails: '5.2' }
|
10
|
+
- { ruby: '2.7', rails: '6.0' }
|
11
|
+
- { ruby: '3.0', rails: '6.1' }
|
12
|
+
- { ruby: '3.1', rails: '7.0' }
|
13
|
+
- { ruby: '3.2', rails: '7.1' }
|
14
|
+
runs-on: ubuntu-latest
|
15
|
+
env:
|
16
|
+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails.${{ matrix.rails }}.gemfile
|
17
|
+
steps:
|
18
|
+
- uses: actions/checkout@v2
|
19
|
+
- uses: ruby/setup-ruby@v1
|
20
|
+
with:
|
21
|
+
ruby-version: ${{ matrix.ruby }}
|
22
|
+
bundler-cache: true
|
23
|
+
- run: bundle exec rspec
|
24
|
+
|
25
|
+
rubocop:
|
26
|
+
runs-on: ubuntu-latest
|
27
|
+
steps:
|
28
|
+
- uses: actions/checkout@v2
|
29
|
+
- uses: ruby/setup-ruby@v1
|
30
|
+
with:
|
31
|
+
ruby-version: 2.7
|
32
|
+
bundler-cache: true
|
33
|
+
- run: bundle exec rubocop
|
data/.gitignore
CHANGED
data/.rspec
CHANGED
data/.rubocop.yml
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-performance
|
3
|
+
- rubocop-rails
|
4
|
+
- rubocop-rspec
|
5
|
+
|
6
|
+
inherit_gem:
|
7
|
+
bookingsync-rubocop:
|
8
|
+
- config/base.yml
|
9
|
+
- config/rails.yml
|
10
|
+
- config/rspec.yml
|
11
|
+
|
12
|
+
inherit_from: .rubocop_todo.yml
|
13
|
+
|
14
|
+
inherit_mode:
|
15
|
+
merge:
|
16
|
+
- Exclude
|
17
|
+
|
18
|
+
AllCops:
|
19
|
+
TargetRubyVersion: 2.7
|
20
|
+
Exclude:
|
21
|
+
- gemfiles/*
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2023-12-20 10:30:23 UTC using RuboCop version 1.57.2.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 3
|
10
|
+
# Configuration parameters: EnforcedStyle, AllowedGems, Include.
|
11
|
+
# SupportedStyles: Gemfile, gems.rb, gemspec
|
12
|
+
# Include: **/*.gemspec, **/Gemfile, **/gems.rb
|
13
|
+
Gemspec/DevelopmentDependencies:
|
14
|
+
Exclude:
|
15
|
+
- 'operations.gemspec'
|
16
|
+
|
17
|
+
# Offense count: 5
|
18
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
|
19
|
+
Metrics/AbcSize:
|
20
|
+
Max: 28
|
21
|
+
|
22
|
+
# Offense count: 2
|
23
|
+
# Configuration parameters: CountComments, CountAsOne.
|
24
|
+
Metrics/ClassLength:
|
25
|
+
Max: 161
|
26
|
+
|
27
|
+
# Offense count: 1
|
28
|
+
# Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
|
29
|
+
Metrics/ParameterLists:
|
30
|
+
Max: 7
|
data/Appraisals
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## [0.6.3](https://github.com/BookingSync/operations/tree/main)
|
4
|
+
|
5
|
+
### Fixes
|
6
|
+
|
7
|
+
- In some cases, `Operation::Command#form_class` was evaluated before `form_base` was evaluated [\#41](https://github.com/BookingSync/operations/pull/41) ([pyromaniac](https://github.com/pyromaniac))
|
8
|
+
|
9
|
+
## [0.6.2]
|
10
|
+
|
11
|
+
### Added
|
12
|
+
|
13
|
+
- Support Rails 7.1 [\#40](https://github.com/BookingSync/operations/pull/40) ([pyromaniac](https://github.com/pyromaniac))
|
14
|
+
- Include `Dry::Monads[:result]` in Policies, Preconditions and Callbacks [\#39](https://github.com/BookingSync/operations/pull/39) ([ston1x](https://github.com/ston1x))
|
15
|
+
- Add `callback` method to `Operations::Convenience` [\#37](https://github.com/BookingSync/operations/pull/37) ([pyromaniac](https://github.com/pyromaniac))
|
16
|
+
- Ability to access operation result in callbacks [\#36](https://github.com/BookingSync/operations/pull/36) ([pyromaniac](https://github.com/pyromaniac))
|
17
|
+
- Introduce Command#merge [\#34](https://github.com/BookingSync/operations/pull/34) ([pyromaniac](https://github.com/pyromaniac))
|
data/Gemfile
CHANGED
@@ -1,7 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
source "https://rubygems.org"
|
2
4
|
|
3
5
|
# Specify your gem's dependencies in operations.gemspec
|
4
6
|
gemspec
|
5
7
|
|
6
|
-
gem "
|
7
|
-
gem "rspec"
|
8
|
+
gem "bookingsync-rubocop", require: false, github: "BookingSync/bookingsync-rubocop", branch: "main"
|
9
|
+
gem "rspec"
|
10
|
+
gem "rubocop", require: false
|
11
|
+
gem "rubocop-performance", require: false
|
12
|
+
gem "rubocop-rails", require: false
|
13
|
+
gem "rubocop-rspec", require: false
|