web47command 0.0.1 → 0.0.2
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/app/models/command_job.rb +3 -3
- data/lib/app/models/command_job_log.rb +13 -3
- data/lib/web47command.rb +0 -1
- data/lib/web47command/version.rb +1 -1
- metadata +2 -3
- data/lib/app/models/job_log.rb +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e041303b05e1d85a36072634de3396c6722b8b4789b7fcc78d9099f876c208f8
|
4
|
+
data.tar.gz: 64c78bc05a3a2fcb38c164186558aeab8e4cffad9b880ce0974769eab4fbbc08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08bd97add54ae82aa6b3f9ce6de8a4947275b2065c286eb8d049c6b4e75705d29cd6a713c0b37a6e45d14f4bc3be9ed0ab6ac764c51a5db5270ea28ca5416d10'
|
7
|
+
data.tar.gz: 4ed492b6ad8442e267a5430acde97a86ef464d05dbc7b3c9fa38736ab154327188bb745c566a3e146f0a8e1a7c6a39ce9185f56309c9b1e292f9f7eb738a9062
|
@@ -25,7 +25,7 @@ class CommandJob
|
|
25
25
|
#
|
26
26
|
# Relationships
|
27
27
|
#
|
28
|
-
has_many :logs, class_name: '
|
28
|
+
has_many :logs, class_name: 'CommandJobLog', dependent: :destroy
|
29
29
|
#
|
30
30
|
# Validations
|
31
31
|
#
|
@@ -225,7 +225,7 @@ class CommandJob
|
|
225
225
|
end
|
226
226
|
output = 'Success' if output.blank?
|
227
227
|
command = mask_keywords(command, options[:mask_texts])
|
228
|
-
|
228
|
+
logs.create!(dir: dir, command: command, message: output)
|
229
229
|
check_for_text(output, options[:error_texts], true)
|
230
230
|
check_for_text(output, options[:required_texts], false)
|
231
231
|
output
|
@@ -264,6 +264,6 @@ class CommandJob
|
|
264
264
|
# Add a job log message
|
265
265
|
#
|
266
266
|
def add_log(message)
|
267
|
-
|
267
|
+
logs.create!(message: message)
|
268
268
|
end
|
269
269
|
end
|
@@ -3,21 +3,31 @@
|
|
3
3
|
#
|
4
4
|
# Capture command log messages for a given job
|
5
5
|
#
|
6
|
-
class CommandJobLog
|
6
|
+
class CommandJobLog
|
7
|
+
include StandardModel
|
7
8
|
#
|
8
9
|
# Fields
|
9
10
|
#
|
11
|
+
field :message, type: String
|
10
12
|
field :command, type: String
|
11
13
|
field :dir, type: String
|
12
14
|
#
|
15
|
+
# Relationships
|
16
|
+
#
|
17
|
+
belongs_to :job, inverse_of: :logs, class_name: 'CommandJob'
|
18
|
+
#
|
13
19
|
# Validations
|
14
20
|
#
|
15
|
-
validates :
|
21
|
+
validates :message, presence: true
|
16
22
|
|
17
23
|
#
|
18
24
|
# Display message
|
19
25
|
#
|
20
26
|
def display_message
|
21
|
-
|
27
|
+
if dir.present?
|
28
|
+
"Dir: #{dir}\nCommand: #{command}\nOutput: #{message}"
|
29
|
+
else
|
30
|
+
message
|
31
|
+
end
|
22
32
|
end
|
23
33
|
end
|
data/lib/web47command.rb
CHANGED
data/lib/web47command/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: web47command
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Schroeder
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -314,7 +314,6 @@ files:
|
|
314
314
|
- lib/app/jobs/cron/trim_jobs.rb
|
315
315
|
- lib/app/models/command_job.rb
|
316
316
|
- lib/app/models/command_job_log.rb
|
317
|
-
- lib/app/models/job_log.rb
|
318
317
|
- lib/web47command.rb
|
319
318
|
- lib/web47command/version.rb
|
320
319
|
homepage: https://app47.com
|
data/lib/app/models/job_log.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
#
|
4
|
-
# Capture log messages for a given job
|
5
|
-
#
|
6
|
-
class JobLog
|
7
|
-
include StandardModel
|
8
|
-
#
|
9
|
-
# Fields
|
10
|
-
#
|
11
|
-
field :message, type: String
|
12
|
-
#
|
13
|
-
# Relationships
|
14
|
-
#
|
15
|
-
belongs_to :job, inverse_of: :logs, class_name: 'CommandJob'
|
16
|
-
#
|
17
|
-
# Validations
|
18
|
-
#
|
19
|
-
validates :message, presence: true
|
20
|
-
|
21
|
-
#
|
22
|
-
# Display message
|
23
|
-
#
|
24
|
-
def display_message
|
25
|
-
message
|
26
|
-
end
|
27
|
-
end
|