operations 0.0.1 → 0.6.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/.github/workflows/ci.yml +33 -0
- data/.gitignore +4 -0
- data/.rspec +0 -2
- data/.rubocop.yml +21 -0
- data/.rubocop_todo.yml +36 -0
- data/Appraisals +8 -0
- data/CHANGELOG.md +11 -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 +412 -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: cc575adbf6fc2bf4be98c515a6339190ed29243ccccf2655a8927b0a8f95ac5a
|
4
|
+
data.tar.gz: 486800ebcbd4bc7cffff7aa9e272dba34500a568911a23bb5c7ce60accbb7cea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1998a83aa5e434c3431d43bf7036f674a2f5f1fd0859f0ea08fc24fe28c419c4a3ee42b07948d8d3faecb2b0b118d006119aa0818e03edd948292ff2e102222c
|
7
|
+
data.tar.gz: b8fab83bfa1f14e139ec3b946f01496e22ec4a57243e74bcee354389e7818847b7df7bd9cd4cf66178e2bf247db1bccd9bd9d6bca12db6fb33b15bbcfb42f572
|
@@ -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,36 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2023-03-25 07:19:50 UTC using RuboCop version 1.44.1.
|
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
|
+
# AllowedGems: bundler
|
13
|
+
# Include: **/*.gemspec, **/Gemfile, **/gems.rb
|
14
|
+
Gemspec/DevelopmentDependencies:
|
15
|
+
Exclude:
|
16
|
+
- 'operations.gemspec'
|
17
|
+
|
18
|
+
# Offense count: 5
|
19
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, CountRepeatedAttributes.
|
20
|
+
Metrics/AbcSize:
|
21
|
+
Max: 28
|
22
|
+
|
23
|
+
# Offense count: 2
|
24
|
+
# Configuration parameters: CountComments, CountAsOne.
|
25
|
+
Metrics/ClassLength:
|
26
|
+
Max: 160
|
27
|
+
|
28
|
+
# Offense count: 7
|
29
|
+
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods.
|
30
|
+
Metrics/MethodLength:
|
31
|
+
Max: 17
|
32
|
+
|
33
|
+
# Offense count: 1
|
34
|
+
# Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
|
35
|
+
Metrics/ParameterLists:
|
36
|
+
Max: 7
|
data/Appraisals
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## [0.6.2](https://github.com/BookingSync/operations/tree/main)
|
4
|
+
|
5
|
+
### Added
|
6
|
+
|
7
|
+
- Support Rails 7.1 [\#40](https://github.com/BookingSync/operations/pull/40) ([ston1x](https://github.com/pyromaniac))
|
8
|
+
- Include `Dry::Monads[:result]` in Policies, Preconditions and Callbacks [\#39](https://github.com/BookingSync/operations/pull/39) ([ston1x](https://github.com/ston1x))
|
9
|
+
- Add `callback` method to `Operations::Convenience` [\#37](https://github.com/BookingSync/operations/pull/37) ([pyromaniac](https://github.com/pyromaniac))
|
10
|
+
- Ability to access operation result in callbacks [\#36](https://github.com/BookingSync/operations/pull/36) ([pyromaniac](https://github.com/pyromaniac))
|
11
|
+
- 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
|