mushy 0.4.0 → 0.4.1
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/fluxs/browser.rb +1 -1
- data/lib/mushy/fluxs/screenshot.rb +7 -7
- data/lib/mushy/fluxs/write_file.rb +29 -19
- 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: 78f078fac4fc19b1ee58323ce2ceaed770613dd8c71901a8a9a7f4ba03c5b413
|
4
|
+
data.tar.gz: f19bde198e025b8478400fd33bbd8471b688b33b6caac27ae1f78441441bd895
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6aff2c9d3d21517c385a5d1f5d0464ae37c77f281c32ef3a5f520cd667ad6354399f3be8e589dcd5883e4a8c0c60d321709373dd174dcd27813c77cb99c1958f
|
7
|
+
data.tar.gz: cc0c2218bc455af76721edf9f9358828a21a45635c31e4f5b6a049b03c98ba7f83ea2212567426fad6114042d29ccc0a02251ee502be69c16eeeca0763c9cb16
|
data/lib/mushy/fluxs/browser.rb
CHANGED
@@ -7,11 +7,10 @@ module Mushy
|
|
7
7
|
details['name'] = 'Screenshot'
|
8
8
|
details['description'] = 'Take a screenshot of the browser.'
|
9
9
|
|
10
|
-
details[:config]
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
}
|
10
|
+
details[:config].merge!(Mushy::WriteFile.file_saving_config.tap do |x|
|
11
|
+
x[x.keys.first][:value] = 'file.jpg'
|
12
|
+
end)
|
13
|
+
|
15
14
|
details[:config][:quality] = {
|
16
15
|
description: 'The quality of the image, a value beteen 0-100. Only applies to jpg.',
|
17
16
|
type: 'integer',
|
@@ -33,15 +32,16 @@ module Mushy
|
|
33
32
|
the_result = input[:result]
|
34
33
|
the_config = input[:config]
|
35
34
|
|
35
|
+
file = Mushy::WriteFile.get_file_from config
|
36
36
|
options = {
|
37
|
-
path:
|
37
|
+
path: file,
|
38
38
|
full: ['true', ''].include?(the_config[:full].to_s),
|
39
39
|
quality: (the_config[:quality].to_s == '' ? '100' : the_config[:quality]).to_i
|
40
40
|
}
|
41
41
|
|
42
42
|
the_browser.screenshot options
|
43
43
|
|
44
|
-
options
|
44
|
+
options.merge the_result
|
45
45
|
|
46
46
|
end
|
47
47
|
|
@@ -6,30 +6,40 @@ module Mushy
|
|
6
6
|
{
|
7
7
|
name: 'WriteFile',
|
8
8
|
description: 'Write a file.',
|
9
|
-
config: {
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
description: 'The directory in which to write the file. Leave blank for the current directory.',
|
17
|
-
type: 'text',
|
18
|
-
value: '',
|
19
|
-
},
|
20
|
-
data: {
|
21
|
-
description: 'The text to write. You can use Liquid templating here to pull data from the event, or write hardcoded data.',
|
22
|
-
type: 'text',
|
23
|
-
value: '{{data}}',
|
24
|
-
},
|
25
|
-
},
|
9
|
+
config: file_saving_config.merge({
|
10
|
+
data: {
|
11
|
+
description: 'The text to write. You can use Liquid templating here to pull data from the event, or write hardcoded data.',
|
12
|
+
type: 'text',
|
13
|
+
value: '{{data}}',
|
14
|
+
},
|
15
|
+
}),
|
26
16
|
}
|
27
17
|
end
|
28
18
|
|
29
|
-
def
|
30
|
-
|
19
|
+
def self.file_saving_config
|
20
|
+
{
|
21
|
+
name: {
|
22
|
+
description: 'The name of the file.',
|
23
|
+
type: 'text',
|
24
|
+
value: 'file.csv',
|
25
|
+
},
|
26
|
+
directory: {
|
27
|
+
description: 'The directory in which to write the file. Leave blank for the current directory.',
|
28
|
+
shrink: true,
|
29
|
+
type: 'text',
|
30
|
+
value: '',
|
31
|
+
},
|
32
|
+
}
|
33
|
+
end
|
31
34
|
|
35
|
+
def self.get_file_from config
|
36
|
+
file = config[:name]
|
32
37
|
file = File.join(config[:directory], file) if config[:directory].to_s != ''
|
38
|
+
file
|
39
|
+
end
|
40
|
+
|
41
|
+
def process event, config
|
42
|
+
file = self.class.get_file_from config
|
33
43
|
|
34
44
|
File.open(file, 'w') { |f| f.write config[:data] }
|
35
45
|
|
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.4.
|
7
|
+
s.version = '0.4.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.'
|