pathway 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +10 -3
- data/Gemfile +1 -1
- data/lib/pathway.rb +10 -6
- data/lib/pathway/plugins/dry_validation.rb +1 -1
- data/lib/pathway/plugins/responder.rb +1 -1
- data/lib/pathway/plugins/sequel_models.rb +4 -2
- data/lib/pathway/version.rb +1 -1
- data/pathway.gemspec +1 -0
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d286f1d75ae6776baa9113bd4dae0da6f30685723173cee2a971a02d134223f6
|
4
|
+
data.tar.gz: ab88b4c578bde709d3dbeff0dd6e97f5f2da884cb9151a73303e08b9888f60a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41c27065b1bba5907eab6b00fc76799fa17f89a0d9e292e58b9eff2a1a06f8813a737c08ca5b13e5c8aad62a60442f8135c56df1b301b205ad6aeabe8f92189d
|
7
|
+
data.tar.gz: df7cc1e6293f27135cbfa25f0aed776afd637f62128182c1caaf961b08189ffc322f1e12beb8e572e68ab1624808a6549803559582d87d4a6870d52388054df4
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,16 @@
|
|
1
|
+
## [0.9.0] - 2019-04-01
|
2
|
+
### Changed
|
3
|
+
- Changed behavior for `:after_commit` step wrapper, on `:sequel_models` plugin, to capture current state and reuse it later when executing.
|
4
|
+
|
5
|
+
### Fixed
|
6
|
+
- Allow invoking `call` directly on an operation class even if the `:responder` plugin is not loaded.
|
7
|
+
|
1
8
|
## [0.8.0] - 2018-10-01
|
2
9
|
### Changed
|
3
10
|
- Added support for `dry-validation` 0.12.x
|
4
|
-
- Renamed DSL method `sequence` to `around`. Keep `sequence` as an alias although
|
11
|
+
- Renamed DSL method `sequence` to `around`. Keep `sequence` as an alias, although it may be deprecated on a future mayor release.
|
5
12
|
- Renamed DSL method `guard` to `if_true`. Keep `guard` as an alias, although it may be deprecated on a future mayor release.
|
6
|
-
- Added DSL method `if_false`, which behaves like `if_true` but checks the passed predicate is false instead.
|
13
|
+
- Added DSL method `if_false`, which behaves like `if_true` but checks if the passed predicate is false instead.
|
7
14
|
- Moved `Responder` class inside the `responder` plugin module.
|
8
15
|
|
9
16
|
## [0.7.0] - 2018-09-25
|
@@ -13,7 +20,7 @@
|
|
13
20
|
- Allow `authorization` block to take multiple parameters on `simple_auth` plugin.
|
14
21
|
|
15
22
|
## [0.6.2] - 2018-05-19
|
16
|
-
###
|
23
|
+
### Fixed
|
17
24
|
- Allow `:error_message` option for `sequel_models` plugin to propagate down inherited classes
|
18
25
|
|
19
26
|
## [0.6.1] - 2018-03-16
|
data/Gemfile
CHANGED
data/lib/pathway.rb
CHANGED
@@ -77,15 +77,20 @@ module Pathway
|
|
77
77
|
module Base
|
78
78
|
module ClassMethods
|
79
79
|
attr_accessor :result_key
|
80
|
+
alias :result_at :result_key=
|
80
81
|
|
81
82
|
def process(&bl)
|
82
83
|
dsl = self::DSL
|
83
84
|
define_method(:call) do |input|
|
84
|
-
dsl.new(self, input)
|
85
|
+
dsl.new(State.new(self, input: input), self)
|
86
|
+
.run(&bl)
|
87
|
+
.then(&:result)
|
85
88
|
end
|
86
89
|
end
|
87
90
|
|
88
|
-
|
91
|
+
def call(ctx, *params)
|
92
|
+
new(ctx).call(*params)
|
93
|
+
end
|
89
94
|
|
90
95
|
def inherited(subclass)
|
91
96
|
super
|
@@ -120,9 +125,8 @@ module Pathway
|
|
120
125
|
end
|
121
126
|
|
122
127
|
module DSLMethods
|
123
|
-
def initialize(
|
124
|
-
@result = wrap(
|
125
|
-
@operation = operation
|
128
|
+
def initialize(state, operation)
|
129
|
+
@result, @operation = wrap(state), operation
|
126
130
|
end
|
127
131
|
|
128
132
|
def run(&bl)
|
@@ -155,7 +159,7 @@ module Pathway
|
|
155
159
|
|
156
160
|
def around(wrapper, &steps)
|
157
161
|
@result.then do |state|
|
158
|
-
seq = -> { @result =
|
162
|
+
seq = -> (dsl = self) { @result = dsl.run(&steps) }
|
159
163
|
_callable(wrapper).call(seq, state)
|
160
164
|
end
|
161
165
|
end
|
@@ -76,7 +76,7 @@ module Pathway
|
|
76
76
|
operation.auto_wire_options = auto_wire_options
|
77
77
|
end
|
78
78
|
|
79
|
-
if
|
79
|
+
if Gem.loaded_specs['dry-validation'].version >= Gem::Version.new('0.12')
|
80
80
|
DefaultFormClass = Dry::Validation::Schema::Params
|
81
81
|
|
82
82
|
module ClassMethods
|
@@ -13,9 +13,11 @@ module Pathway
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def after_commit(&bl)
|
16
|
-
around(-> steps,
|
16
|
+
around(-> steps, state {
|
17
|
+
dsl = self.class::DSL.new(State.new(self, state.to_h.dup), self)
|
18
|
+
|
17
19
|
db.after_commit do
|
18
|
-
steps.call
|
20
|
+
steps.call(dsl)
|
19
21
|
end
|
20
22
|
}, &bl)
|
21
23
|
end
|
data/lib/pathway/version.rb
CHANGED
data/pathway.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pathway
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pablo Herrero
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-inflector
|
@@ -150,6 +150,20 @@ dependencies:
|
|
150
150
|
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: pry-doc
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
153
167
|
description: Define your business logic in simple steps.
|
154
168
|
email:
|
155
169
|
- pablodherrero@gmail.com
|
@@ -206,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
206
220
|
version: '0'
|
207
221
|
requirements: []
|
208
222
|
rubyforge_project:
|
209
|
-
rubygems_version: 2.
|
223
|
+
rubygems_version: 2.7.7
|
210
224
|
signing_key:
|
211
225
|
specification_version: 4
|
212
226
|
summary: Define your business logic in simple steps.
|