mushy 0.18.0 → 0.19.0

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: 88a3578100f93b47791d83299597e4b6a1d1ccabfaa8628eb5172617facf9b95
4
- data.tar.gz: fa722d8dd776c1e311bea24ad94303785fd93ccc16eeebcd93783f9d25c3e0f5
3
+ metadata.gz: d783dd461abacb6686c2e131fc228d2640f1dda9836d1c49c1073f7e37054739
4
+ data.tar.gz: 950f0fd45cb88001fe62d3f1541374c2df5a1f3ff931b19d3a40f4a6fd187fb3
5
5
  SHA512:
6
- metadata.gz: 4eafe788eccb281c1e15bdc0cfae4dca68f1146894a7d28569347673f28ef265b5b8aa90f7fb6c21245e1ba15fceac2f2677420cc643dd535c8cd54062c7642d
7
- data.tar.gz: 2568f50f7cdf5569605d89fe7e088036d48f106d10f2b45c2b29a25038f145d29bb2566f9d7271f642b11307cb5e9259e72ac4fb1f1b3826178e977532e7c8b3
6
+ metadata.gz: 15b49ebac4c571ab8f2c34450516f0325b70a3e85e7bd909bdd800c29a74ee7377297fa5128f8d7b5458ec278768e92cafbd8af552321f372d26a9a743d8ebb1
7
+ data.tar.gz: 8041bbd1b4f89af13edc858be699bc3903e4bea680ac68b0b2f26a744adc0b7230572034ade0367851b7f5201e3c51ca9a48095d7afd9300f5185ce2f2c0bd3f
data/hey.mushy ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "fluxs": [
3
+ {
4
+ "id": "0294b0c4-296f-44cd-9891-95fe75ebe4d2",
5
+ "name": "Start it up",
6
+ "flux": "Cli",
7
+ "parents": [
8
+
9
+ ],
10
+ "config": {
11
+ "model": {
12
+ }
13
+ }
14
+ },
15
+ {
16
+ "id": "7779dce1-1ce8-4241-8e94-ddcd5cb4f8df",
17
+ "name": "Output something",
18
+ "flux": "Stdout",
19
+ "parents": [
20
+ "0294b0c4-296f-44cd-9891-95fe75ebe4d2"
21
+ ],
22
+ "config": {
23
+ "message": "Hello.",
24
+ "model": {
25
+ }
26
+ }
27
+ }
28
+ ]
29
+ }
@@ -62,7 +62,9 @@ module Mushy
62
62
  </header>
63
63
  <section class="modal-card-body">
64
64
  <div class="content">
65
- <div v-for="(fluxType, id) in fluxTypes">
65
+ <div v-for="(fluxGroup) in fluxGroups">
66
+ <h2 style="font-style:italic">{{fluxGroup.name}}</h2>
67
+ <div v-for="(fluxType, id) in fluxGroup.fluxs">
66
68
  <div class="level">
67
69
  <div class="level-left"><h2>{{fluxType.title || fluxType.name}}</h2></div>
68
70
  <div class="level-right">
@@ -87,6 +89,7 @@ module Mushy
87
89
  <div v-for="(a, b) in fluxType.documentation" v-if="fluxType['detailsTab'] == b" v-html="a"></div>
88
90
  </div>
89
91
  </div>
92
+ </div>
90
93
  </div>
91
94
  </section>
92
95
  <footer class="modal-card-foot">
@@ -236,7 +239,7 @@ module Mushy
236
239
  };
237
240
  },
238
241
  props: ['label', 'value', 'options', 'description', 'shrink'],
239
- template: '<div><div class="level"><div class="level-left"><div class="level-item"><mip-label :id="id" :label="label" :description="description" :hide_description="shrink && !value"></mip-label></div><div class="level-item"> <a href="#" v-on:click.prevent.stop="shrink=false" v-show="shrink && !value">[^]</a></div></div></div> <span v-for="option in options" v-if="value && value.includes(option.id)">{{option.name}} <a href="#" v-on:click.prevent.stop="remove(option.id, value);$emit(\\'update:value\\', value)">[X]</a> </span> <a href="#" v-on:click.prevent.stop="doit(selectedValue, value);$emit(\\'update:value\\', value)">ADD</a> <div class="control"><select :name="id" v-if="value || !shrink" v-on:input="selectedValue=$event.target.value;" class="select"><option v-for="option in options" v-bind:value="option.id">{{option.name}}</option></select></div></div>'
242
+ template: '<div><div class="level"><div class="level-left"><div class="level-item"><mip-label :id="id" :label="label" :description="description" :hide_description="shrink && !value"></mip-label></div><div class="level-item"> <a href="#" v-on:click.prevent.stop="shrink=false" v-show="shrink && !value">[^]</a></div></div></div> <span v-for="option in options" v-if="value && value.includes(option.id)">{{option.name}} <a href="#" v-on:click.prevent.stop="remove(option.id, value);$emit(\\'update:value\\', value)">[X]</a> </span> <div class="control"><select :name="id" v-if="value || !shrink" v-on:input="selectedValue=$event.target.value;" class="select" v-on:change.prevent.stop="doit(selectedValue, value);$emit(\\'update:value\\', value);$event.target.value=\\'\\';"><option v-for="option in options" v-bind:value="option.id">{{option.name}}</option></select></div></div>'
240
243
  },
241
244
  boolean: {
242
245
  props: ['label', 'value', 'options', 'description', 'shrink'],
@@ -324,7 +327,7 @@ module Mushy
324
327
  });
325
328
  }
326
329
 
327
- var thingTemplate = '<div v-bind:class="{ \\\'ml-3\\\': data.foghat==\\\'free\\\', \\\'column\\\': data.foghat!=\\\'free\\\', \\\'is-full\\\': data.foghat!=\\\'half\\\' && data.foghat!=\\\'free\\\', \\\'is-half\\\': data.foghat==\\\'half\\\' }">';
330
+ var thingTemplate = '<div v-show="data.hide != true" v-bind:class="{ \\\'ml-3\\\': data.foghat==\\\'free\\\', \\\'column\\\': data.foghat!=\\\'free\\\', \\\'is-full\\\': data.foghat!=\\\'half\\\' && data.foghat!=\\\'free\\\', \\\'is-half\\\': data.foghat==\\\'half\\\' }">';
328
331
  for (var property in components)
329
332
  thingTemplate = thingTemplate + '<mip-' + property + ' v-if="data.type == \\'' + property + '\\'" :id="id" ' + components[property].props.map(function(x){ return ':' + x + '.sync="data.' + x + '"';}).join(' ') + '></mip-' + property + '>'
330
333
  thingTemplate = thingTemplate + '</div>';
@@ -335,7 +338,7 @@ module Mushy
335
338
  console: console,
336
339
  }
337
340
  },
338
- props: ['data', 'value', 'id', 'model', 'foghat'],
341
+ props: ['data', 'value', 'id', 'model', 'foghat', 'hide'],
339
342
  template: thingTemplate
340
343
  });
341
344
 
@@ -385,6 +388,16 @@ module Mushy
385
388
  x['detailsTab'] = Object.getOwnPropertyNames(x.documentation)[0];
386
389
  } );
387
390
 
391
+ fluxGroups = []
392
+ fluxdata.fluxs.map(function(x) {
393
+ if (x.fluxGroup) {} else { x.fluxGroup = { name: 'Others', position: 999999 } };
394
+ rowboat = fluxGroups.filter(function(y) { return y.name == x.fluxGroup.name })[0];
395
+ if (rowboat) {} else { fluxGroups.push(x.fluxGroup); x.fluxGroup.fluxs = [] }
396
+ rowboat = fluxGroups.filter(function(y) { return y.name == x.fluxGroup.name })[0];
397
+ rowboat.fluxs.push(x);
398
+ } );
399
+ fluxGroups = fluxGroups.sort(function(x, y) { return (x.position || 1000) - (y.position || 1000); })
400
+
388
401
  var configs = {};
389
402
  fluxdata.fluxs.map(function(x){
390
403
  configs[x.name] = x.config;
@@ -446,7 +459,7 @@ module Mushy
446
459
  },
447
460
  id: { type: 'hide', value: '' },
448
461
  name: { type: 'text', value: '' },
449
- flux: { type: 'select', value: fluxdata.fluxs[0].name, options: options},
462
+ flux: { type: 'select', value: fluxdata.fluxs[0].name, options: options, hide: true },
450
463
  open_flux: { type: 'button', name: 'Select a Flux', foghat: 'free', medium: 'hey', color: 'is-primary',
451
464
  click: function() {
452
465
  Vue.set(app.setup.fluxTypeSelect, 'is-active', true);
@@ -566,6 +579,7 @@ module Mushy
566
579
  },
567
580
  configs: configs,
568
581
  fluxTypes: fluxTypesWithDetails,
582
+ fluxGroups: fluxGroups,
569
583
  setup: setup,
570
584
  flux_name_for: function(ids, fluxes) {
571
585
  var fluxs = fluxes.filter(function(x){ return ids.includes(x.id) });
@@ -5,7 +5,9 @@ module Mushy
5
5
  def self.details
6
6
  {
7
7
  name: 'Bash',
8
+ title: 'Execute a command via bash',
8
9
  description: 'Run a bash command.',
10
+ fluxGroup: { name: 'Execute' },
9
11
  config: {
10
12
  command: {
11
13
  description: 'The command to run in bash.',
@@ -7,6 +7,8 @@ module Mushy
7
7
  def self.details
8
8
  {
9
9
  name: 'Browser',
10
+ title: 'Use a browser',
11
+ fluxGroup: { name: 'Web' },
10
12
  description: 'Visit a page in a browser.',
11
13
  config: {
12
14
  url: {
@@ -9,6 +9,7 @@ module Mushy
9
9
  name: 'BuildCsv',
10
10
  title: "Build CSV",
11
11
  description: 'Build a CSV.',
12
+ fluxGroup: { name: 'CSV' },
12
13
  config: {
13
14
  input_path: {
14
15
  description: 'The path to the set of records to include in the CSV.',
@@ -5,7 +5,8 @@ module Mushy
5
5
  def self.details
6
6
  {
7
7
  name: 'Cli',
8
- title: 'Command Line Interface',
8
+ title: 'Start a flow via command line',
9
+ fluxGroup: { name: 'Starters', position: 0 },
9
10
  description: 'Accept CLI arguments from the run command.',
10
11
  config: {
11
12
  },
@@ -5,7 +5,9 @@ module Mushy
5
5
  def self.details
6
6
  {
7
7
  name: 'Collection',
8
- description: 'Collects events.',
8
+ title: 'Collect and retrieve events',
9
+ description: 'Collect and retrieve events for the flow.',
10
+ fluxGroup: { name: 'Flows' },
9
11
  config: {
10
12
  id: {
11
13
  description: 'The path to the unique id in the body of the element.',
@@ -5,7 +5,9 @@ module Mushy
5
5
  def self.details
6
6
  {
7
7
  name: 'Document',
8
+ title: 'Make a multi-line liquid value',
8
9
  description: 'Create a multi-line document.',
10
+ fluxGroup: { name: 'Flows' },
9
11
  config: {
10
12
  document: {
11
13
  description: 'The multi-line document you wish to create.',
@@ -5,8 +5,9 @@ module Mushy
5
5
  def self.details
6
6
  {
7
7
  name: 'Environment',
8
- title: 'Environment Variables',
8
+ title: 'Pull environment variables',
9
9
  description: 'Pull environment variables.',
10
+ fluxGroup: { name: 'Environment' },
10
11
  config: {
11
12
  variables: {
12
13
  description: 'Map the environment variables to a new event.',
@@ -7,7 +7,8 @@ module Mushy
7
7
  def self.details
8
8
  {
9
9
  name: 'FileWatch',
10
- title: 'File Watcher',
10
+ title: 'Start a flow when files change',
11
+ fluxGroup: { name: 'Starters', position: 0 },
11
12
  description: 'Watch for file changes.',
12
13
  config: {
13
14
  directory: {
@@ -5,7 +5,9 @@ module Mushy
5
5
  def self.details
6
6
  {
7
7
  name: 'Filter',
8
+ title: 'Filter events',
8
9
  description: 'Filters events based on criteria.',
10
+ fluxGroup: { name: 'Flows' },
9
11
  config: {
10
12
  equal: {
11
13
  description: 'Provide key/value pairs that must match in the event.',
@@ -5,7 +5,9 @@ module Mushy
5
5
  def self.details
6
6
  {
7
7
  name: 'Format',
8
+ title: 'Alter the format of an event',
8
9
  description: 'Return the event passed to it. This opens the opportunity to use the common fluxing to alter the event.',
10
+ fluxGroup: { name: 'Flows' },
9
11
  config: {},
10
12
  examples: {
11
13
  "Simplest Example" => {
@@ -5,7 +5,9 @@ module Mushy
5
5
  def self.details
6
6
  {
7
7
  name: 'GitLog',
8
+ title: 'Get git logs',
8
9
  description: 'Return git logs.',
10
+ fluxGroup: { name: 'Git' },
9
11
  config: {
10
12
  directory: {
11
13
  description: 'The working directory in which the command will be run.',
@@ -7,7 +7,8 @@ module Mushy
7
7
  def self.details
8
8
  {
9
9
  name: 'GlobalVariables',
10
- title: 'Global Variables',
10
+ title: 'Set global variables',
11
+ fluxGroup: { name: 'Flows' },
11
12
  description: 'Add global variables to use in any future flux. Returns what was passed to it.',
12
13
  config: {
13
14
  values: {
@@ -17,6 +17,8 @@ module Mushy
17
17
  def self.details
18
18
  {
19
19
  name: 'Interval',
20
+ title: 'Start a flow on a regular interval',
21
+ fluxGroup: { name: 'Starters', position: 0 },
20
22
  description: 'Fire an event every X minutes.',
21
23
  config: {},
22
24
  }.tap do |c|
@@ -5,7 +5,9 @@ module Mushy
5
5
  def self.details
6
6
  {
7
7
  name: 'Ls',
8
+ title: 'List Files',
8
9
  description: 'Run the "ls" command.',
10
+ fluxGroup: { name: 'Files' },
9
11
  config: Mushy::Bash.details[:config].tap { |c| c.delete :command },
10
12
  }.tap do |c|
11
13
  c[:config][:recursive] = {
@@ -8,6 +8,7 @@ module Mushy
8
8
  {
9
9
  name: 'ParseHtml',
10
10
  title: 'Parse HTML',
11
+ fluxGroup: { name: 'Web' },
11
12
  description: 'Extract data from HTML.',
12
13
  config: {
13
14
  path: {
@@ -90,6 +90,7 @@ module Mushy
90
90
  }
91
91
  },
92
92
  }
93
+ config[:fluxGroup] = { name: 'Export' }
93
94
  end
94
95
  end
95
96
 
@@ -5,7 +5,9 @@ module Mushy
5
5
  def self.details
6
6
  {
7
7
  name: 'Pwd',
8
+ title: 'Get the working directory',
8
9
  description: 'Run the "pwd" command.',
10
+ fluxGroup: { name: 'Environment' },
9
11
  config: Mushy::Bash.details[:config].tap { |c| c.delete :command },
10
12
  }.tap do |c|
11
13
  c[:examples] = {
@@ -8,6 +8,7 @@ module Mushy
8
8
  {
9
9
  name: 'ReadCsv',
10
10
  title: 'Read CSV',
11
+ fluxGroup: { name: 'CSV' },
11
12
  description: 'Read CSV content into events.',
12
13
  config: {
13
14
  data: {
@@ -6,6 +6,7 @@ module Mushy
6
6
  {
7
7
  name: 'ReadFile',
8
8
  title: 'Read File',
9
+ fluxGroup: { name: 'Files' },
9
10
  description: 'Read a file.',
10
11
  config: {
11
12
  file: {
@@ -8,6 +8,7 @@ module Mushy
8
8
  {
9
9
  name: 'ReadJson',
10
10
  title: 'Deserialize JSON',
11
+ fluxGroup: { name: 'JSON' },
11
12
  description: 'Read JSON and output it as an event.',
12
13
  config: {
13
14
  key: {
@@ -92,6 +92,7 @@ module Mushy
92
92
  }
93
93
  },
94
94
  }
95
+ config[:fluxGroup] = { name: 'Export' }
95
96
  end
96
97
  end
97
98
 
@@ -5,7 +5,9 @@ module Mushy
5
5
  def self.details
6
6
  {
7
7
  name: 'SenseHatEnvironmentalSensors',
8
+ title: 'Read Environmental Sensors',
8
9
  description: 'Pull values from the Sense HAT environmental sensors.',
10
+ fluxGroup: { name: 'SenseHAT' },
9
11
  config: Mushy::SimplePythonProgram.default_config,
10
12
  }.tap do |c|
11
13
  measurements
@@ -5,7 +5,9 @@ module Mushy
5
5
  def self.details
6
6
  {
7
7
  name: 'SenseHatLedMatrix',
8
+ title: 'Use LED Matrix',
8
9
  description: 'Interface with the LED Matrix.',
10
+ fluxGroup: { name: 'SenseHAT' },
9
11
  config: Mushy::SimplePythonProgram.default_config.tap do |config|
10
12
  config[:get_pixels] = {
11
13
  description: 'Specify the pixels you want returned as events. Use "all" to return all 64, 3,3 to return x:3 y:3, or "none" to return none.',
@@ -6,6 +6,7 @@ module Mushy
6
6
  Mushy::Bash.details[:config].tap do |config|
7
7
  config.delete :command
8
8
  config.delete :directory
9
+ config[:fluxGroup] = { name: 'Execute' }
9
10
  end
10
11
  end
11
12
 
@@ -48,8 +48,9 @@ module Mushy
48
48
 
49
49
  def self.details
50
50
  {
51
- name: 'Smtp',
51
+ name: 'Send Email Using SMTP',
52
52
  description: 'Send email through SMTP.',
53
+ fluxGroup: { name: 'Email' },
53
54
  config: {
54
55
  from: {
55
56
  description: 'From whom the email will be sent.',
@@ -5,7 +5,8 @@ module Mushy
5
5
  def self.details
6
6
  {
7
7
  name: 'Stdout',
8
- title: 'Stdout / Print',
8
+ title: 'Export text to stdout',
9
+ fluxGroup: { name: 'Environment' },
9
10
  description: 'Standard Out',
10
11
  config: {
11
12
  message: {
@@ -5,7 +5,9 @@ module Mushy
5
5
  def self.details
6
6
  {
7
7
  name: 'Times',
8
+ title: 'Repeat an event X times',
8
9
  description: 'Return the event passed to it, X times.',
10
+ fluxGroup: { name: 'Flows' },
9
11
  config: {
10
12
  times: {
11
13
  description: 'The number of times this event should be returned.',
@@ -5,7 +5,8 @@ module Mushy
5
5
  def self.details
6
6
  {
7
7
  name: 'TwilioMessage',
8
- title: 'Twilio Message',
8
+ title: 'Send SMS',
9
+ fluxGroup: { name: 'Twilio' },
9
10
  description: 'Send a Twilio Message.',
10
11
  config: {
11
12
  account_sid: {
@@ -7,6 +7,7 @@ module Mushy
7
7
  name: 'WriteFile',
8
8
  title: 'Write File',
9
9
  description: 'Write a file.',
10
+ fluxGroup: { name: 'Files' },
10
11
  config: file_saving_config.merge({
11
12
  data: {
12
13
  description: 'The text to write. You can use Liquid templating here to pull data from the event, or write hardcoded data.',
@@ -9,6 +9,7 @@ module Mushy
9
9
  name: 'WriteJson',
10
10
  title: 'Serialize as JSON',
11
11
  description: 'Write the incoming event as JSON.',
12
+ fluxGroup: { name: 'JSON' },
12
13
  config: {
13
14
  key: {
14
15
  description: 'The key of the outgoing field that will contain the JSON.',
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.18.0'
7
+ s.version = '0.19.0'
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.18.0
4
+ version: 0.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darren Cauthon
@@ -172,6 +172,7 @@ extensions: []
172
172
  extra_rdoc_files: []
173
173
  files:
174
174
  - bin/mushy
175
+ - hey.mushy
175
176
  - lib/mushy.rb
176
177
  - lib/mushy/builder/api.rb
177
178
  - lib/mushy/builder/axios.rb