mushy 0.0.4 → 0.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 71665a3fd5c65c00c14b7bafd3ec2c40b13ec117e2469b6773c6c2a967fecd06
4
- data.tar.gz: 9b1886ac83b57eadaf08325017b71d31e17f649523ef62b2f7ae50ba6d17e3c0
3
+ metadata.gz: 971693353748e8d21c56dfa911cf669b79a10fce38530eaeb9c8ab019c69be73
4
+ data.tar.gz: 58ef99b38f1ebc13fbd68bca3e6597b43ba4310313e780ab38c55e14dcc31b07
5
5
  SHA512:
6
- metadata.gz: c8d72cf3f86672225afdb716b5a2e7142b572a0318db68fb029c16d74ebed9207cc23509ef37200d5b7df7de5cc364aa94b3e8178374b07b75d77312cfc2c913
7
- data.tar.gz: 0ee8fa16d84152f5e9351b760d439c481d201c1e32c6ecc6112416a9857c74f9dd4a0c1c26ee3402b2daa9bb44961c917720bb2f2d9c4a2d67f8f7cdd8fb8983
6
+ metadata.gz: f124d798c6d44e1ecefc2b5b44726c20f7c5e07ed25182776cf2db69e230ef646d84d45627f5d645ff04be725c7db891bf597c4317bd42f9372a070b425cc72c
7
+ data.tar.gz: f7a5875f509dd43c1543c89636a9e435ff0cabec094fe109113f173fb26e6eef6bd0a0f0634dc35f1ee78f9c71f6e7e6fd166515f222383f3fcef8d4be4f4deb
@@ -19,9 +19,9 @@ module Mushy
19
19
  <td><a href="#" v-on:click.prevent.stop="edit({ flux: flux, setup: setup, configs: configs })">[Edit]</a></td>
20
20
  </tr>
21
21
  </table>
22
- <a href="#" v-if="setup.id.value == ''" v-on:click.prevent.stop="startNew({ setup: setup, configs: configs })">[New]</a>
23
- <a href="#" v-if="setup.id.value == ''" v-on:click.prevent.stop="saveFlow(flow)">[Save]</a>
24
- <div v-if="setup.id.value">
22
+ <a href="#" v-if="setup.showFlux == false" v-on:click.prevent.stop="startNew({ setup: setup, configs: configs })">[New]</a>
23
+ <a href="#" v-if="setup.showFlux == false" v-on:click.prevent.stop="saveFlow({ setup: setup, flow: flow })">[Save]</a>
24
+ <div v-if="setup.showFlux">
25
25
  <mip-heavy :data="setup"></mip-heavy>
26
26
  <mip-heavy v-for="(data, id) in configs" v-show="setup.flux.value === id" :data="data"></mip-heavy>
27
27
  <div v-if="results.loading">Loading...</div>
@@ -90,6 +90,10 @@ module Mushy
90
90
  props: ['label', 'value', 'options', 'description'],
91
91
  template: '<div><mip-label :id="id" :label="label" :description="description"></mip-label><select :name="id" v-on:input="$emit(\\'update:value\\', $event.target.value)"><option v-for="option in options" v-bind:value="option" :selected="value == option">{{option}}</option></select></div>'
92
92
  },
93
+ selectrecord: {
94
+ props: ['label', 'value', 'options', 'description'],
95
+ template: '<div><mip-label :id="id" :label="label" :description="description"></mip-label><select :name="id" v-on:input="$emit(\\'update:value\\', $event.target.value)"><option v-for="option in options" v-bind:value="option.id" :selected="value == option.id">{{option.name}}</option></select></div>'
96
+ },
93
97
  boolean: {
94
98
  props: ['label', 'value', 'options', 'description'],
95
99
  template: '<div><mip-label :id="id" :label="label" :description="description"></mip-label><select :name="id" v-on:input="$emit(\\'update:value\\', $event.target.value)"><option v-for="option in [true, false]" v-bind:value="option" :selected="value == option">{{option}}</option></select></div>'
@@ -232,11 +236,12 @@ module Mushy
232
236
  options.push(fluxTypes[type]);
233
237
 
234
238
  var setup = {
239
+ showFlux: false,
235
240
  event: { type: 'json', value: '{}' },
236
241
  id: { type: 'text', value: '' },
237
242
  name: { type: 'text', value: '' },
238
243
  flux: { type: 'select', value: fluxdata.fluxs[0].name, options: options},
239
- parent: { type: 'select', value: '', options: flowdata.fluxs.map(function(x) { return x.id; }) },
244
+ parent: { type: 'selectrecord', value: '', options: flowdata.fluxs },
240
245
  };
241
246
 
242
247
  for (var key in configs)
@@ -290,18 +295,26 @@ module Mushy
290
295
  Vue.set(applicable_config[key], 'value', applicable_config[key].default);
291
296
 
292
297
 
293
- options = flowdata.fluxs.map(function(x) { return x.id; }).filter(function(x){ return x != flux.id });
294
- options.unshift('');
298
+ options = flowdata.fluxs.filter(function(x){ return x.id != flux.id });
299
+ options.unshift( { id: '', name: '' } );
295
300
  setup.parent.options = options;
301
+
302
+ Vue.set(setup, 'showFlux', true);
296
303
  };
297
304
 
305
+ function uuidv4() {
306
+ return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c =>
307
+ (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
308
+ );
309
+ }
310
+
298
311
  app = new Vue({
299
312
  el: '#app',
300
313
  data: {
301
314
  flow: flowdata,
302
315
  startNew: function(x) {
303
316
  flux = {
304
- id: 'hey',
317
+ id: uuidv4(),
305
318
  name: 'you',
306
319
  config: {}
307
320
  };
@@ -312,12 +325,13 @@ module Mushy
312
325
 
313
326
  loadThisFlux(x.flux, x.setup, x.configs);
314
327
  },
315
- saveFlow: function(flow)
328
+ saveFlow: function(input)
316
329
  {
317
- console.log(flow);
330
+ var setup = input.setup;
331
+ var flow = input.flow;
318
332
  axios.post('/save', flow)
319
333
  .then(function(result){
320
- console.log(result);
334
+ Vue.set(setup, 'show', false);
321
335
  });
322
336
  },
323
337
  configs: configs,
@@ -57,6 +57,11 @@ module Mushy
57
57
  type: 'text',
58
58
  value: 'headers',
59
59
  },
60
+ wait_before_closing: {
61
+ description: 'Wait this many seconds before closing the browser.',
62
+ type: 'integer',
63
+ value: 'cookies',
64
+ },
60
65
  },
61
66
  }
62
67
  end
@@ -80,6 +85,8 @@ module Mushy
80
85
  body: browser.body
81
86
  }
82
87
 
88
+ sleep(config[:wait_before_closing].to_i) if config[:wait_before_closing] && config[:wait_before_closing].to_i > 0
89
+
83
90
  browser.quit
84
91
 
85
92
  result
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.4'
7
+ s.version = '0.0.5'
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
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darren Cauthon