opera 0.2.13 → 0.2.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3365aa09cb2ec386142398fd3257d5f0e12f106380d08d7b53f3bbcaeb087d4
4
- data.tar.gz: 9d0f932f25e8db4d7d0df4d0494966916369b32d12b2939aa642ae8aa3a6a8b2
3
+ metadata.gz: da6a185f664746509764441abdce1f7ff3b429c0fac119e9442271fe1f19f357
4
+ data.tar.gz: 898591cfbf92efa85c9c8b3e2b69ee7ca958a3eda0029ac019ca85562f4e3db1
5
5
  SHA512:
6
- metadata.gz: 351a69889db7929d1ffe4954202e97ebfa84ec149dbcbdd680287be783451bde31302ad94586fc920a465b52519453027814997916fbf8082da7f305c5ed27bd
7
- data.tar.gz: 62d81144b0e09dd5fd43e09f00f1304d7802d1d38467018e7630edc64a1208b3bfa1be819ff8743db3c61ca0fceb16fcc6ca8dfaa56480b20963a09ed5571492
6
+ metadata.gz: a22fba3cca583d561f2dade3de23246293ca0acadcbf2f60ef5ab41efb6325a49addda52cb3948a12c74c07674a64289aa1e3e500014eb380fa2919648dfffd0
7
+ data.tar.gz: 2c74a116d21859c048f5c52eef2760806184d8793f569262e22a846ca11c5557f010005cf6e110197258a3f43d1d8fa62551c9ca3c80cd7624ef660d928c58c2
@@ -9,15 +9,12 @@ jobs:
9
9
  runs-on: ubuntu-latest
10
10
  strategy:
11
11
  matrix:
12
- ruby-version: [ '2.6', '2.7', '3.0' ]
12
+ ruby-version: [ '2.6', '2.7', '3.0', '3.2', 'jruby' ]
13
13
 
14
14
  steps:
15
- - uses: actions/checkout@v2
15
+ - uses: actions/checkout@v4
16
16
  - name: Set up Ruby
17
- # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
18
- # change this to (see https://github.com/ruby/setup-ruby#versioning):
19
- # uses: ruby/setup-ruby@v1
20
- uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
17
+ uses: ruby/setup-ruby@v1
21
18
  with:
22
19
  ruby-version: ${{ matrix.ruby-version }}
23
20
  bundler-cache: false # runs 'bundle install' and caches installed gems automatically
@@ -31,7 +28,7 @@ jobs:
31
28
  runs-on: ubuntu-latest
32
29
 
33
30
  steps:
34
- - uses: actions/checkout@v2
31
+ - uses: actions/checkout@v4
35
32
 
36
33
  - name: Tag automatically
37
34
  run: git tag v`cat lib/opera/version.rb | grep 'VERSION' | awk '{ print $3 $4 }' | sed "s/'//g"`
@@ -48,11 +45,11 @@ jobs:
48
45
  packages: write
49
46
 
50
47
  steps:
51
- - uses: actions/checkout@v2
52
- - name: Set up Ruby 2.6
53
- uses: actions/setup-ruby@v1
48
+ - uses: actions/checkout@v4
49
+ - name: Set up Ruby 3.2
50
+ uses: ruby/setup-ruby@v1
54
51
  with:
55
- ruby-version: 2.6.x
52
+ ruby-version: 3.2
56
53
 
57
54
  - name: Publish to RubyGems
58
55
  run: |
@@ -16,15 +16,12 @@ jobs:
16
16
  runs-on: ubuntu-latest
17
17
  strategy:
18
18
  matrix:
19
- ruby-version: ['2.6', '2.7', '3.0', 'jruby']
19
+ ruby-version: ['2.6', '2.7', '3.0', '3.2', 'jruby']
20
20
 
21
21
  steps:
22
- - uses: actions/checkout@v2
22
+ - uses: actions/checkout@v4
23
23
  - name: Set up Ruby
24
- # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
25
- # change this to (see https://github.com/ruby/setup-ruby#versioning):
26
- # uses: ruby/setup-ruby@v1
27
- uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
24
+ uses: ruby/setup-ruby@v1
28
25
  with:
29
26
  ruby-version: ${{ matrix.ruby-version }}
30
27
  bundler-cache: false # runs 'bundle install' and caches installed gems automatically
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Opera Changelog
2
2
 
3
+ ### 0.2.15 - September 4, 2023
4
+
5
+ - Make the Transaction executor work with the keyword arguments
6
+
7
+ ### 0.2.14 - April 25, 2023
8
+
9
+ - Added support for objects responding to `to_hash` method in error handling for easier integration with Rails.
10
+
3
11
  ### 0.2.13 - October 24, 2022
4
12
 
5
13
  - Avoid return inside transaction block to support activegraph with jruby
data/Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM ruby:3
1
+ FROM ruby:3.2
2
2
 
3
3
  MAINTAINER ProFinda Developers <dev@profinda.com>
4
4
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- opera (0.2.11)
4
+ opera (0.2.15)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -77,6 +77,7 @@ DEPENDENCIES
77
77
  dry-validation
78
78
  opera!
79
79
  pry-byebug
80
+ pry-nav
80
81
  rake (~> 12.0)
81
82
  rspec (~> 3.0)
82
83
 
@@ -8,8 +8,7 @@ module Opera
8
8
  class RollbackTransactionError < Opera::Error; end
9
9
 
10
10
  def call(instruction)
11
- arguments = transaction_options ? [transaction_method, transaction_options] : [transaction_method]
12
- transaction_class.send(*arguments) do
11
+ transaction_wrapper do
13
12
  super
14
13
 
15
14
  raise(transaction_error) if result.failure?
@@ -18,6 +17,12 @@ module Opera
18
17
  nil
19
18
  end
20
19
 
20
+ def transaction_wrapper
21
+ return transaction_class.send(transaction_method) { yield } unless transaction_options
22
+
23
+ transaction_class.send(transaction_method, **transaction_options) { yield }
24
+ end
25
+
21
26
  def transaction_class
22
27
  config.transaction_class
23
28
  end
@@ -49,7 +49,7 @@ module Opera
49
49
  # rubocop:enable Metrics/MethodLength
50
50
 
51
51
  def add_errors(errors)
52
- errors.to_h.each_pair do |key, value|
52
+ errors.to_hash.each_pair do |key, value|
53
53
  add_error(key, value)
54
54
  end
55
55
  end
data/lib/opera/version.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Opera
2
- VERSION = '0.2.13'
4
+ VERSION = '0.2.15'
3
5
  end
data/lib/opera.rb CHANGED
@@ -1,5 +1,6 @@
1
- require 'opera/version'
1
+ # frozen_string_literal: true
2
2
 
3
+ require 'opera/version'
3
4
  require 'opera/errors'
4
5
  require 'opera/operation'
5
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opera
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.13
4
+ version: 0.2.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - ProFinda Development Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-24 00:00:00.000000000 Z
11
+ date: 2023-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-validation
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
117
  requirements: []
118
- rubygems_version: 3.0.3.1
118
+ rubygems_version: 3.4.10
119
119
  signing_key:
120
120
  specification_version: 4
121
121
  summary: Use simple DSL language to keep your Operations clean and maintainable