mushy 0.15.0 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mushy/builder/api.rb +41 -8
- data/lib/mushy/builder/documentation.rb +37 -0
- data/lib/mushy/builder/index.rb +71 -12
- data/lib/mushy/flux.rb +5 -1
- data/lib/mushy/fluxs/bash.rb +22 -0
- data/lib/mushy/fluxs/browser.rb +118 -0
- data/lib/mushy/fluxs/build_csv.rb +22 -0
- data/lib/mushy/fluxs/cli.rb +11 -0
- data/lib/mushy/fluxs/document.rb +14 -0
- data/lib/mushy/fluxs/environment.rb +12 -0
- data/lib/mushy/fluxs/file_watch.rb +29 -1
- data/lib/mushy/fluxs/filter.rb +55 -2
- data/lib/mushy/fluxs/format.rb +40 -1
- data/lib/mushy/fluxs/global_variables.rb +16 -1
- data/lib/mushy/fluxs/ls.rb +110 -0
- data/lib/mushy/fluxs/parse_html.rb +36 -1
- data/lib/mushy/fluxs/pdf.rb +71 -1
- data/lib/mushy/fluxs/pwd.rb +40 -1
- data/lib/mushy/fluxs/read_csv.rb +26 -0
- data/lib/mushy/fluxs/read_file.rb +23 -9
- data/lib/mushy/fluxs/read_json.rb +20 -7
- data/lib/mushy/fluxs/screenshot.rb +71 -2
- data/lib/mushy/fluxs/stdout.rb +27 -0
- data/lib/mushy/fluxs/times.rb +7 -0
- data/lib/mushy/fluxs/write_file.rb +47 -0
- data/lib/mushy/fluxs/write_json.rb +15 -0
- data/mushy.gemspec +1 -1
- metadata +3 -2
- data/lib/mushy/fluxs/print.rb +0 -26
@@ -5,7 +5,7 @@ module Mushy
|
|
5
5
|
def self.details
|
6
6
|
details = Browser.details
|
7
7
|
details[:name] = 'Screenshot'
|
8
|
-
details[:description] = 'Take a screenshot of the browser.'
|
8
|
+
details[:description] = 'Take a screenshot of the browser. This works the same as the Browser, but with a screenshot at the end.'
|
9
9
|
|
10
10
|
details[:config].merge!(Mushy::WriteFile.file_saving_config.tap do |x|
|
11
11
|
x[x.keys.first][:value] = 'file.jpg'
|
@@ -23,7 +23,76 @@ module Mushy
|
|
23
23
|
shrink: true,
|
24
24
|
value: '',
|
25
25
|
}
|
26
|
-
details
|
26
|
+
details.tap do |config|
|
27
|
+
config[:examples] = {
|
28
|
+
"Screenshot of google.com" => {
|
29
|
+
description: 'This will open https://www.google.com and take a screenshot.',
|
30
|
+
config: {
|
31
|
+
url: "https://www.google.com",
|
32
|
+
file: 'file.jpg'
|
33
|
+
},
|
34
|
+
result: {
|
35
|
+
url: "https://www.google.com/",
|
36
|
+
status: 200,
|
37
|
+
title: "Google",
|
38
|
+
cookies: [
|
39
|
+
{
|
40
|
+
name: "1P_JAR",
|
41
|
+
value: "2021-10-07-21",
|
42
|
+
domain: ".google.com",
|
43
|
+
path: "/",
|
44
|
+
expires: 1636232420.005369,
|
45
|
+
size: 19,
|
46
|
+
httpOnly: false,
|
47
|
+
secure: true,
|
48
|
+
session: false,
|
49
|
+
sameSite: "None",
|
50
|
+
priority: "Medium"
|
51
|
+
}
|
52
|
+
],
|
53
|
+
headers: {},
|
54
|
+
time: 1.520785498,
|
55
|
+
body: "...",
|
56
|
+
options: {
|
57
|
+
path: "file.jpg",
|
58
|
+
full: true,
|
59
|
+
quality: 100
|
60
|
+
},
|
61
|
+
file: {
|
62
|
+
inode: "439545",
|
63
|
+
hard_links: 1,
|
64
|
+
owner: "pi",
|
65
|
+
group: "pi",
|
66
|
+
size: 54269,
|
67
|
+
date: {
|
68
|
+
year: 2021,
|
69
|
+
month: 10,
|
70
|
+
day: 7,
|
71
|
+
hour: 16,
|
72
|
+
minute: 0,
|
73
|
+
second: 20,
|
74
|
+
nanosecond: 444437482,
|
75
|
+
utc_offset: -18000,
|
76
|
+
weekday: 4,
|
77
|
+
day_of_month: 7,
|
78
|
+
day_of_year: 280,
|
79
|
+
string: "2021-10-07 16:00:20 -0500",
|
80
|
+
epoch_integer: 1633640420,
|
81
|
+
epoch_float: 1633640420.4444375,
|
82
|
+
seconds_ago: 0.016297478
|
83
|
+
},
|
84
|
+
name: "file.jpg",
|
85
|
+
type: "-",
|
86
|
+
owner_permission: "rw-",
|
87
|
+
group_permission: "r--",
|
88
|
+
other_permission: "r--",
|
89
|
+
directory: "/home/pi/Desktop/mushy",
|
90
|
+
path: "/home/pi/Desktop/mushy/file.jpg"
|
91
|
+
}
|
92
|
+
}
|
93
|
+
},
|
94
|
+
}
|
95
|
+
end
|
27
96
|
end
|
28
97
|
|
29
98
|
def adjust input
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Mushy
|
2
|
+
|
3
|
+
class Stdout < Flux
|
4
|
+
|
5
|
+
def self.details
|
6
|
+
{
|
7
|
+
name: 'Stdout',
|
8
|
+
title: 'Stdout / Print',
|
9
|
+
description: 'Standard Out',
|
10
|
+
config: {
|
11
|
+
message: {
|
12
|
+
description: 'The message to display.',
|
13
|
+
type: 'text',
|
14
|
+
value: '{{message}}',
|
15
|
+
},
|
16
|
+
},
|
17
|
+
}
|
18
|
+
end
|
19
|
+
|
20
|
+
def process event, config
|
21
|
+
puts config[:message]
|
22
|
+
nil
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
data/lib/mushy/fluxs/times.rb
CHANGED
@@ -12,6 +12,13 @@ module Mushy
|
|
12
12
|
type: 'integer',
|
13
13
|
value: '1',
|
14
14
|
},
|
15
|
+
},
|
16
|
+
examples: {
|
17
|
+
"Basic Example" => {
|
18
|
+
input: {name: "Elephant"},
|
19
|
+
config: {times: 2},
|
20
|
+
result: [ { name: "Elephant", index: 0 }, { name: "Elephant", index: 1 } ],
|
21
|
+
}
|
15
22
|
}
|
16
23
|
}
|
17
24
|
end
|
@@ -5,6 +5,7 @@ module Mushy
|
|
5
5
|
def self.details
|
6
6
|
{
|
7
7
|
name: 'WriteFile',
|
8
|
+
title: 'Write File',
|
8
9
|
description: 'Write a file.',
|
9
10
|
config: file_saving_config.merge({
|
10
11
|
data: {
|
@@ -13,6 +14,52 @@ module Mushy
|
|
13
14
|
value: '{{data}}',
|
14
15
|
},
|
15
16
|
}),
|
17
|
+
examples: {
|
18
|
+
"Example" => {
|
19
|
+
description: 'Using this Flux to write the contents of a text file. Details about the file are returned.',
|
20
|
+
input: {
|
21
|
+
file: "data.csv",
|
22
|
+
content: "a,b,c\nd,e,f",
|
23
|
+
},
|
24
|
+
config: {
|
25
|
+
file: '{{file}}',
|
26
|
+
data: '{{content}}'
|
27
|
+
},
|
28
|
+
result: {
|
29
|
+
file: {
|
30
|
+
inode: "439540",
|
31
|
+
hard_links: 1,
|
32
|
+
owner: "pi",
|
33
|
+
group: "pi",
|
34
|
+
size: 3,
|
35
|
+
date: {
|
36
|
+
year: 2021,
|
37
|
+
month: 10,
|
38
|
+
day: 7,
|
39
|
+
hour: 15,
|
40
|
+
minute: 41,
|
41
|
+
second: 14,
|
42
|
+
nanosecond: 163590058,
|
43
|
+
utc_offset: -18000,
|
44
|
+
weekday: 4,
|
45
|
+
day_of_month: 7,
|
46
|
+
day_of_year: 280,
|
47
|
+
string: "2021-10-07 15:41:14 -0500",
|
48
|
+
epoch_integer: 1633639274,
|
49
|
+
epoch_float: 1633639274.1635902,
|
50
|
+
seconds_ago: 0.018665617
|
51
|
+
},
|
52
|
+
name: "file.csv",
|
53
|
+
type: "-",
|
54
|
+
owner_permission: "rw-",
|
55
|
+
group_permission: "r--",
|
56
|
+
other_permission: "r--",
|
57
|
+
directory: "/home/pi/Desktop/mushy",
|
58
|
+
path: "/home/pi/Desktop/mushy/file.csv"
|
59
|
+
}
|
60
|
+
}
|
61
|
+
},
|
62
|
+
}
|
16
63
|
}
|
17
64
|
end
|
18
65
|
|
@@ -7,6 +7,7 @@ module Mushy
|
|
7
7
|
def self.details
|
8
8
|
{
|
9
9
|
name: 'WriteJson',
|
10
|
+
title: 'Serialize as JSON',
|
10
11
|
description: 'Write the incoming event as JSON.',
|
11
12
|
config: {
|
12
13
|
key: {
|
@@ -15,6 +16,20 @@ module Mushy
|
|
15
16
|
value: 'json',
|
16
17
|
},
|
17
18
|
},
|
19
|
+
examples: {
|
20
|
+
"Example" => {
|
21
|
+
description: 'Using this Flux to convert input to a JSON string.',
|
22
|
+
input: {
|
23
|
+
people: [ { name: "John" }, { name: "Jane" } ]
|
24
|
+
},
|
25
|
+
config: {
|
26
|
+
key: 'apple'
|
27
|
+
},
|
28
|
+
result: {
|
29
|
+
apple: "{\"people\":[{\"name\":\"John\"},{\"name\":\"Jane\"}]}"
|
30
|
+
}
|
31
|
+
},
|
32
|
+
}
|
18
33
|
}
|
19
34
|
end
|
20
35
|
|
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.
|
7
|
+
s.version = '0.17.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.
|
4
|
+
version: 0.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Darren Cauthon
|
@@ -177,6 +177,7 @@ files:
|
|
177
177
|
- lib/mushy/builder/axios.rb
|
178
178
|
- lib/mushy/builder/bulma.rb
|
179
179
|
- lib/mushy/builder/dark.rb
|
180
|
+
- lib/mushy/builder/documentation.rb
|
180
181
|
- lib/mushy/builder/index.rb
|
181
182
|
- lib/mushy/builder/vue.rb
|
182
183
|
- lib/mushy/date_parts.rb
|
@@ -200,7 +201,6 @@ files:
|
|
200
201
|
- lib/mushy/fluxs/ls.rb
|
201
202
|
- lib/mushy/fluxs/parse_html.rb
|
202
203
|
- lib/mushy/fluxs/pdf.rb
|
203
|
-
- lib/mushy/fluxs/print.rb
|
204
204
|
- lib/mushy/fluxs/pwd.rb
|
205
205
|
- lib/mushy/fluxs/read_csv.rb
|
206
206
|
- lib/mushy/fluxs/read_file.rb
|
@@ -210,6 +210,7 @@ files:
|
|
210
210
|
- lib/mushy/fluxs/sense_hat_led_matrix.rb
|
211
211
|
- lib/mushy/fluxs/simple_python_program.rb
|
212
212
|
- lib/mushy/fluxs/smtp.rb
|
213
|
+
- lib/mushy/fluxs/stdout.rb
|
213
214
|
- lib/mushy/fluxs/times.rb
|
214
215
|
- lib/mushy/fluxs/write_file.rb
|
215
216
|
- lib/mushy/fluxs/write_json.rb
|
data/lib/mushy/fluxs/print.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
module Mushy
|
2
|
-
|
3
|
-
class Print < Flux
|
4
|
-
|
5
|
-
def self.details
|
6
|
-
{
|
7
|
-
name: 'Print',
|
8
|
-
description: 'Print output to the screen.',
|
9
|
-
config: {
|
10
|
-
message: {
|
11
|
-
description: 'The message to display',
|
12
|
-
type: 'text',
|
13
|
-
value: '',
|
14
|
-
},
|
15
|
-
}
|
16
|
-
}
|
17
|
-
end
|
18
|
-
|
19
|
-
def process event, config
|
20
|
-
puts config[:message]
|
21
|
-
{}
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|
25
|
-
|
26
|
-
end
|