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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a4d1e2d7740622ef1ddc7aaa6dc7bcfb64f1e7e7d5cedd2451f78d601a085f8
4
- data.tar.gz: 5facf81ef9fd26d5ba649739e65cb6017de9afe192d5830279a397716cb93b78
3
+ metadata.gz: 71665a3fd5c65c00c14b7bafd3ec2c40b13ec117e2469b6773c6c2a967fecd06
4
+ data.tar.gz: 9b1886ac83b57eadaf08325017b71d31e17f649523ef62b2f7ae50ba6d17e3c0
5
5
  SHA512:
6
- metadata.gz: e7751abc81f9d8f9db91c3cf612901066be0132b07694182cdaf480318df619fe52276974678aee03bc1a1257323c09379ddc9e19838aa6a37752a992d189955
7
- data.tar.gz: dc1b0a45620512cee1dfffb208c44ddef18ea92581ea1188f4c0df2967093f5c1ca21efb67fc92bc17a357a0ecfeb6789e35e8e0609e636b350acc257c2fc3e3
6
+ metadata.gz: c8d72cf3f86672225afdb716b5a2e7142b572a0318db68fb029c16d74ebed9207cc23509ef37200d5b7df7de5cc364aa94b3e8178374b07b75d77312cfc2c913
7
+ data.tar.gz: 0ee8fa16d84152f5e9351b760d439c481d201c1e32c6ecc6112416a9857c74f9dd4a0c1c26ee3402b2daa9bb44961c917720bb2f2d9c4a2d67f8f7cdd8fb8983
@@ -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({
@@ -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
 
@@ -40,17 +40,18 @@ module Mushy
40
40
 
41
41
  event = incoming_event
42
42
 
43
- mashed_config = masher.mash config, event
44
-
45
- incoming_split = mashed_config[:incoming_split]
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, config }
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, mashed_config
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
@@ -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.2'
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.2
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