operations 0.0.1 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +33 -0
  3. data/.gitignore +4 -0
  4. data/.rspec +0 -2
  5. data/.rubocop.yml +21 -0
  6. data/.rubocop_todo.yml +30 -0
  7. data/Appraisals +8 -0
  8. data/CHANGELOG.md +17 -0
  9. data/Gemfile +8 -2
  10. data/README.md +910 -5
  11. data/Rakefile +3 -1
  12. data/gemfiles/rails.5.2.gemfile +14 -0
  13. data/gemfiles/rails.6.0.gemfile +14 -0
  14. data/gemfiles/rails.6.1.gemfile +14 -0
  15. data/gemfiles/rails.7.0.gemfile +14 -0
  16. data/gemfiles/rails.7.1.gemfile +14 -0
  17. data/lib/operations/command.rb +413 -0
  18. data/lib/operations/components/base.rb +79 -0
  19. data/lib/operations/components/callback.rb +55 -0
  20. data/lib/operations/components/contract.rb +20 -0
  21. data/lib/operations/components/idempotency.rb +70 -0
  22. data/lib/operations/components/on_failure.rb +16 -0
  23. data/lib/operations/components/on_success.rb +35 -0
  24. data/lib/operations/components/operation.rb +37 -0
  25. data/lib/operations/components/policies.rb +42 -0
  26. data/lib/operations/components/prechecks.rb +38 -0
  27. data/lib/operations/components/preconditions.rb +45 -0
  28. data/lib/operations/components.rb +5 -0
  29. data/lib/operations/configuration.rb +15 -0
  30. data/lib/operations/contract/messages_resolver.rb +11 -0
  31. data/lib/operations/contract.rb +39 -0
  32. data/lib/operations/convenience.rb +102 -0
  33. data/lib/operations/form/attribute.rb +42 -0
  34. data/lib/operations/form/builder.rb +85 -0
  35. data/lib/operations/form.rb +194 -0
  36. data/lib/operations/result.rb +122 -0
  37. data/lib/operations/test_helpers.rb +71 -0
  38. data/lib/operations/types.rb +6 -0
  39. data/lib/operations/version.rb +3 -1
  40. data/lib/operations.rb +42 -2
  41. data/operations.gemspec +20 -4
  42. metadata +164 -9
  43. data/.travis.yml +0 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cf740be1742fc1666c6f267de424b06a9425cb78fe089253a1d2a78925543df0
4
- data.tar.gz: d4c62d797221d7faa212546c65531b52ca4a870341e221b7f9d6dc8620416fa3
3
+ metadata.gz: dc7557987e49805062efa789a9ecc5b0344839b5f8217b9a59fbd6904246ec8f
4
+ data.tar.gz: 801b5edbde46dba2c005ef8bad826691ca00ce7adda5654d04f602406d15847f
5
5
  SHA512:
6
- metadata.gz: 204c0d86f57cab8870587d1b4609ce8a6fd2ee751137ccfb3b3f82f0351ec712fb31b1639e772d54e8f950e6a8c581462ba77ab0c0cf66a3b538dadb95c3f76d
7
- data.tar.gz: 11e6be8e4f42e2d6b8cbf43e1a4e6a316297d22002852ec0914f776222d42bb3372e8e0042a4fcd1d7f5ff46a94f2f09492335bcc9c33951bdbf853c3f61e6fa
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
@@ -9,3 +9,7 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+
13
+ .ruby-version
14
+ .ruby-gemset
15
+ Gemfile.lock
data/.rspec CHANGED
@@ -1,3 +1 @@
1
- --format documentation
2
- --color
3
1
  --require spec_helper
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
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ %w[5.2 6.0 6.1 7.0 7.1].each do |version|
4
+ appraise "rails.#{version}" do
5
+ gem "activerecord", "~> #{version}.0"
6
+ gem "activesupport", "~> #{version}.0"
7
+ end
8
+ end
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 "rake", "~> 12.0"
7
- gem "rspec", "~> 3.0"
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