oye 0.1.5 → 0.1.6
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/Gemfile.lock +1 -1
- data/README.md +2 -2
- data/lib/oye/version.rb +1 -1
- data/lib/oye.rb +10 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7935458962c14a5f63b8f797c1dcd683ba0f36a1ae22fef2f0172f4208050685
|
4
|
+
data.tar.gz: cbd7fe1517e17d8a788aa0019941f3e7faf64151a1937bb8717109cbfcdd80a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 596b27d020a8f96623718ffe04e17dbe83da95b2f9af28e3504dfb58f5076dab3cd6e9183fabcd6f26d1e6e12cfdd76558fd657094ac4d52fc2fbee251590715
|
7
|
+
data.tar.gz: 97d61ce5860418155b40d2d07938d2a99fccf1db3c6492cbc2710d0afe23da63be040abfbd00139602d9bb2828eb5c7b5c05ec45e3ee980fd7249c0c284e49bc
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -9,5 +9,5 @@ A continuous monitoring tool that does a few things:
|
|
9
9
|
[ ] use multithreaading. each thread should watch a unique repo.
|
10
10
|
[ ] run rails tests inside Oye.monitor
|
11
11
|
[ ] check for irregularities in @repos, e.g two repeated cloned repos
|
12
|
-
[ ] give warning if port is not open
|
13
|
-
|
12
|
+
[ ] give warning if port is not open by using `port_open?` method
|
13
|
+
[ ] why is the trap with `FileUtils.rm_f(oye_pidfile)` not removing the PID file
|
data/lib/oye/version.rb
CHANGED
data/lib/oye.rb
CHANGED
@@ -10,11 +10,9 @@ module Oye
|
|
10
10
|
class Error < StandardError; end
|
11
11
|
|
12
12
|
DEFAULT_WATCH_INTERVAL = 5
|
13
|
-
DEFAULT_PORT = 3000
|
14
13
|
DEFAULT_ENVIRONMENTS = %w(development production test)
|
15
14
|
LOG_FORMAT = "[%Y-%m-%d %H:%M:%S]"
|
16
15
|
|
17
|
-
|
18
16
|
class << self
|
19
17
|
def start(args)
|
20
18
|
help if(args.include?('-h') or args.include?('--help'))
|
@@ -48,7 +46,6 @@ module Oye
|
|
48
46
|
end
|
49
47
|
end
|
50
48
|
|
51
|
-
@port = DEFAULT_PORT
|
52
49
|
if(args.include?('-p') or args.include?('--port'))
|
53
50
|
args.map! {|a| a == '--port' ? '-p' : a}
|
54
51
|
_, @port = args.slice(args.index('-p'),2)
|
@@ -69,6 +66,10 @@ module Oye
|
|
69
66
|
end
|
70
67
|
end
|
71
68
|
|
69
|
+
@unicorn_default_options = "-E #{@environment} -D"
|
70
|
+
|
71
|
+
@unicorn_default_options << " -l #{@port}" if @port
|
72
|
+
|
72
73
|
monitor
|
73
74
|
end
|
74
75
|
|
@@ -85,7 +86,7 @@ module Oye
|
|
85
86
|
-h, --help print this message
|
86
87
|
-i, --info [PATTERN] print info of repos matching PATTERN (default .*)
|
87
88
|
-l, --list print monitored repos
|
88
|
-
-p, --port PORT port for app server
|
89
|
+
-p, --port PORT port for app server
|
89
90
|
-r, --restart restart oye
|
90
91
|
-s, --stop stop oye
|
91
92
|
-t, --time SECS time interval for repo monitoring (default 5)
|
@@ -191,7 +192,11 @@ module Oye
|
|
191
192
|
end
|
192
193
|
end
|
193
194
|
|
194
|
-
|
195
|
+
unicorn_options = @unicorn_default_options << " -c #{unicorn_file(dir)}"
|
196
|
+
|
197
|
+
%x{unicorn_rails #{unicorn_options}}
|
198
|
+
|
199
|
+
log(dir, status: :info, message: "Started app server")
|
195
200
|
rescue => e
|
196
201
|
log(dir, status: :warn, message: "#{__method__.to_s} (#{e.message})")
|
197
202
|
end
|
@@ -258,8 +263,6 @@ module Oye
|
|
258
263
|
exit
|
259
264
|
end
|
260
265
|
|
261
|
-
# TODO ensure that pid corresponds to 'oye' process. maybe check
|
262
|
-
# command name like 'ps(1)'
|
263
266
|
def stop
|
264
267
|
Process.kill oye_pid
|
265
268
|
end
|