process-sanity 0.0.7 → 0.0.71
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 909c891e9561896f1e5c1df5f05d623dca86a35b
|
4
|
+
data.tar.gz: 6b19db4a596474a6430137a43881c6737894a02b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5c5ec9897a310041e39a3a32aed3c5625a20febf99250a3f472806f4a2d42d2c41f247b82805880e85e11511be900692c5727f60e19c95691408a3a2c146b2e
|
7
|
+
data.tar.gz: b9d21f09f1c372b6267f7cc2c47e26aa3aa43473eda21b5419808c3882d3a26895656060591b5fe9a2d8a3fb51357ee5a061c7cfe2599cecd16d3ecd5997825d
|
@@ -1,16 +1,16 @@
|
|
1
1
|
require 'process_sanity'
|
2
2
|
ProcessSanity.setup do |config|
|
3
3
|
|
4
|
-
#Do nothing if the gem isn't running under the Rails process (e.g the process that is running is rspec
|
5
|
-
if $0.split("/").last.downcase
|
4
|
+
#Do nothing if the gem isn't running under the Rails process (e.g the process that is running is rspec\resque\sidekiq etc etc)
|
5
|
+
if $0.split("/").last.downcase == 'rails'
|
6
6
|
|
7
7
|
#array of your environment's processes to check against
|
8
8
|
#for example:
|
9
|
-
#
|
9
|
+
#config.names = ['redis', 'postgres', 'sidekiq']
|
10
10
|
config.names = []
|
11
11
|
|
12
12
|
#Stops the server if any of the listed processes is not running
|
13
|
-
#
|
13
|
+
#config.is_aggressive = true
|
14
14
|
|
15
15
|
#Use desktop notifications
|
16
16
|
#config.desktop_notifications = true
|
data/lib/process_sanity.rb
CHANGED
@@ -9,7 +9,7 @@ module ProcessSanity
|
|
9
9
|
names.each do |process_name|
|
10
10
|
id = system("pgrep -f #{process_name} > /dev/null 2>&1")
|
11
11
|
unless id
|
12
|
-
puts "Process-Sanity: #{process_name} IS A DEPENDENCY YET IT IS NOT RUNNING!".colorize(
|
12
|
+
puts "Process-Sanity: #{process_name} IS A DEPENDENCY YET IT IS NOT RUNNING!".colorize(:green)
|
13
13
|
errors.push(process_name)
|
14
14
|
end
|
15
15
|
end
|
@@ -1,21 +1,25 @@
|
|
1
1
|
require 'process_sanity'
|
2
2
|
ProcessSanity.setup do |config|
|
3
3
|
|
4
|
-
#Do nothing if the gem isn't running under the Rails process (e.g the process that is running is rspec
|
5
|
-
|
4
|
+
#Do nothing if the gem isn't running under the Rails process (e.g the process that is running is rspec\resque\sidekiq etc etc)
|
5
|
+
if $0.split("/").last.downcase == 'rails'
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
#array of your environment's processes to check against
|
8
|
+
#for example:
|
9
|
+
#config.names = ['redis', 'postgres', 'sidekiq']
|
10
|
+
config.names = []
|
11
11
|
|
12
|
-
|
13
|
-
|
12
|
+
#Stops the server if any of the listed processes is not running
|
13
|
+
#config.is_aggressive = true
|
14
14
|
|
15
|
-
|
16
|
-
|
15
|
+
#Use desktop notifications
|
16
|
+
#config.desktop_notifications = true
|
17
17
|
|
18
|
+
else
|
19
|
+
config.skip_run = true
|
20
|
+
end
|
18
21
|
|
19
22
|
|
20
23
|
|
21
|
-
|
24
|
+
|
25
|
+
end
|