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 +4 -4
- data/lib/mushy/builder/index.rb +24 -10
- data/lib/mushy/fluxs/browser.rb +7 -0
- data/mushy.gemspec +1 -1
- metadata +1 -1
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 971693353748e8d21c56dfa911cf669b79a10fce38530eaeb9c8ab019c69be73
         | 
| 4 | 
            +
              data.tar.gz: 58ef99b38f1ebc13fbd68bca3e6597b43ba4310313e780ab38c55e14dcc31b07
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: f124d798c6d44e1ecefc2b5b44726c20f7c5e07ed25182776cf2db69e230ef646d84d45627f5d645ff04be725c7db891bf597c4317bd42f9372a070b425cc72c
         | 
| 7 | 
            +
              data.tar.gz: f7a5875f509dd43c1543c89636a9e435ff0cabec094fe109113f173fb26e6eef6bd0a0f0634dc35f1ee78f9c71f6e7e6fd166515f222383f3fcef8d4be4f4deb
         | 
    
        data/lib/mushy/builder/index.rb
    CHANGED
    
    | @@ -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. | 
| 23 | 
            -
                        <a href="#" v-if="setup. | 
| 24 | 
            -
                        <div v-if="setup. | 
| 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: ' | 
| 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. | 
| 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:  | 
| 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( | 
| 328 | 
            +
                                 saveFlow: function(input)
         | 
| 316 329 | 
             
                                 {
         | 
| 317 | 
            -
                                      | 
| 330 | 
            +
                                     var setup = input.setup;
         | 
| 331 | 
            +
                                     var flow = input.flow;
         | 
| 318 332 | 
             
                                     axios.post('/save', flow)
         | 
| 319 333 | 
             
                                        .then(function(result){
         | 
| 320 | 
            -
                                             | 
| 334 | 
            +
                                            Vue.set(setup, 'show', false);
         | 
| 321 335 | 
             
                                        });
         | 
| 322 336 | 
             
                                 },
         | 
| 323 337 | 
             
                                 configs: configs,
         | 
    
        data/lib/mushy/fluxs/browser.rb
    CHANGED
    
    | @@ -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. | 
| 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.'
         |