strum-pipeline 0.1.0 → 0.1.1
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/CHANGELOG.md +10 -0
- data/Gemfile.lock +12 -5
- data/README.md +45 -0
- data/lib/strum/pipeline.rb +2 -1
- data/lib/strum/pipeline/version.rb +1 -1
- data/strum-pipeline.gemspec +5 -5
- metadata +10 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '08c02b288609dbe7104951827793f553e9f81854207c0ff6cac3b39f3d71aad5'
|
4
|
+
data.tar.gz: 900b840bf7dfa13769abfb7ba24d9dc7b005d446bec85a0105b746739354e0df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95203efc56f92da0cf057ca104832c0b92286faf3758014b5d3901e081e3f758e23fc10d47b88f607af20f40eb68944a35ba4d0ad987e4c0fcb7c76d6ce4902c
|
7
|
+
data.tar.gz: a80758e037e0e244fcb46a03f28265c4711d78431026df9ea4b6f19cb9b8e3e8ec5129f85bd53bf56ad7fc06c305e920f243df347c451fd43ab933db1600dad6
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
|
2
|
+
# Changelog
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
|
5
|
+
## [0.1.1] - 2021-06-02
|
6
|
+
### Fixed
|
7
|
+
- custom handlers for resource name with `-` by [@anton.klyzhka].
|
8
|
+
|
9
|
+
### Changed
|
10
|
+
- `strum-esb` dependency version to `~> 0.1.1` by [@anton.klyzhka].
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
strum-pipeline (0.1.
|
4
|
+
strum-pipeline (0.1.1)
|
5
5
|
bunny (~> 2.15)
|
6
6
|
connection_pool (~> 2.2)
|
7
7
|
dry-configurable (~> 0.11)
|
@@ -10,15 +10,16 @@ PATH
|
|
10
10
|
redis-objects (~> 1.5)
|
11
11
|
singleton (~> 0.1)
|
12
12
|
sneakers (~> 2.12)
|
13
|
-
strum-esb (~> 0.1.
|
13
|
+
strum-esb (~> 0.1.1)
|
14
14
|
|
15
15
|
GEM
|
16
16
|
remote: https://rubygems.org/
|
17
17
|
specs:
|
18
18
|
amq-protocol (2.3.2)
|
19
19
|
ast (2.4.2)
|
20
|
-
bunny (2.
|
20
|
+
bunny (2.18.0)
|
21
21
|
amq-protocol (~> 2.3, >= 2.3.1)
|
22
|
+
sorted_set (~> 1, >= 1.0.2)
|
22
23
|
concurrent-ruby (1.1.8)
|
23
24
|
connection_pool (2.2.5)
|
24
25
|
debase (0.2.4.1)
|
@@ -33,10 +34,11 @@ GEM
|
|
33
34
|
dry-inflector (0.2.0)
|
34
35
|
json (2.5.1)
|
35
36
|
parallel (1.20.1)
|
36
|
-
parser (3.0.1.
|
37
|
+
parser (3.0.1.1)
|
37
38
|
ast (~> 2.4.1)
|
38
39
|
rainbow (3.0.0)
|
39
40
|
rake (12.3.3)
|
41
|
+
rbtree (0.4.4)
|
40
42
|
redis (4.2.5)
|
41
43
|
redis-objects (1.5.0)
|
42
44
|
redis (~> 4.0)
|
@@ -71,6 +73,7 @@ GEM
|
|
71
73
|
ruby-progressbar (1.11.0)
|
72
74
|
serverengine (2.1.1)
|
73
75
|
sigdump (~> 0.2.2)
|
76
|
+
set (1.0.1)
|
74
77
|
sigdump (0.2.4)
|
75
78
|
singleton (0.1.1)
|
76
79
|
sneakers (2.12.0)
|
@@ -79,9 +82,13 @@ GEM
|
|
79
82
|
rake (~> 12.3)
|
80
83
|
serverengine (~> 2.1.0)
|
81
84
|
thor
|
82
|
-
|
85
|
+
sorted_set (1.0.3)
|
86
|
+
rbtree
|
87
|
+
set (~> 1.0)
|
88
|
+
strum-esb (0.1.1)
|
83
89
|
bunny (~> 2.15)
|
84
90
|
connection_pool (~> 2.2.2)
|
91
|
+
dry-configurable (~> 0.12)
|
85
92
|
json (~> 2.3)
|
86
93
|
sneakers (~> 2.12)
|
87
94
|
thor (1.1.0)
|
data/README.md
CHANGED
@@ -34,3 +34,48 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
34
34
|
|
35
35
|
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/strum-pipeline.
|
36
36
|
|
37
|
+
## Example
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
# frozen_string_literal: true
|
41
|
+
|
42
|
+
require "sneakers/runner"
|
43
|
+
require "strum/esb"
|
44
|
+
require "strum/pipeline"
|
45
|
+
|
46
|
+
# demo class
|
47
|
+
class DemoPipeline
|
48
|
+
include Strum::Pipeline
|
49
|
+
|
50
|
+
ttl 60
|
51
|
+
init :event, "identity/create"
|
52
|
+
init :event, "identity/update"
|
53
|
+
step :action, "get/user", :demo_custom_handler
|
54
|
+
step :action, "get/company"
|
55
|
+
step :info, "user"
|
56
|
+
|
57
|
+
def event_identity_create(_payload)
|
58
|
+
storage[:counter1] = 1
|
59
|
+
storage[:counter] = 1
|
60
|
+
Strum::Esb::Action.call({}, :get, :user)
|
61
|
+
# Strum::Esb::Action.({}, :get, :company)
|
62
|
+
end
|
63
|
+
|
64
|
+
def demo_custom_handler(_payload)
|
65
|
+
Strum::Esb::Info.call({}, :user)
|
66
|
+
storage[:counter2] = 2
|
67
|
+
Strum::Pipeline::Storage[:counter] = 2
|
68
|
+
Strum::Pipeline::Storage.list << 2
|
69
|
+
end
|
70
|
+
|
71
|
+
def info_user(payload)
|
72
|
+
logger.debug payload
|
73
|
+
storage[:counter3] = 3
|
74
|
+
storage[:counter] = 3
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
r = Sneakers::Runner.new([DemoPipeline])
|
79
|
+
r.run
|
80
|
+
```
|
81
|
+
|
data/lib/strum/pipeline.rb
CHANGED
@@ -57,7 +57,8 @@ module Strum
|
|
57
57
|
from_queue pipeline_name, bindings: bindings
|
58
58
|
_, *msg = Strum::Esb::Functions.public_send("#{message_type}_explain", message_binding)
|
59
59
|
@handlers ||= {}
|
60
|
-
|
60
|
+
params = msg.map{ |param| param&.to_s.gsub(/[^a-zA-Z0-9]/, "_")&.downcase }
|
61
|
+
handler_key = ([message_type] + params).join("-")
|
61
62
|
@handlers[handler_key] = handler.to_s if handler
|
62
63
|
end
|
63
64
|
|
data/strum-pipeline.gemspec
CHANGED
@@ -10,15 +10,15 @@ Gem::Specification.new do |spec|
|
|
10
10
|
|
11
11
|
spec.summary = "Defining data processing Pipeline"
|
12
12
|
# spec.description = "Defining data processing Pipeline"
|
13
|
-
spec.homepage = "https://
|
13
|
+
spec.homepage = "https://gitlab.com/strum/strum-pipeline"
|
14
14
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
15
15
|
|
16
16
|
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
17
17
|
|
18
18
|
spec.metadata["homepage_uri"] = spec.homepage
|
19
|
-
spec.metadata["source_code_uri"] = "https://
|
20
|
-
spec.metadata["readme_uri"] = "https://
|
21
|
-
spec.metadata["changelog_uri"] = "https://
|
19
|
+
spec.metadata["source_code_uri"] = "https://gitlab.com/strum/strum-pipeline"
|
20
|
+
spec.metadata["readme_uri"] = "https://gitlab.com/strum/strum-pipeline/README.md"
|
21
|
+
spec.metadata["changelog_uri"] = "https://gitlab.com/strum/strum-pipeline/CHANGELOG.md"
|
22
22
|
|
23
23
|
# Specify which files should be added to the gem when it is released.
|
24
24
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
@@ -38,5 +38,5 @@ Gem::Specification.new do |spec|
|
|
38
38
|
spec.add_dependency "singleton", "~> 0.1"
|
39
39
|
spec.add_dependency "sneakers", "~> 2.12"
|
40
40
|
|
41
|
-
spec.add_dependency "strum-esb", "~> 0.1.
|
41
|
+
spec.add_dependency "strum-esb", "~> 0.1.1"
|
42
42
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: strum-pipeline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Serhiy Nazarov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bunny
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 0.1.
|
131
|
+
version: 0.1.1
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 0.1.
|
138
|
+
version: 0.1.1
|
139
139
|
description:
|
140
140
|
email:
|
141
141
|
- sn@nazarov.com.ua
|
@@ -149,6 +149,7 @@ files:
|
|
149
149
|
- ".rubocop.yml"
|
150
150
|
- ".ruby-version"
|
151
151
|
- ".travis.yml"
|
152
|
+
- CHANGELOG.md
|
152
153
|
- Gemfile
|
153
154
|
- Gemfile.lock
|
154
155
|
- README.md
|
@@ -159,14 +160,14 @@ files:
|
|
159
160
|
- lib/strum/pipeline/storage.rb
|
160
161
|
- lib/strum/pipeline/version.rb
|
161
162
|
- strum-pipeline.gemspec
|
162
|
-
homepage: https://
|
163
|
+
homepage: https://gitlab.com/strum/strum-pipeline
|
163
164
|
licenses: []
|
164
165
|
metadata:
|
165
166
|
allowed_push_host: https://rubygems.org
|
166
|
-
homepage_uri: https://
|
167
|
-
source_code_uri: https://
|
168
|
-
readme_uri: https://
|
169
|
-
changelog_uri: https://
|
167
|
+
homepage_uri: https://gitlab.com/strum/strum-pipeline
|
168
|
+
source_code_uri: https://gitlab.com/strum/strum-pipeline
|
169
|
+
readme_uri: https://gitlab.com/strum/strum-pipeline/README.md
|
170
|
+
changelog_uri: https://gitlab.com/strum/strum-pipeline/CHANGELOG.md
|
170
171
|
post_install_message:
|
171
172
|
rdoc_options: []
|
172
173
|
require_paths:
|