mushy 0.2.0 → 0.2.1

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: dc571150c0fa3c2315c75186d48836987ca92d93045de5af848fe450c975a039
4
- data.tar.gz: cbd83a5b9fa9c0106b6891afa33eeb16ddd947bba61c62f13b6ff7e7a574ee0e
3
+ metadata.gz: 0a746bd3fc6a56c75327b154456d7fe9539af431ed78480c21bbf022990007f9
4
+ data.tar.gz: 3b31a72b3ab2a2caab0a93535c4433b77f7b66538f6ee5617a6b2a747af33a95
5
5
  SHA512:
6
- metadata.gz: 720fb42b4b3df8d46cd7e26a87b793e0d41111f12652d588c0378160a00af08de05bedcb32920d1ce01c2c0efe135caaa48a939edd6b25822f8383cac3acdd1a
7
- data.tar.gz: 1707b73e264d067362a7bd00e48558a9981c807319ff925e92c4fc829cbf8129aac14f31dd0edaba53354893de2ec4be633eebe9da2d882ec568a6394e852d9f
6
+ metadata.gz: 21e699536cb12cfc6108ed415d491f67bd080882dec6a6a58d4a5674ee8b597f2457f4693f34612f504f0b29a2642cc0005e516e80d01c37e4632168e6c948be
7
+ data.tar.gz: b175f8be7b8f4a87bd5c41235a7f6ca3d88e09ec334b702de67b224947869bf53d4dffe3853eec5e179436f727fa53b170998c7e799ef9a26112c9f513a95de7
data/lib/mushy.rb CHANGED
@@ -3,7 +3,7 @@ require 'symbolized'
3
3
 
4
4
  Dir[File.dirname(__FILE__) + '/mushy/*.rb'].each { |f| require f }
5
5
 
6
- important_flux_files = ['bash'].map { |x| "#{x}.rb" }
6
+ important_flux_files = ['bash', 'browser'].map { |x| "#{x}.rb" }
7
7
  Dir[File.dirname(__FILE__) + '/mushy/fluxs/*.rb']
8
8
  .sort_by { |f| important_flux_files.any? { |x| f.end_with?(x) } ? 0 : 1 }
9
9
  .each { |f| require f }
@@ -107,7 +107,7 @@ module Mushy
107
107
  };
108
108
  },
109
109
  props: ['label', 'placeholder', 'disabled', 'readonly', 'value', 'description', 'view'],
110
- template: '<div><mip-h4 :id="id" :label="label" :description="description"></mip-h4> <pre><code>{{show(view, value)}}</code></pre><button :disabled="view==\\'beautiful\\'" v-on:click.prevent.stop="view=toggle(view)">{{(view == \\'beautiful\\' ? \\'View Smaller\\' : \\'View Pretty\\')}}</button><button :disabled="view!=\\'beautiful\\'" v-on:click.prevent.stop="view=toggle(view)">View Smaller</button><button v-on:click.prevent.stop="copy(view, value)">Copy</button></div>'
110
+ template: '<div><mip-h4 :id="id" :label="label" :description="description"></mip-h4> <pre><code>{{show(view, value)}}</code></pre><button :disabled="view==\\'beautiful\\'" v-on:click.prevent.stop="view=toggle(view)">View Pretty</button><button :disabled="view!=\\'beautiful\\'" v-on:click.prevent.stop="view=toggle(view)">View Smaller</button><button v-on:click.prevent.stop="copy(view, value)">Copy</button></div>'
111
111
  },
112
112
  radio: {
113
113
  props: ['label', 'value', 'options', 'description', 'shrink'],
@@ -105,11 +105,17 @@ module Mushy
105
105
  body: browser.body
106
106
  }
107
107
 
108
+ result = special_browser_action browser, result
109
+
108
110
  browser.quit
109
111
 
110
112
  result
111
113
  end
112
114
 
115
+ def special_browser_action browser, result
116
+ result
117
+ end
118
+
113
119
  def get_the_cookies_from event, config
114
120
  cookies = (event[config[:carry_cookies_from].to_sym])
115
121
  cookies = [] unless cookies.is_a?(Array)
@@ -0,0 +1,46 @@
1
+ module Mushy
2
+
3
+ class Screenshot < Browser
4
+
5
+ def self.details
6
+ details = Browser.details
7
+ details['name'] = 'Screenshot'
8
+ details['description'] = 'Take a screenshot of the browser.'
9
+
10
+ details[:config][:path] = {
11
+ description: 'The path of the file to save.',
12
+ type: 'text',
13
+ value: 'picture.jpg',
14
+ }
15
+ details[:config][:quality] = {
16
+ description: 'The quality of the image, a value beteen 0-100. Only applies to jpg.',
17
+ type: 'integer',
18
+ shrink: true,
19
+ value: '',
20
+ }
21
+ details[:config][:full] = {
22
+ description: 'Take a screenshot of the entire page. If false, the screenshot is limited to the viewport.',
23
+ type: 'boolean',
24
+ shrink: true,
25
+ value: '',
26
+ }
27
+ details
28
+ end
29
+
30
+ def special_browser_action browser, result
31
+
32
+ options = {
33
+ path: config[:path],
34
+ full: ['true', ''].include?(config[:full].to_s),
35
+ quality: (config[:quality].to_s == '' ? '100' : config[:quality]).to_i
36
+ }
37
+
38
+ browser.screenshot options
39
+
40
+ options
41
+
42
+ end
43
+
44
+ end
45
+
46
+ 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.2.0'
7
+ s.version = '0.2.1'
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.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darren Cauthon
@@ -150,6 +150,7 @@ files:
150
150
  - lib/mushy/fluxs/ls.rb
151
151
  - lib/mushy/fluxs/parse_html.rb
152
152
  - lib/mushy/fluxs/read_csv.rb
153
+ - lib/mushy/fluxs/screenshot.rb
153
154
  - lib/mushy/fluxs/write_file.rb
154
155
  - lib/mushy/masher.rb
155
156
  - lib/mushy/run.rb