procodile 1.0.9 → 1.0.10
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/procodile/config.rb +22 -3
- data/lib/procodile/instance.rb +3 -0
- data/lib/procodile/process.rb +20 -1
- data/lib/procodile/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc9014711e488092ae55249f9fcda8dbb2fb9cc1
|
4
|
+
data.tar.gz: 9181ab265781b1b39a20524705eab6b6c31117e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b12e1eb9fb33548ea5b01d757a73cf377a024cc6e5a0877168fe1240e359c29f569a9b7fcc888c1d8d20008dcdad54497292b79471db1d5efc44b848b2f48a6
|
7
|
+
data.tar.gz: 135e12b6084a9cddad8736913bec02ab0dd591728f212340e60e7f83302887dc80551adc09b19cf220306ebde3e742f8b6fc6669cc7794228f84d1f0a39546c7
|
data/lib/procodile/config.rb
CHANGED
@@ -99,7 +99,22 @@ module Procodile
|
|
99
99
|
end
|
100
100
|
|
101
101
|
def log_path
|
102
|
-
|
102
|
+
log_path = fetch(local_options['log_path']) || fetch(options['log_path'])
|
103
|
+
if log_path
|
104
|
+
File.expand_path(log_path, @root)
|
105
|
+
elsif log_path.nil? && self.log_root
|
106
|
+
File.join(self.log_root, 'procodile.log')
|
107
|
+
else
|
108
|
+
File.expand_path("procodile.log", @root)
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
def log_root
|
113
|
+
if log_root = (fetch(local_options['log_root']) || fetch(options['log_root']))
|
114
|
+
File.expand_path(log_root, @root)
|
115
|
+
else
|
116
|
+
nil
|
117
|
+
end
|
103
118
|
end
|
104
119
|
|
105
120
|
def sock_path
|
@@ -128,9 +143,13 @@ module Procodile
|
|
128
143
|
|
129
144
|
def fetch(value, default = nil)
|
130
145
|
if value.is_a?(Hash)
|
131
|
-
value
|
146
|
+
if value.has_key?(@environment)
|
147
|
+
value[@environment]
|
148
|
+
else
|
149
|
+
default
|
150
|
+
end
|
132
151
|
else
|
133
|
-
value
|
152
|
+
value.nil? ? default : value
|
134
153
|
end
|
135
154
|
end
|
136
155
|
|
data/lib/procodile/instance.rb
CHANGED
@@ -121,6 +121,9 @@ module Procodile
|
|
121
121
|
@supervisor.add_instance(self, io)
|
122
122
|
::Process.detach(@pid)
|
123
123
|
Procodile.log(@process.log_color, description, "Started with PID #{@pid}" + (@tag ? " (tagged with #{@tag})" : ''))
|
124
|
+
if self.process.log_path
|
125
|
+
Procodile.log(@process.log_color, description, "Logging to #{self.process.log_path}")
|
126
|
+
end
|
124
127
|
@started_at = Time.now
|
125
128
|
end
|
126
129
|
end
|
data/lib/procodile/process.rb
CHANGED
@@ -70,7 +70,26 @@ module Procodile
|
|
70
70
|
# none, output will be written to the supervisor log.
|
71
71
|
#
|
72
72
|
def log_path
|
73
|
-
@options['log_path'] ? File.expand_path(@options['log_path'], @config.root) :
|
73
|
+
@options['log_path'] ? File.expand_path(@options['log_path'], @config.root) : default_log_path
|
74
|
+
end
|
75
|
+
|
76
|
+
#
|
77
|
+
# Return the defualt log file name
|
78
|
+
#
|
79
|
+
def default_log_file_name
|
80
|
+
@options['log_file_name'] || "#{@name}.log"
|
81
|
+
end
|
82
|
+
|
83
|
+
#
|
84
|
+
# Return the log path for this process if no log path is provided and split logs
|
85
|
+
# is enabled
|
86
|
+
#
|
87
|
+
def default_log_path
|
88
|
+
if @config.log_root
|
89
|
+
File.join(@config.log_root, default_log_file_name)
|
90
|
+
else
|
91
|
+
nil
|
92
|
+
end
|
74
93
|
end
|
75
94
|
|
76
95
|
#
|
data/lib/procodile/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: procodile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Cooke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -75,4 +75,3 @@ specification_version: 4
|
|
75
75
|
summary: This gem will help you run Ruby processes from a Procfile on Linux servers
|
76
76
|
in the background.
|
77
77
|
test_files: []
|
78
|
-
has_rdoc:
|