trailblazer-activity 0.15.1 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,7 @@
1
1
  module Trailblazer
2
2
  # This is DSL-independent code, focusing only on run-time.
3
+ #
4
+ # Developer's docs: https://trailblazer.to/2.1/docs/internals.html#internals-activity
3
5
  class Activity
4
6
  # include Activity::Interface # TODO
5
7
 
@@ -14,18 +16,12 @@ module Trailblazer
14
16
  )
15
17
  end
16
18
 
17
- # DISCUSS: we could remove this reader in the future
18
- # and use {Activity.to_h[:config]}.
19
- def [](*key)
20
- @schema[:config][*key]
21
- end
22
-
23
19
  def to_h
24
- @schema
20
+ @schema.to_h
25
21
  end
26
22
 
27
23
  def inspect
28
- %{#<Trailblazer::Activity:0x#{object_id}>}
24
+ %(#<Trailblazer::Activity:0x#{object_id}>)
29
25
  end
30
26
 
31
27
  # Canonical entry-point to invoke an {Activity} or Strategy such as {Activity::Railway}
@@ -42,7 +38,6 @@ require "trailblazer/activity/schema/implementation"
42
38
  require "trailblazer/activity/schema/intermediate"
43
39
  require "trailblazer/activity/circuit"
44
40
  require "trailblazer/activity/circuit/task_adapter"
45
- require "trailblazer/activity/config"
46
41
  require "trailblazer/activity/introspect"
47
42
  require "trailblazer/activity/task_wrap/pipeline"
48
43
  require "trailblazer/activity/task_wrap/call_task"
@@ -51,7 +46,7 @@ require "trailblazer/activity/task_wrap/runner"
51
46
  require "trailblazer/activity/task_wrap/extension"
52
47
  require "trailblazer/activity/adds"
53
48
  require "trailblazer/activity/deprecate"
49
+ require "trailblazer/activity/schema/compiler"
50
+ require "trailblazer/activity/introspect/render"
54
51
  require "trailblazer/option"
55
52
  require "trailblazer/context"
56
-
57
-
@@ -24,7 +24,6 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency "minitest", "~> 5.0"
25
25
  spec.add_development_dependency "minitest-line"
26
26
  spec.add_development_dependency "rake"
27
- spec.add_development_dependency "trailblazer-developer", ">= 0.0.23"
28
27
 
29
28
  spec.required_ruby_version = '>= 2.1.0'
30
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trailblazer-activity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.1
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sutterer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-09 00:00:00.000000000 Z
11
+ date: 2023-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: trailblazer-context
@@ -94,20 +94,6 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: trailblazer-developer
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: 0.0.23
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: 0.0.23
111
97
  description:
112
98
  email:
113
99
  - apotonick@gmail.com
@@ -129,10 +115,11 @@ files:
129
115
  - lib/trailblazer/activity/adds.rb
130
116
  - lib/trailblazer/activity/circuit.rb
131
117
  - lib/trailblazer/activity/circuit/task_adapter.rb
132
- - lib/trailblazer/activity/config.rb
133
118
  - lib/trailblazer/activity/deprecate.rb
134
119
  - lib/trailblazer/activity/introspect.rb
120
+ - lib/trailblazer/activity/introspect/render.rb
135
121
  - lib/trailblazer/activity/schema.rb
122
+ - lib/trailblazer/activity/schema/compiler.rb
136
123
  - lib/trailblazer/activity/schema/implementation.rb
137
124
  - lib/trailblazer/activity/schema/intermediate.rb
138
125
  - lib/trailblazer/activity/structures.rb
@@ -1,35 +0,0 @@
1
- module Trailblazer
2
- class Activity
3
- # Config API allows you to read and write immutably to the activity's
4
- # {:config} field. Most of the times, this only contains {:wrap_static}.
5
- module Config
6
- module_function
7
-
8
- def set(config, *args)
9
- if args.size == 2
10
- key, value = *args
11
-
12
- config = config.merge(key => value)
13
- else
14
- directive, key, value = *args
15
-
16
- config = config.merge( directive => {}.freeze ) unless config.key?(directive)
17
-
18
- directive_hash = config[directive].merge(key => value)
19
- config = config.merge( directive => directive_hash.freeze )
20
- end
21
-
22
- config
23
- end
24
-
25
- def get(config, *args)
26
- directive, key = *args
27
-
28
- return config[directive] if args.size == 1
29
- return config[directive][key] if config.key?(directive)
30
-
31
- nil
32
- end
33
- end
34
- end
35
- end