nxt_pipeline 2.0.0 → 2.1.0
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 +24 -0
- data/.ruby-version +1 -1
- data/.tool-versions +1 -0
- data/CHANGELOG.md +11 -0
- data/Gemfile +0 -6
- data/Gemfile.lock +80 -63
- data/lib/nxt_pipeline/pipeline.rb +36 -45
- data/lib/nxt_pipeline/step.rb +19 -12
- data/lib/nxt_pipeline/version.rb +1 -2
- data/nxt_pipeline.gemspec +4 -3
- metadata +7 -25
- data/.circleci/config.yml +0 -56
- data/.travis.yml +0 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5816d8436b227a42c336d22b0b102e50e292c013ab670f65afb41a02dd76c822
|
|
4
|
+
data.tar.gz: '081d80224f1dbff6c33b688e252f2835eeee2931f0c5cd937bffbe284bdfa175'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 30d6d355074b18483ef81457246a2f4121d3976aa227fb95e7e42f6ecf6733d00044686feb751859cf8e573785256f1526b185e8f7be611fccb6ddb104d1ff5a
|
|
7
|
+
data.tar.gz: 130b81f44d9e48174926e5906261a061ac50055e54f55bd3bf11b275a6d33d240de7a1a368ac5af63f37619cffabecf5e376d78cc0bd917b5197cb13317403aa
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
tests:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
strategy:
|
|
15
|
+
fail-fast: false
|
|
16
|
+
matrix:
|
|
17
|
+
ruby-version: ["3.3", "3.4", "4.0"]
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v6
|
|
20
|
+
- uses: ruby/setup-ruby@v1
|
|
21
|
+
with:
|
|
22
|
+
ruby-version: ${{ matrix.ruby-version }}
|
|
23
|
+
bundler-cache: true
|
|
24
|
+
- run: bundle exec rspec
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
4.0.1
|
data/.tool-versions
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ruby 4.0.1
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## nxt_pipeline 2.1.0 (16.03.2026)
|
|
2
|
+
|
|
3
|
+
- Migrate CI from CircleCI/Travis to GitHub Actions (matrix: Ruby 3.3, 3.4, 4.0)
|
|
4
|
+
- Add `required_ruby_version >= 3.3` to gemspec
|
|
5
|
+
- Update bundler 2.1.4 → 4.0.8, replace pry-byebug with pry, drop guard-rspec
|
|
6
|
+
- Remove rspec_junit_formatter (CircleCI-only dependency)
|
|
7
|
+
- Replace `OpenStruct` with `Data.define` in error details (removed from Ruby 4.0 stdlib)
|
|
8
|
+
- Fix Ruby 4.0 strict kwargs separation in `Step#execute_callable`
|
|
9
|
+
- Make `Pipeline#step` argument optional (fixes kwargs-only calls under Ruby 4.0)
|
|
10
|
+
- Rename default branch master → main
|
|
11
|
+
|
|
1
12
|
## nxt_pipeline 2.0.0 (10.05.2022)
|
|
2
13
|
|
|
3
14
|
- Rename `Pipeline.execute` to `Pipeline.call`
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,93 +1,110 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
nxt_pipeline (2.
|
|
4
|
+
nxt_pipeline (2.1.0)
|
|
5
5
|
activesupport
|
|
6
6
|
nxt_registry
|
|
7
7
|
|
|
8
8
|
GEM
|
|
9
9
|
remote: https://rubygems.org/
|
|
10
10
|
specs:
|
|
11
|
-
activesupport (
|
|
12
|
-
|
|
11
|
+
activesupport (8.1.2)
|
|
12
|
+
base64
|
|
13
|
+
bigdecimal
|
|
14
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
15
|
+
connection_pool (>= 2.2.5)
|
|
16
|
+
drb
|
|
13
17
|
i18n (>= 1.6, < 2)
|
|
18
|
+
json
|
|
19
|
+
logger (>= 1.4.2)
|
|
14
20
|
minitest (>= 5.1)
|
|
15
|
-
|
|
16
|
-
|
|
21
|
+
securerandom (>= 0.3)
|
|
22
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
|
23
|
+
uri (>= 0.13.1)
|
|
24
|
+
base64 (0.3.0)
|
|
25
|
+
bigdecimal (4.0.1)
|
|
17
26
|
coderay (1.1.3)
|
|
18
|
-
concurrent-ruby (1.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
formatador (>= 0.2.4)
|
|
24
|
-
listen (>= 2.7, < 4.0)
|
|
25
|
-
lumberjack (>= 1.0.12, < 2.0)
|
|
26
|
-
nenv (~> 0.1)
|
|
27
|
-
notiffany (~> 0.0)
|
|
28
|
-
pry (>= 0.13.0)
|
|
29
|
-
shellany (~> 0.0)
|
|
30
|
-
thor (>= 0.18.1)
|
|
31
|
-
guard-compat (1.2.1)
|
|
32
|
-
guard-rspec (4.7.3)
|
|
33
|
-
guard (~> 2.1)
|
|
34
|
-
guard-compat (~> 1.1)
|
|
35
|
-
rspec (>= 2.99.0, < 4.0)
|
|
36
|
-
i18n (1.10.0)
|
|
27
|
+
concurrent-ruby (1.3.6)
|
|
28
|
+
connection_pool (3.0.2)
|
|
29
|
+
diff-lcs (1.6.2)
|
|
30
|
+
drb (2.2.3)
|
|
31
|
+
i18n (1.14.8)
|
|
37
32
|
concurrent-ruby (~> 1.0)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
notiffany (0.1.3)
|
|
46
|
-
nenv (~> 0.1)
|
|
47
|
-
shellany (~> 0.0)
|
|
33
|
+
io-console (0.8.2)
|
|
34
|
+
json (2.19.1)
|
|
35
|
+
logger (1.7.0)
|
|
36
|
+
method_source (1.1.0)
|
|
37
|
+
minitest (6.0.2)
|
|
38
|
+
drb (~> 2.0)
|
|
39
|
+
prism (~> 1.5)
|
|
48
40
|
nxt_registry (0.3.10)
|
|
49
41
|
activesupport
|
|
50
|
-
|
|
42
|
+
prism (1.9.0)
|
|
43
|
+
pry (0.16.0)
|
|
51
44
|
coderay (~> 1.1)
|
|
52
45
|
method_source (~> 1.0)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
rspec-
|
|
63
|
-
|
|
64
|
-
rspec-core (3.11.0)
|
|
65
|
-
rspec-support (~> 3.11.0)
|
|
66
|
-
rspec-expectations (3.11.0)
|
|
46
|
+
reline (>= 0.6.0)
|
|
47
|
+
rake (13.3.1)
|
|
48
|
+
reline (0.6.3)
|
|
49
|
+
io-console (~> 0.5)
|
|
50
|
+
rspec (3.13.2)
|
|
51
|
+
rspec-core (~> 3.13.0)
|
|
52
|
+
rspec-expectations (~> 3.13.0)
|
|
53
|
+
rspec-mocks (~> 3.13.0)
|
|
54
|
+
rspec-core (3.13.6)
|
|
55
|
+
rspec-support (~> 3.13.0)
|
|
56
|
+
rspec-expectations (3.13.5)
|
|
67
57
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
68
|
-
rspec-support (~> 3.
|
|
69
|
-
rspec-mocks (3.
|
|
58
|
+
rspec-support (~> 3.13.0)
|
|
59
|
+
rspec-mocks (3.13.8)
|
|
70
60
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
71
|
-
rspec-support (~> 3.
|
|
72
|
-
rspec-support (3.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
shellany (0.0.1)
|
|
76
|
-
thor (1.2.1)
|
|
77
|
-
tzinfo (2.0.4)
|
|
61
|
+
rspec-support (~> 3.13.0)
|
|
62
|
+
rspec-support (3.13.7)
|
|
63
|
+
securerandom (0.4.1)
|
|
64
|
+
tzinfo (2.0.6)
|
|
78
65
|
concurrent-ruby (~> 1.0)
|
|
66
|
+
uri (1.1.1)
|
|
79
67
|
|
|
80
68
|
PLATFORMS
|
|
69
|
+
arm64-darwin-25
|
|
81
70
|
ruby
|
|
82
71
|
|
|
83
72
|
DEPENDENCIES
|
|
84
|
-
bundler
|
|
85
|
-
guard-rspec
|
|
73
|
+
bundler
|
|
86
74
|
nxt_pipeline!
|
|
87
|
-
pry
|
|
75
|
+
pry
|
|
88
76
|
rake (~> 13.0)
|
|
89
77
|
rspec (~> 3.0)
|
|
90
|
-
|
|
78
|
+
|
|
79
|
+
CHECKSUMS
|
|
80
|
+
activesupport (8.1.2) sha256=88842578ccd0d40f658289b0e8c842acfe9af751afee2e0744a7873f50b6fdae
|
|
81
|
+
base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
|
|
82
|
+
bigdecimal (4.0.1) sha256=8b07d3d065a9f921c80ceaea7c9d4ae596697295b584c296fe599dd0ad01c4a7
|
|
83
|
+
coderay (1.1.3) sha256=dc530018a4684512f8f38143cd2a096c9f02a1fc2459edcfe534787a7fc77d4b
|
|
84
|
+
concurrent-ruby (1.3.6) sha256=6b56837e1e7e5292f9864f34b69c5a2cbc75c0cf5338f1ce9903d10fa762d5ab
|
|
85
|
+
connection_pool (3.0.2) sha256=33fff5ba71a12d2aa26cb72b1db8bba2a1a01823559fb01d29eb74c286e62e0a
|
|
86
|
+
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
|
|
87
|
+
drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
|
|
88
|
+
i18n (1.14.8) sha256=285778639134865c5e0f6269e0b818256017e8cde89993fdfcbfb64d088824a5
|
|
89
|
+
io-console (0.8.2) sha256=d6e3ae7a7cc7574f4b8893b4fca2162e57a825b223a177b7afa236c5ef9814cc
|
|
90
|
+
json (2.19.1) sha256=dd94fdc59e48bff85913829a32350b3148156bc4fd2a95a2568a78b11344082d
|
|
91
|
+
logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
|
|
92
|
+
method_source (1.1.0) sha256=181301c9c45b731b4769bc81e8860e72f9161ad7d66dd99103c9ab84f560f5c5
|
|
93
|
+
minitest (6.0.2) sha256=db6e57956f6ecc6134683b4c87467d6dd792323c7f0eea7b93f66bd284adbc3d
|
|
94
|
+
nxt_pipeline (2.1.0)
|
|
95
|
+
nxt_registry (0.3.10) sha256=118eecd1690c3147db227fb0ba98fed2f73cfc70364d1e6691a895369aadd287
|
|
96
|
+
prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85
|
|
97
|
+
pry (0.16.0) sha256=d76c69065698ed1f85e717bd33d7942c38a50868f6b0673c636192b3d1b6054e
|
|
98
|
+
rake (13.3.1) sha256=8c9e89d09f66a26a01264e7e3480ec0607f0c497a861ef16063604b1b08eb19c
|
|
99
|
+
reline (0.6.3) sha256=1198b04973565b36ec0f11542ab3f5cfeeec34823f4e54cebde90968092b1835
|
|
100
|
+
rspec (3.13.2) sha256=206284a08ad798e61f86d7ca3e376718d52c0bc944626b2349266f239f820587
|
|
101
|
+
rspec-core (3.13.6) sha256=a8823c6411667b60a8bca135364351dda34cd55e44ff94c4be4633b37d828b2d
|
|
102
|
+
rspec-expectations (3.13.5) sha256=33a4d3a1d95060aea4c94e9f237030a8f9eae5615e9bd85718fe3a09e4b58836
|
|
103
|
+
rspec-mocks (3.13.8) sha256=086ad3d3d17533f4237643de0b5c42f04b66348c28bf6b9c2d3f4a3b01af1d47
|
|
104
|
+
rspec-support (3.13.7) sha256=0640e5570872aafefd79867901deeeeb40b0c9875a36b983d85f54fb7381c47c
|
|
105
|
+
securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
|
|
106
|
+
tzinfo (2.0.6) sha256=8daf828cc77bcf7d63b0e3bdb6caa47e2272dcfaf4fbfe46f8c3a9df087a829b
|
|
107
|
+
uri (1.1.1) sha256=379fa58d27ffb1387eaada68c749d1426738bd0f654d812fcc07e7568f5c57c6
|
|
91
108
|
|
|
92
109
|
BUNDLED WITH
|
|
93
|
-
|
|
110
|
+
4.0.8
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module NxtPipeline
|
|
2
2
|
class Pipeline
|
|
3
3
|
def self.call(acc, configuration: nil, resolvers: [], &block)
|
|
4
|
-
new(configuration
|
|
4
|
+
new(configuration:, resolvers:, &block).call(acc)
|
|
5
5
|
end
|
|
6
6
|
|
|
7
7
|
def initialize(configuration: nil, resolvers: [], &block)
|
|
@@ -23,7 +23,7 @@ module NxtPipeline
|
|
|
23
23
|
configure(&block) if block_given?
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
alias configure tap
|
|
27
27
|
|
|
28
28
|
attr_accessor :logger
|
|
29
29
|
attr_reader :result
|
|
@@ -35,6 +35,7 @@ module NxtPipeline
|
|
|
35
35
|
constructors[name] = constructor
|
|
36
36
|
|
|
37
37
|
return unless default
|
|
38
|
+
|
|
38
39
|
set_default_constructor(name)
|
|
39
40
|
end
|
|
40
41
|
|
|
@@ -62,7 +63,7 @@ module NxtPipeline
|
|
|
62
63
|
elsif arguments.size == 2
|
|
63
64
|
step(arguments.first, **arguments.second)
|
|
64
65
|
else
|
|
65
|
-
raise ArgumentError,
|
|
66
|
+
raise ArgumentError, 'Either pass a single argument or an argument and options'
|
|
66
67
|
end
|
|
67
68
|
end
|
|
68
69
|
end
|
|
@@ -74,25 +75,21 @@ module NxtPipeline
|
|
|
74
75
|
steps(steps)
|
|
75
76
|
end
|
|
76
77
|
|
|
77
|
-
def step(argument, constructor: nil, **opts, &block)
|
|
78
|
-
|
|
78
|
+
def step(argument = nil, constructor: nil, **opts, &block)
|
|
79
79
|
if constructor.present? and block_given?
|
|
80
|
-
msg =
|
|
80
|
+
msg = 'Either specify a block or a constructor but not both at the same time!'
|
|
81
81
|
raise ArgumentError, msg
|
|
82
82
|
end
|
|
83
83
|
|
|
84
84
|
to_s = if opts[:to_s].present?
|
|
85
85
|
opts[:to_s] = opts[:to_s].to_s
|
|
86
|
+
elsif argument.is_a?(Proc) || argument.is_a?(Method)
|
|
87
|
+
steps.count.to_s
|
|
86
88
|
else
|
|
87
|
-
|
|
88
|
-
steps.count.to_s
|
|
89
|
-
else
|
|
90
|
-
argument.to_s
|
|
91
|
-
end
|
|
89
|
+
argument.to_s
|
|
92
90
|
end
|
|
93
91
|
|
|
94
|
-
|
|
95
|
-
opts.reverse_merge!(to_s: to_s)
|
|
92
|
+
opts.reverse_merge!(to_s:)
|
|
96
93
|
|
|
97
94
|
if constructor.present?
|
|
98
95
|
# p.step Service, constructor: ->(step, **changes) { ... }
|
|
@@ -100,9 +97,9 @@ module NxtPipeline
|
|
|
100
97
|
resolved_constructor = constructor
|
|
101
98
|
else
|
|
102
99
|
# p.step Service, constructor: :service
|
|
103
|
-
resolved_constructor = constructors.fetch(constructor)
|
|
100
|
+
resolved_constructor = constructors.fetch(constructor) do
|
|
104
101
|
::NxtPipeline.constructor(constructor) || (raise ArgumentError, "No constructor defined for #{constructor}")
|
|
105
|
-
|
|
102
|
+
end
|
|
106
103
|
end
|
|
107
104
|
elsif block_given?
|
|
108
105
|
# p.step :inline do ... end
|
|
@@ -116,15 +113,14 @@ module NxtPipeline
|
|
|
116
113
|
end.find(&:itself)
|
|
117
114
|
|
|
118
115
|
# resolved constructor is a proc
|
|
119
|
-
if constructor_from_resolvers.is_a?(Proc)
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
116
|
+
resolved_constructor = if constructor_from_resolvers.is_a?(Proc)
|
|
117
|
+
constructor_from_resolvers
|
|
118
|
+
elsif constructor_from_resolvers.present?
|
|
119
|
+
constructors[constructor_from_resolvers]
|
|
120
|
+
else
|
|
121
|
+
# try to resolve constructor by argument --> #TODO: Is this a good idea?
|
|
122
|
+
constructors[argument]
|
|
123
|
+
end
|
|
128
124
|
|
|
129
125
|
# if still no constructor resolved
|
|
130
126
|
unless resolved_constructor.present?
|
|
@@ -153,17 +149,17 @@ module NxtPipeline
|
|
|
153
149
|
self.result = callbacks.around :execution, acc do
|
|
154
150
|
steps.inject(acc) do |changes, step|
|
|
155
151
|
self.result = call_step(step, changes)
|
|
156
|
-
rescue StandardError =>
|
|
157
|
-
decorate_error_with_details(
|
|
158
|
-
handle_error_of_step(step,
|
|
152
|
+
rescue StandardError => e
|
|
153
|
+
decorate_error_with_details(e, changes, step, logger)
|
|
154
|
+
handle_error_of_step(step, e)
|
|
159
155
|
result
|
|
160
156
|
end
|
|
161
157
|
end
|
|
162
158
|
|
|
163
159
|
# callbacks.run(:after, :execution, result) TODO: Better pass result to callback?
|
|
164
160
|
self.result = callbacks.run(:after, :execution, acc) || result
|
|
165
|
-
rescue StandardError =>
|
|
166
|
-
handle_step_error(
|
|
161
|
+
rescue StandardError => e
|
|
162
|
+
handle_step_error(e)
|
|
167
163
|
end
|
|
168
164
|
|
|
169
165
|
def handle_step_error(error)
|
|
@@ -179,42 +175,41 @@ module NxtPipeline
|
|
|
179
175
|
error_callbacks << ErrorCallback.new(errors, halt_on_error, &callback)
|
|
180
176
|
end
|
|
181
177
|
|
|
182
|
-
alias
|
|
178
|
+
alias on_error on_errors
|
|
183
179
|
|
|
184
180
|
def before_step(&block)
|
|
185
|
-
callbacks.register([
|
|
181
|
+
callbacks.register(%i[before step], block)
|
|
186
182
|
end
|
|
187
183
|
|
|
188
184
|
def after_step(&block)
|
|
189
|
-
callbacks.register([
|
|
185
|
+
callbacks.register(%i[after step], block)
|
|
190
186
|
end
|
|
191
187
|
|
|
192
188
|
def around_step(&block)
|
|
193
|
-
callbacks.register([
|
|
189
|
+
callbacks.register(%i[around step], block)
|
|
194
190
|
end
|
|
195
191
|
|
|
196
192
|
def before_execution(&block)
|
|
197
|
-
callbacks.register([
|
|
193
|
+
callbacks.register(%i[before execution], block)
|
|
198
194
|
end
|
|
199
195
|
|
|
200
196
|
def after_execution(&block)
|
|
201
|
-
callbacks.register([
|
|
197
|
+
callbacks.register(%i[after execution], block)
|
|
202
198
|
end
|
|
203
199
|
|
|
204
200
|
def around_execution(&block)
|
|
205
|
-
callbacks.register([
|
|
201
|
+
callbacks.register(%i[around execution], block)
|
|
206
202
|
end
|
|
207
203
|
|
|
208
204
|
private
|
|
209
205
|
|
|
210
|
-
attr_writer :result
|
|
206
|
+
attr_writer :result, :default_constructor_name
|
|
211
207
|
|
|
212
208
|
def callbacks
|
|
213
209
|
@callbacks ||= NxtPipeline::Callbacks.new(pipeline: self)
|
|
214
210
|
end
|
|
215
211
|
|
|
216
212
|
attr_reader :error_callbacks, :constructors, :constructor_resolvers
|
|
217
|
-
attr_writer :default_constructor_name
|
|
218
213
|
attr_accessor :current_step, :current_arg
|
|
219
214
|
|
|
220
215
|
def default_constructor
|
|
@@ -246,15 +241,11 @@ module NxtPipeline
|
|
|
246
241
|
self.current_step = nil
|
|
247
242
|
end
|
|
248
243
|
|
|
244
|
+
ErrorDetails = Data.define(:change_set, :logger, :step)
|
|
249
245
|
|
|
250
246
|
def decorate_error_with_details(error, change_set, step, logger)
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
change_set: change_set,
|
|
254
|
-
logger: logger,
|
|
255
|
-
step: step
|
|
256
|
-
)
|
|
257
|
-
end
|
|
247
|
+
details = ErrorDetails.new(change_set:, logger:, step:)
|
|
248
|
+
error.define_singleton_method(:details) { details }
|
|
258
249
|
error
|
|
259
250
|
end
|
|
260
251
|
|
data/lib/nxt_pipeline/step.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
module NxtPipeline
|
|
2
2
|
class Step
|
|
3
|
-
RESERVED_OPTION_KEYS
|
|
3
|
+
RESERVED_OPTION_KEYS = %i[to_s unless if]
|
|
4
4
|
|
|
5
5
|
def initialize(argument, constructor, index, pipeline, callbacks, **opts)
|
|
6
6
|
@opts = opts.symbolize_keys
|
|
@@ -23,14 +23,14 @@ module NxtPipeline
|
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
attr_reader :argument,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
:result,
|
|
27
|
+
:execution_started_at,
|
|
28
|
+
:execution_finished_at,
|
|
29
|
+
:execution_duration,
|
|
30
|
+
:error,
|
|
31
|
+
:opts,
|
|
32
|
+
:index,
|
|
33
|
+
:mapped_options
|
|
34
34
|
|
|
35
35
|
attr_writer :to_s
|
|
36
36
|
attr_accessor :meta_data, :status
|
|
@@ -88,9 +88,16 @@ module NxtPipeline
|
|
|
88
88
|
end
|
|
89
89
|
|
|
90
90
|
def execute_callable(callable, args)
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
params = callable.parameters
|
|
92
|
+
has_keywords = params.any? { |type, _| %i[key keyreq].include?(type) }
|
|
93
|
+
has_positional = params.any? { |type, _| %i[req opt].include?(type) }
|
|
94
|
+
|
|
95
|
+
if has_keywords && !has_positional && args.first.is_a?(Hash)
|
|
96
|
+
callable.call(**args.first)
|
|
97
|
+
else
|
|
98
|
+
args = args.take(callable.arity) unless callable.arity.negative?
|
|
99
|
+
callable.call(*args)
|
|
100
|
+
end
|
|
94
101
|
end
|
|
95
102
|
|
|
96
103
|
def if_guard
|
data/lib/nxt_pipeline/version.rb
CHANGED
data/nxt_pipeline.gemspec
CHANGED
|
@@ -34,11 +34,12 @@ Gem::Specification.new do |spec|
|
|
|
34
34
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
35
35
|
spec.require_paths = ["lib"]
|
|
36
36
|
|
|
37
|
+
spec.required_ruby_version = ">= 3.3"
|
|
38
|
+
|
|
37
39
|
spec.add_dependency "activesupport"
|
|
38
40
|
spec.add_dependency "nxt_registry"
|
|
39
|
-
spec.add_development_dependency "bundler"
|
|
40
|
-
spec.add_development_dependency "guard-rspec"
|
|
41
|
+
spec.add_development_dependency "bundler"
|
|
41
42
|
spec.add_development_dependency "rake", "~> 13.0"
|
|
42
43
|
spec.add_development_dependency "rspec", "~> 3.0"
|
|
43
|
-
spec.add_development_dependency "pry
|
|
44
|
+
spec.add_development_dependency "pry"
|
|
44
45
|
end
|
metadata
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: nxt_pipeline
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nils Sommer
|
|
8
8
|
- Andreas Robecke
|
|
9
9
|
- Raphael Kallensee
|
|
10
|
-
autorequire:
|
|
11
10
|
bindir: exe
|
|
12
11
|
cert_chain: []
|
|
13
|
-
date:
|
|
12
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
14
13
|
dependencies:
|
|
15
14
|
- !ruby/object:Gem::Dependency
|
|
16
15
|
name: activesupport
|
|
@@ -42,20 +41,6 @@ dependencies:
|
|
|
42
41
|
version: '0'
|
|
43
42
|
- !ruby/object:Gem::Dependency
|
|
44
43
|
name: bundler
|
|
45
|
-
requirement: !ruby/object:Gem::Requirement
|
|
46
|
-
requirements:
|
|
47
|
-
- - "~>"
|
|
48
|
-
- !ruby/object:Gem::Version
|
|
49
|
-
version: '2.1'
|
|
50
|
-
type: :development
|
|
51
|
-
prerelease: false
|
|
52
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
53
|
-
requirements:
|
|
54
|
-
- - "~>"
|
|
55
|
-
- !ruby/object:Gem::Version
|
|
56
|
-
version: '2.1'
|
|
57
|
-
- !ruby/object:Gem::Dependency
|
|
58
|
-
name: guard-rspec
|
|
59
44
|
requirement: !ruby/object:Gem::Requirement
|
|
60
45
|
requirements:
|
|
61
46
|
- - ">="
|
|
@@ -97,7 +82,7 @@ dependencies:
|
|
|
97
82
|
- !ruby/object:Gem::Version
|
|
98
83
|
version: '3.0'
|
|
99
84
|
- !ruby/object:Gem::Dependency
|
|
100
|
-
name: pry
|
|
85
|
+
name: pry
|
|
101
86
|
requirement: !ruby/object:Gem::Requirement
|
|
102
87
|
requirements:
|
|
103
88
|
- - ">="
|
|
@@ -110,19 +95,18 @@ dependencies:
|
|
|
110
95
|
- - ">="
|
|
111
96
|
- !ruby/object:Gem::Version
|
|
112
97
|
version: '0'
|
|
113
|
-
description:
|
|
114
98
|
email:
|
|
115
99
|
- mail@nilssommer.de
|
|
116
100
|
executables: []
|
|
117
101
|
extensions: []
|
|
118
102
|
extra_rdoc_files: []
|
|
119
103
|
files:
|
|
120
|
-
- ".
|
|
104
|
+
- ".github/workflows/ci.yml"
|
|
121
105
|
- ".gitignore"
|
|
122
106
|
- ".pryrc"
|
|
123
107
|
- ".rspec"
|
|
124
108
|
- ".ruby-version"
|
|
125
|
-
- ".
|
|
109
|
+
- ".tool-versions"
|
|
126
110
|
- CHANGELOG.md
|
|
127
111
|
- Gemfile
|
|
128
112
|
- Gemfile.lock
|
|
@@ -149,7 +133,6 @@ metadata:
|
|
|
149
133
|
allowed_push_host: https://rubygems.org
|
|
150
134
|
homepage_uri: https://github.com/nxt-insurance/nxt_pipeline
|
|
151
135
|
source_code_uri: https://github.com/nxt-insurance/nxt_pipeline.git
|
|
152
|
-
post_install_message:
|
|
153
136
|
rdoc_options: []
|
|
154
137
|
require_paths:
|
|
155
138
|
- lib
|
|
@@ -157,15 +140,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
157
140
|
requirements:
|
|
158
141
|
- - ">="
|
|
159
142
|
- !ruby/object:Gem::Version
|
|
160
|
-
version: '
|
|
143
|
+
version: '3.3'
|
|
161
144
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
162
145
|
requirements:
|
|
163
146
|
- - ">="
|
|
164
147
|
- !ruby/object:Gem::Version
|
|
165
148
|
version: '0'
|
|
166
149
|
requirements: []
|
|
167
|
-
rubygems_version:
|
|
168
|
-
signing_key:
|
|
150
|
+
rubygems_version: 4.0.3
|
|
169
151
|
specification_version: 4
|
|
170
152
|
summary: DSL to build Pipeline with mountable Segments to process things.
|
|
171
153
|
test_files: []
|
data/.circleci/config.yml
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# Ruby CircleCI 2.0 configuration file
|
|
2
|
-
#
|
|
3
|
-
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
|
|
4
|
-
#
|
|
5
|
-
version: 2
|
|
6
|
-
jobs:
|
|
7
|
-
build:
|
|
8
|
-
docker:
|
|
9
|
-
# specify the version you desire here
|
|
10
|
-
- image: circleci/ruby:2.7.0-node
|
|
11
|
-
environment:
|
|
12
|
-
BUNDLER_VERSION: 2.1.4
|
|
13
|
-
|
|
14
|
-
working_directory: ~/repo
|
|
15
|
-
|
|
16
|
-
steps:
|
|
17
|
-
- checkout
|
|
18
|
-
|
|
19
|
-
# Download and cache dependencies
|
|
20
|
-
- restore_cache:
|
|
21
|
-
keys:
|
|
22
|
-
- v1-dependencies-{{ checksum "Gemfile.lock" }}
|
|
23
|
-
|
|
24
|
-
- run: gem install bundler --version $BUNDLER_VERSION
|
|
25
|
-
|
|
26
|
-
- run:
|
|
27
|
-
name: install dependencies
|
|
28
|
-
command: |
|
|
29
|
-
bundle install --jobs=4 --retry=3 --path vendor/bundle
|
|
30
|
-
|
|
31
|
-
- save_cache:
|
|
32
|
-
paths:
|
|
33
|
-
- ./vendor/bundle
|
|
34
|
-
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
|
|
35
|
-
|
|
36
|
-
# run tests!
|
|
37
|
-
- run:
|
|
38
|
-
name: run tests
|
|
39
|
-
command: |
|
|
40
|
-
mkdir /tmp/test-results
|
|
41
|
-
TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | \
|
|
42
|
-
circleci tests split --split-by=timings)"
|
|
43
|
-
|
|
44
|
-
bundle exec rspec \
|
|
45
|
-
--format progress \
|
|
46
|
-
--format RspecJunitFormatter \
|
|
47
|
-
--out /tmp/test-results/rspec.xml \
|
|
48
|
-
--format progress \
|
|
49
|
-
$TEST_FILES
|
|
50
|
-
|
|
51
|
-
# collect reports
|
|
52
|
-
- store_test_results:
|
|
53
|
-
path: /tmp/test-results
|
|
54
|
-
- store_artifacts:
|
|
55
|
-
path: /tmp/test-results
|
|
56
|
-
destination: test-results
|