mushy 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mushy/builder/index.rb +8 -0
- data/lib/mushy/flow.rb +3 -1
- data/lib/mushy/flux.rb +7 -6
- data/lib/mushy/fluxs/format.rb +19 -0
- data/mushy.gemspec +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71665a3fd5c65c00c14b7bafd3ec2c40b13ec117e2469b6773c6c2a967fecd06
|
4
|
+
data.tar.gz: 9b1886ac83b57eadaf08325017b71d31e17f649523ef62b2f7ae50ba6d17e3c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8d72cf3f86672225afdb716b5a2e7142b572a0318db68fb029c16d74ebed9207cc23509ef37200d5b7df7de5cc364aa94b3e8178374b07b75d77312cfc2c913
|
7
|
+
data.tar.gz: 0ee8fa16d84152f5e9351b760d439c481d201c1e32c6ecc6112416a9857c74f9dd4a0c1c26ee3402b2daa9bb44961c917720bb2f2d9c4a2d67f8f7cdd8fb8983
|
data/lib/mushy/builder/index.rb
CHANGED
@@ -236,6 +236,7 @@ module Mushy
|
|
236
236
|
id: { type: 'text', value: '' },
|
237
237
|
name: { type: 'text', value: '' },
|
238
238
|
flux: { type: 'select', value: fluxdata.fluxs[0].name, options: options},
|
239
|
+
parent: { type: 'select', value: '', options: flowdata.fluxs.map(function(x) { return x.id; }) },
|
239
240
|
};
|
240
241
|
|
241
242
|
for (var key in configs)
|
@@ -257,6 +258,7 @@ module Mushy
|
|
257
258
|
id: setup.id,
|
258
259
|
name: setup.name,
|
259
260
|
flux: setup.flux,
|
261
|
+
parent: setup.parent,
|
260
262
|
config: config,
|
261
263
|
};
|
262
264
|
var index = -1;
|
@@ -278,6 +280,7 @@ module Mushy
|
|
278
280
|
Vue.set(setup.id, 'value', flux.id);
|
279
281
|
Vue.set(setup.name, 'value', flux.name);
|
280
282
|
Vue.set(setup.flux, 'value', flux.flux);
|
283
|
+
Vue.set(setup.parent, 'value', flux.parent);
|
281
284
|
|
282
285
|
var applicable_config = configs[flux.flux];
|
283
286
|
for(var key in applicable_config)
|
@@ -285,6 +288,11 @@ module Mushy
|
|
285
288
|
Vue.set(applicable_config[key], 'value', flux.config[key]);
|
286
289
|
else
|
287
290
|
Vue.set(applicable_config[key], 'value', applicable_config[key].default);
|
291
|
+
|
292
|
+
|
293
|
+
options = flowdata.fluxs.map(function(x) { return x.id; }).filter(function(x){ return x != flux.id });
|
294
|
+
options.unshift('');
|
295
|
+
setup.parent.options = options;
|
288
296
|
};
|
289
297
|
|
290
298
|
app = new Vue({
|
data/lib/mushy/flow.rb
CHANGED
@@ -26,9 +26,11 @@ module Mushy
|
|
26
26
|
|
27
27
|
def self.parse data
|
28
28
|
data = JSON.parse data
|
29
|
-
flow = new
|
30
29
|
|
31
30
|
data_fluxs = data['fluxs'] || []
|
31
|
+
data_fluxs.select { |x| x['parent'] }.map { |r| r["parent_fluxs"] = [r["parent"]] }
|
32
|
+
|
33
|
+
flow = new
|
32
34
|
|
33
35
|
flow.fluxs = data_fluxs.map { |s| build_flux s }
|
34
36
|
|
data/lib/mushy/flux.rb
CHANGED
@@ -40,17 +40,18 @@ module Mushy
|
|
40
40
|
|
41
41
|
event = incoming_event
|
42
42
|
|
43
|
-
|
44
|
-
|
45
|
-
|
43
|
+
incoming_split = masher.mash(config, event)[:incoming_split]
|
44
|
+
config_considering_an_imcoming_split = config
|
45
|
+
.reject { |x, _| incoming_split && x.to_s == 'join' }
|
46
|
+
.reduce({}) { |t, i| t[i[0]] = i[1]; t }
|
46
47
|
|
47
48
|
events = incoming_split ? incoming_event[incoming_split] : [event]
|
48
49
|
|
49
|
-
results = events.map { |e| execute_single_event e,
|
50
|
+
results = events.map { |e| execute_single_event e, config_considering_an_imcoming_split }
|
50
51
|
|
51
52
|
return results.first unless incoming_split
|
52
53
|
|
53
|
-
results = join_these_results(results, event, config[:join]) if config[:join]
|
54
|
+
results = join_these_results([results].flatten, event, config[:join]) if config[:join]
|
54
55
|
|
55
56
|
results.flatten
|
56
57
|
end
|
@@ -67,7 +68,7 @@ module Mushy
|
|
67
68
|
returned_one_result = results.is_a?(Hash)
|
68
69
|
|
69
70
|
results = standardize_these results
|
70
|
-
results = shape_these results, event,
|
71
|
+
results = shape_these results, event, config
|
71
72
|
|
72
73
|
return results.first if the_original_join
|
73
74
|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Mushy
|
2
|
+
|
3
|
+
class Format < Flux
|
4
|
+
|
5
|
+
def self.details
|
6
|
+
{
|
7
|
+
name: 'Format',
|
8
|
+
description: 'Return the event passed to it. This opens the opportunity to further alter results.',
|
9
|
+
config: {},
|
10
|
+
}
|
11
|
+
end
|
12
|
+
|
13
|
+
def process event, config
|
14
|
+
event
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
data/mushy.gemspec
CHANGED
@@ -4,7 +4,7 @@ require 'mushy/version'
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = 'mushy'
|
7
|
-
s.version = '0.0.
|
7
|
+
s.version = '0.0.4'
|
8
8
|
s.date = '2020-11-23'
|
9
9
|
s.summary = 'Process streams of work using common modules.'
|
10
10
|
s.description = 'This tool assists in the creation and processing of workflows.'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mushy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Darren Cauthon
|
@@ -116,6 +116,7 @@ files:
|
|
116
116
|
- lib/mushy/fluxs/build_csv.rb
|
117
117
|
- lib/mushy/fluxs/collection.rb
|
118
118
|
- lib/mushy/fluxs/filter.rb
|
119
|
+
- lib/mushy/fluxs/format.rb
|
119
120
|
- lib/mushy/fluxs/get.rb
|
120
121
|
- lib/mushy/fluxs/ls.rb
|
121
122
|
- lib/mushy/fluxs/parse_html.rb
|