trailblazer-operation 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YWZkYzZlMjRkOGZkM2RlYzNiMmY2NGE1MjY3YTA2NTk0YWExNDNkYw==
5
- data.tar.gz: !binary |-
6
- ZTU3MGVjODM2NjdjNTQ4YmRjMDM1YmMxOGViNGYxMTg3MTY2ZGVjMw==
2
+ SHA1:
3
+ metadata.gz: d379cb34eaae932a9888c234de9f852e4793f035
4
+ data.tar.gz: a3ff9e0af8fe676ea60713c7c6946efdad2c3863
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- YzgzNDY1YjhhNmZjMmJiYjBjYzEyNTRlMTY1ODYyZGVhOTFjYjQyZTY5ZDMy
10
- ZGEzY2UwNWFkZWYyMjE0ODMwMWI2NjllYTU2NTAwOTZkN2IwNmJkMjA2ZTcw
11
- MjA2MWIzY2IxZDFiNmQ5OTVmY2NkNWY2ZTM0ZGE4ZDJkN2FiYTQ=
12
- data.tar.gz: !binary |-
13
- NjE1ODZhMDI4YWM1MjZjZDY0NDhlMWZiN2ZkNWUzZmJkMTFhMTBkMzA2YzM3
14
- YjgxZGE3NmMzNjE0YjZjYmFlZWUyMmFmYjEwOTE3NDc0OWVkMTIzNWI3ODc5
15
- ODNlY2QzMmVhMDNlYTEzYzA3Nzc2NzdlYTA5NTM0NmFmZTE3OGI=
6
+ metadata.gz: e1f26f8663297e30f8bd36893d8d853c15232841eb47f36e265683b787203672f714af0ae84096da7a3ec75f91ed4427fadce578a4ee31333d3377dd631e81c0
7
+ data.tar.gz: 7be6cb8f3e07df31a64c3f3b9e2f11cfc4be6a020641b0cf0a4bf0ecccb654dbd92845fce8f015cc28575e7fe67056d465fd54fffb56c3dc310497b41217a408
data/CHANGES.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## 0.0.9
2
+
3
+ Removing `Operation::consider`, which is now `step`.
4
+ We now have three methods, only.
5
+
6
+ * `step` import macro or add step with the & operator, meaning its result is always evaluated and
7
+ decides about left or right.
8
+ * `success` always adds to right track.
9
+ * `failure` always adds to left track.
10
+
11
+ This was heavily inspired by a discussion with @dnd, so, thanks! 🍻
12
+
1
13
  ## 0.0.8
2
14
 
3
15
  * Introduce a new keyword signature for steps:
@@ -58,7 +58,6 @@ class Trailblazer::Operation
58
58
  end
59
59
 
60
60
  alias_method :step, :|
61
- alias_method :consider, :&
62
61
  alias_method :failure, :<
63
62
  alias_method :success, :>
64
63
  alias_method :override, :|
@@ -93,7 +92,8 @@ class Trailblazer::Operation
93
92
 
94
93
  # note: does not calls heritage.record
95
94
  def self.import(operation, pipe, cfg, user_options={})
96
- return insert(pipe, :>, cfg, user_options, {}) unless cfg.is_a?(Array)
95
+ # a normal step is added as "consider"/"may deviate", so its result matters.
96
+ return insert(pipe, :&, cfg, user_options, {}) unless cfg.is_a?(Array)
97
97
 
98
98
  # e.g. from Contract::Validate
99
99
  mod, args, block = cfg
@@ -1,5 +1,5 @@
1
1
  module Trailblazer
2
2
  class Operation
3
- VERSION = "0.0.8"
3
+ VERSION = "0.0.9"
4
4
  end
5
5
  end
@@ -2,9 +2,9 @@ require "test_helper"
2
2
 
3
3
  class Ruby200PipetreeTest < Minitest::Spec
4
4
  class Create < Trailblazer::Operation
5
- consider ->(*, params:, **) { params["run"] } # only test kws.
6
- step ->(options, params:nil, **) { options["x"] = params["run"] } # read and write.
7
- step ->(options) { options["y"] = options["params"]["run"] } # old API.
5
+ step ->(*, params:, **) { params["run"] } # only test kws.
6
+ step ->(options, params:nil, **) { options["x"] = params["run"] } # read and write.
7
+ step ->(options) { options["y"] = options["params"]["run"] } # old API.
8
8
  end
9
9
 
10
10
  it { Create.("run" => false).inspect("x", "y").must_equal %{<Result:false [nil, nil] >} }
@@ -12,9 +12,9 @@ class Ruby200PipetreeTest < Minitest::Spec
12
12
 
13
13
  #- instance methods
14
14
  class Update < Trailblazer::Operation
15
- consider :params! # only test kws.
16
- step :x! # read and write.
17
- step :y! # old API.
15
+ step :params! # only test kws.
16
+ step :x! # read and write.
17
+ step :y! # old API.
18
18
 
19
19
  def params!(*, params:, **)
20
20
  params["run"]
@@ -55,9 +55,9 @@ class Ruby200PipetreeTest < Minitest::Spec
55
55
  end
56
56
  end
57
57
 
58
- consider Params
59
- step X
60
- step Y
58
+ step Params
59
+ step X
60
+ step Y
61
61
  end
62
62
 
63
63
  it { Delete.("run" => false).inspect("x", "y").must_equal %{<Result:false [nil, nil] >} }
metadata CHANGED
@@ -1,109 +1,109 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trailblazer-operation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sutterer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-12 00:00:00.000000000 Z
11
+ date: 2016-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: uber
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.1.0
20
- - - <
20
+ - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 0.2.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - ! '>='
27
+ - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: 0.1.0
30
- - - <
30
+ - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 0.2.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: declarative
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - ! '>='
37
+ - - ">="
38
38
  - !ruby/object:Gem::Version
39
39
  version: '0'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - ! '>='
44
+ - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: pipetree
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - ! '>='
51
+ - - ">="
52
52
  - !ruby/object:Gem::Version
53
53
  version: 0.0.5
54
- - - <
54
+ - - "<"
55
55
  - !ruby/object:Gem::Version
56
56
  version: 0.1.0
57
57
  type: :runtime
58
58
  prerelease: false
59
59
  version_requirements: !ruby/object:Gem::Requirement
60
60
  requirements:
61
- - - ! '>='
61
+ - - ">="
62
62
  - !ruby/object:Gem::Version
63
63
  version: 0.0.5
64
- - - <
64
+ - - "<"
65
65
  - !ruby/object:Gem::Version
66
66
  version: 0.1.0
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: bundler
69
69
  requirement: !ruby/object:Gem::Requirement
70
70
  requirements:
71
- - - ! '>='
71
+ - - ">="
72
72
  - !ruby/object:Gem::Version
73
73
  version: '0'
74
74
  type: :development
75
75
  prerelease: false
76
76
  version_requirements: !ruby/object:Gem::Requirement
77
77
  requirements:
78
- - - ! '>='
78
+ - - ">="
79
79
  - !ruby/object:Gem::Version
80
80
  version: '0'
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: rake
83
83
  requirement: !ruby/object:Gem::Requirement
84
84
  requirements:
85
- - - ! '>='
85
+ - - ">="
86
86
  - !ruby/object:Gem::Version
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
90
  version_requirements: !ruby/object:Gem::Requirement
91
91
  requirements:
92
- - - ! '>='
92
+ - - ">="
93
93
  - !ruby/object:Gem::Version
94
94
  version: '0'
95
95
  - !ruby/object:Gem::Dependency
96
96
  name: minitest
97
97
  requirement: !ruby/object:Gem::Requirement
98
98
  requirements:
99
- - - ! '>='
99
+ - - ">="
100
100
  - !ruby/object:Gem::Version
101
101
  version: '0'
102
102
  type: :development
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
105
105
  requirements:
106
- - - ! '>='
106
+ - - ">="
107
107
  - !ruby/object:Gem::Version
108
108
  version: '0'
109
109
  description: Trailblazer's operation object.
@@ -113,8 +113,8 @@ executables: []
113
113
  extensions: []
114
114
  extra_rdoc_files: []
115
115
  files:
116
- - .gitignore
117
- - .travis.yml
116
+ - ".gitignore"
117
+ - ".travis.yml"
118
118
  - CHANGES.md
119
119
  - Gemfile
120
120
  - README.md
@@ -153,17 +153,17 @@ require_paths:
153
153
  - lib
154
154
  required_ruby_version: !ruby/object:Gem::Requirement
155
155
  requirements:
156
- - - ! '>='
156
+ - - ">="
157
157
  - !ruby/object:Gem::Version
158
158
  version: 1.9.3
159
159
  required_rubygems_version: !ruby/object:Gem::Requirement
160
160
  requirements:
161
- - - ! '>='
161
+ - - ">="
162
162
  - !ruby/object:Gem::Version
163
163
  version: '0'
164
164
  requirements: []
165
165
  rubyforge_project:
166
- rubygems_version: 2.4.8
166
+ rubygems_version: 2.6.3
167
167
  signing_key:
168
168
  specification_version: 4
169
169
  summary: Trailblazer's operation object with dependency management and pipetree flow.