trailblazer-macro 2.1.0.beta4 → 2.1.0.beta6

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: 54ea3a5f8a3ac3510dbb5d2b3784a9c5218f0a8b52d7949eed340c4ca2b3e60f
4
- data.tar.gz: f52e3036bbe026fe87d40521caad3a74edc54330857aacfe89d5ac7fdac81ed2
3
+ metadata.gz: 00614cb0bcb127cf89ff6c1e199fa6fc8f080ac7492a41155adfb9c90a4b55bd
4
+ data.tar.gz: 84d68e15a27452b1833679ff80f898f3158f908222ed2aa6a8fa288dc22b474d
5
5
  SHA512:
6
- metadata.gz: ef37c64abde92f3216c31505bb84a5d83e56ef40271a8ec729acbca9ae982d60a8dc81b0ddaa447588b60d7260669d056a3646414603156f37abb3c09f4767ed
7
- data.tar.gz: 0e9bfe23cd682728fb5b40bde817b16615c2073f0698dddddbf385db91ddc029be199de0d01bc7343f7d821c4df9b99ff3cf43ffb1354d721f9fa90c98180f8a
6
+ metadata.gz: c348fb564c7d873c716886c4764a7297d654acb1f31bfadc3568e5b2110ad01a3d6f12ade831db98c4ceae9e44a7fcd02a29ed8ab0aea533a6a546ab344d16f8
7
+ data.tar.gz: cc6be5f0b0b0ec3f5499dcfaaa846e4ef0d9afb8aa818e7ccaf02798a997f0b796d396acd2de05be4a1f7de16e4da975f603cf1a9e859e4c6d8523575c8c38dc
data/CHANGES.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 2.1.0.beta6
2
+
3
+ * Use newest operation.
4
+
5
+ # 2.1.0.beta5
6
+
1
7
  # 2.1.0.beta4
2
8
 
3
9
  * New operation version.
data/Gemfile CHANGED
@@ -4,11 +4,10 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  # gem "trailblazer", github: "trailblazer/trailblazer"
7
+ # gem "trailblazer-activity", path: "../trailblazer-activity"
7
8
  # gem "trailblazer-operation", path: "../operation"
8
- # gem "trailblazer-operation", github: "trailblazer/trailblazer-operation"
9
- gem "trailblazer-activity"#, github: "trailblazer/trailblazer-activity"
9
+ # gem "trailblazer-activity"#, github: "trailblazer/trailblazer-activity"
10
10
  # gem "trailblazer-macro-contract", git: "https://github.com/trailblazer/trailblazer-macro-contract"
11
- gem "trailblazer-macro-contract", path: "../trailblazer-macro-contract"
12
11
 
13
12
  gem "minitest-line"
14
13
  gem "rubocop", require: false
@@ -0,0 +1,2 @@
1
+ require "trailblazer/macro/version"
2
+ require "trailblazer/macro"
@@ -1,4 +1,3 @@
1
- require "trailblazer/macro/version"
2
1
  require "trailblazer/operation"
3
2
 
4
3
  require "trailblazer/operation/inject"
@@ -1,5 +1,5 @@
1
1
  module Trailblazer
2
2
  module Macro
3
- VERSION = "2.1.0.beta4"
3
+ VERSION = "2.1.0.beta6".freeze
4
4
  end
5
5
  end
@@ -10,7 +10,7 @@ class Trailblazer::Operation
10
10
  )
11
11
  )
12
12
 
13
- { task: task, id: "model.build", extension: [extension] }
13
+ { task: task, id: "model.build", Trailblazer::Activity::DSL::Extension.new(extension) => true }
14
14
  end
15
15
 
16
16
  class Model
@@ -27,7 +27,7 @@ class Trailblazer::Operation
27
27
  action = options["model.action"] || :new
28
28
  model_class = options["model.class"]
29
29
  find_by_key = options["model.find_by_key"] || :id
30
- action = :pass_through unless %i[new find_by find].include?(action)
30
+ action = :pass_through unless %i[new find_by].include?(action)
31
31
 
32
32
  send("#{action}!", model_class, params, options["model.action"], find_by_key)
33
33
  end
@@ -36,18 +36,14 @@ class Trailblazer::Operation
36
36
  model_class.new
37
37
  end
38
38
 
39
- def find!(model_class, params, *)
40
- model_class.find(params[:id])
41
- end
42
-
43
39
  # Doesn't throw an exception and will return false to divert to Left.
44
40
  def find_by!(model_class, params, action, find_by_key, *)
45
41
  model_class.find_by(find_by_key.to_sym => params[find_by_key])
46
42
  end
47
43
 
48
- # Call any method on the model class and pass :id.
49
- def pass_through!(model_class, params, action, *)
50
- model_class.send(action, params[:id])
44
+ # Call any method on the model class and pass find_by_key, for example find(params[:id]).
45
+ def pass_through!(model_class, params, action, find_by_key, *)
46
+ model_class.send(action, params[find_by_key])
51
47
  end
52
48
  end
53
49
  end
@@ -22,7 +22,7 @@ module Trailblazer
22
22
  {
23
23
  task: task,
24
24
  id: id,
25
- extension: [Trailblazer::Activity::TaskWrap::Merge.new(task_wrap_extensions)],
25
+ Trailblazer::Activity::DSL::Extension.new(Trailblazer::Activity::TaskWrap::Merge.new(task_wrap_extensions)) => true,
26
26
  outputs: operation.outputs
27
27
  }
28
28
  end
@@ -36,7 +36,7 @@ module Trailblazer
36
36
  # The returned {Nested} instance is a valid circuit element and will be `call`ed in the circuit.
37
37
  # It simply returns the nested activity's `signal,options,flow_options` return set.
38
38
  # The actual wiring - where to go with that - is done by the step DSL.
39
- return Trailblazer::Operation::Callable(nested_operation, call: :__call__), nested_operation, false
39
+ return nested_operation, nested_operation, false
40
40
  end
41
41
 
42
42
  def self.nestable_object?(object)
@@ -71,7 +71,7 @@ module Trailblazer
71
71
 
72
72
  # Overwrite :task so task_wrap.call_task will call this activity.
73
73
  # This is a trick so we don't have to repeat logic from #call_task here.
74
- wrap_ctx[:task] = Trailblazer::Operation::Callable( activity, call: :__call__ )
74
+ wrap_ctx[:task] = activity
75
75
 
76
76
  return Activity::Right, [wrap_ctx, original_args]
77
77
  end
@@ -38,7 +38,7 @@ class Trailblazer::Operation
38
38
  )
39
39
  )
40
40
 
41
- { task: task, id: path, extension: [extension] }
41
+ { task: task, id: path, Trailblazer::Activity::DSL::Extension.new(extension) => true }
42
42
  end
43
43
  end
44
44
  end
@@ -37,8 +37,6 @@ end
37
37
  class DocsGuardTest < Minitest::Spec
38
38
  #:callable
39
39
  class MyGuard
40
- include Uber::Callable
41
-
42
40
  def call(options, pass:, **)
43
41
  pass
44
42
  end
@@ -1,13 +1,8 @@
1
1
  require "pp"
2
+ require "delegate" # Ruby 2.2
2
3
  require "trailblazer/macro"
3
4
  require "minitest/autorun"
4
5
 
5
- require "reform"
6
- require "reform/form/active_model/validations"
7
- Reform::Form.class_eval do
8
- include Reform::Form::ActiveModel::Validations
9
- end
10
-
11
6
  module Mock
12
7
  class Result
13
8
  def initialize(bool); @bool = bool end
@@ -19,14 +19,9 @@ Gem::Specification.new do |spec|
19
19
 
20
20
  spec.add_development_dependency "bundler"
21
21
 
22
- spec.add_development_dependency "trailblazer-operation", ">= 0.2.5", "< 0.3.0"
23
- spec.add_development_dependency "trailblazer-macro-contract", ">= 2.1.0.beta1", "< 2.2.0"
24
-
25
- spec.add_development_dependency "reform"
26
- spec.add_development_dependency "reform-rails"
22
+ spec.add_development_dependency "trailblazer-operation", ">= 0.3.0", "< 0.4.0"
27
23
 
28
24
  spec.add_development_dependency "minitest"
29
- spec.add_development_dependency "nokogiri"
30
25
  spec.add_development_dependency "rake"
31
26
 
32
27
  spec.add_development_dependency "roar"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trailblazer-macro
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0.beta4
4
+ version: 2.1.0.beta6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sutterer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-03-23 00:00:00.000000000 Z
12
+ date: 2018-05-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -30,69 +30,21 @@ dependencies:
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - ">="
33
- - !ruby/object:Gem::Version
34
- version: 0.2.5
35
- - - "<"
36
- - !ruby/object:Gem::Version
37
- version: 0.3.0
38
- type: :development
39
- prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- version: 0.2.5
45
- - - "<"
46
33
  - !ruby/object:Gem::Version
47
34
  version: 0.3.0
48
- - !ruby/object:Gem::Dependency
49
- name: trailblazer-macro-contract
50
- requirement: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: 2.1.0.beta1
55
35
  - - "<"
56
36
  - !ruby/object:Gem::Version
57
- version: 2.2.0
37
+ version: 0.4.0
58
38
  type: :development
59
39
  prerelease: false
60
40
  version_requirements: !ruby/object:Gem::Requirement
61
41
  requirements:
62
42
  - - ">="
63
43
  - !ruby/object:Gem::Version
64
- version: 2.1.0.beta1
44
+ version: 0.3.0
65
45
  - - "<"
66
46
  - !ruby/object:Gem::Version
67
- version: 2.2.0
68
- - !ruby/object:Gem::Dependency
69
- name: reform
70
- requirement: !ruby/object:Gem::Requirement
71
- requirements:
72
- - - ">="
73
- - !ruby/object:Gem::Version
74
- version: '0'
75
- type: :development
76
- prerelease: false
77
- version_requirements: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - ">="
80
- - !ruby/object:Gem::Version
81
- version: '0'
82
- - !ruby/object:Gem::Dependency
83
- name: reform-rails
84
- requirement: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - ">="
87
- - !ruby/object:Gem::Version
88
- version: '0'
89
- type: :development
90
- prerelease: false
91
- version_requirements: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - ">="
94
- - !ruby/object:Gem::Version
95
- version: '0'
47
+ version: 0.4.0
96
48
  - !ruby/object:Gem::Dependency
97
49
  name: minitest
98
50
  requirement: !ruby/object:Gem::Requirement
@@ -107,20 +59,6 @@ dependencies:
107
59
  - - ">="
108
60
  - !ruby/object:Gem::Version
109
61
  version: '0'
110
- - !ruby/object:Gem::Dependency
111
- name: nokogiri
112
- requirement: !ruby/object:Gem::Requirement
113
- requirements:
114
- - - ">="
115
- - !ruby/object:Gem::Version
116
- version: '0'
117
- type: :development
118
- prerelease: false
119
- version_requirements: !ruby/object:Gem::Requirement
120
- requirements:
121
- - - ">="
122
- - !ruby/object:Gem::Version
123
- version: '0'
124
62
  - !ruby/object:Gem::Dependency
125
63
  name: rake
126
64
  requirement: !ruby/object:Gem::Requirement
@@ -181,6 +119,7 @@ files:
181
119
  - LICENSE.txt
182
120
  - README.md
183
121
  - Rakefile
122
+ - lib/trailblazer-macro.rb
184
123
  - lib/trailblazer/macro.rb
185
124
  - lib/trailblazer/macro/version.rb
186
125
  - lib/trailblazer/operation/guard.rb