nextbot 1.1.9 → 1.1.17
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/basecommand.rb +37 -1
- data/lib/localcommand.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5de1e000e5a6824f2b819996080e2a024607c8a2
|
4
|
+
data.tar.gz: b559f10e15f0e9f4376a5606640ab773b9491382
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 871e0c579683c63a0ed95635fffa838c0d7220149ad767372039eb5506822b0a5557bee3b8f9cb47270b6c7562ec7a5e33f005d22e008d8ef100f222a94995a1
|
7
|
+
data.tar.gz: d693c0abd851905eb72facecce65146751b395a798c153d8cb3ee35cdea5a82759dbe4ff145b79ef6a8273c72b4b2f55e2408ce36509d1dd182f2b89a9837e50
|
data/lib/basecommand.rb
CHANGED
@@ -24,6 +24,12 @@ module BlackStack
|
|
24
24
|
#TYPE_EACH = 8
|
25
25
|
TYPE_CLOSE = 999 # close browser. params: n/a
|
26
26
|
|
27
|
+
STATUS_PENDING = 0
|
28
|
+
STATUS_ONGOING = 1
|
29
|
+
STATUS_FAILURE = 2
|
30
|
+
STATUS_SUCCESS = 3
|
31
|
+
STATUS_CANCELED = 4
|
32
|
+
|
27
33
|
def self.types()
|
28
34
|
[
|
29
35
|
TYPE_START,
|
@@ -41,8 +47,18 @@ module BlackStack
|
|
41
47
|
]
|
42
48
|
end # self.types
|
43
49
|
|
50
|
+
def self.statuses()
|
51
|
+
[
|
52
|
+
STATUS_PENDING,
|
53
|
+
STATUS_ONGOING,
|
54
|
+
STATUS_FAILURE,
|
55
|
+
STATUS_SUCCESS,
|
56
|
+
STATUS_CANCELED,
|
57
|
+
]
|
58
|
+
end
|
59
|
+
|
44
60
|
def self.typeDescription(n)
|
45
|
-
return "
|
61
|
+
return "start" if n == TYPE_START
|
46
62
|
return "login" if n == TYPE_LOGIN
|
47
63
|
return "goto" if n == TYPE_GOTO
|
48
64
|
#return "find" if n == TYPE_FIND
|
@@ -54,7 +70,27 @@ module BlackStack
|
|
54
70
|
#return "exists" if n == TYPE_EXISTS
|
55
71
|
#return "each" if n == TYPE_EACH
|
56
72
|
return "close" if n == TYPE_CLOSE
|
73
|
+
nil
|
74
|
+
end # self.typeDescription
|
75
|
+
|
76
|
+
def self.statusDescription(n)
|
77
|
+
return "pending" if n == STATUS_PENDING
|
78
|
+
return "ongoing" if n == STATUS_ONGOING
|
79
|
+
return "failure" if n == STATUS_FAILURE
|
80
|
+
return "success" if n == STATUS_SUCCESS
|
81
|
+
return "canceled" if n == STATUS_CANCELED
|
82
|
+
nil
|
83
|
+
end # self.typeDescription
|
84
|
+
|
85
|
+
def self.statusColor(n)
|
86
|
+
return "orange" if n == STATUS_PENDING
|
87
|
+
return "blue" if n == STATUS_ONGOING
|
88
|
+
return "red" if n == STATUS_FAILURE
|
89
|
+
return "green" if n == STATUS_SUCCESS
|
90
|
+
return "black" if n == STATUS_CANCELED
|
91
|
+
nil
|
57
92
|
end # self.typeDescription
|
93
|
+
|
58
94
|
end # module BaseCommand
|
59
95
|
end # module NextBot
|
60
96
|
end # module BlackStack
|
data/lib/localcommand.rb
CHANGED
@@ -10,6 +10,18 @@ module BlackStack
|
|
10
10
|
include BaseCommand
|
11
11
|
Command.dataset = Command.dataset.disable_insert_output
|
12
12
|
|
13
|
+
# decide the status of this command, based on both the run_start_time, run_end_time and run_error_description
|
14
|
+
def status()
|
15
|
+
com = self
|
16
|
+
commandstatus = nil
|
17
|
+
commandstatus = BlackStack::NextBot::BaseCommand::STATUS_PENDING if com.run_start_time.nil?
|
18
|
+
commandstatus = BlackStack::NextBot::BaseCommand::STATUS_ONGOING if !com.run_start_time.nil? && com.run_end_time.nil? && com.run_error_description.nil?
|
19
|
+
commandstatus = BlackStack::NextBot::BaseCommand::STATUS_FAILURE if !com.run_start_time.nil? && com.run_end_time.nil? && !com.run_error_description.nil?
|
20
|
+
commandstatus = BlackStack::NextBot::BaseCommand::STATUS_CANCELED if !com.run_start_time.nil? && !com.run_end_time.nil? && com.run_success.nil?
|
21
|
+
commandstatus = BlackStack::NextBot::BaseCommand::STATUS_SUCCESS if !com.run_start_time.nil? && !com.run_end_time.nil? && !com.run_success.nil?
|
22
|
+
commandstatus
|
23
|
+
end
|
24
|
+
|
13
25
|
# load the next command to be performed by a certain worker.
|
14
26
|
def self.load_next(id_worker)
|
15
27
|
row = DB[
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nextbot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leandro Daniel Sardi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: stealth_browser_automation
|