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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 67120d0d1a0506c6a9225592182ee09bedd050ab95f04cf61c4e42754254951a
4
- data.tar.gz: 790d5ec5e2498485fc1c90ea8bd26f9fceb9ea4de0237fe19e04ef066f40402e
3
+ metadata.gz: 7935458962c14a5f63b8f797c1dcd683ba0f36a1ae22fef2f0172f4208050685
4
+ data.tar.gz: cbd7fe1517e17d8a788aa0019941f3e7faf64151a1937bb8717109cbfcdd80a7
5
5
  SHA512:
6
- metadata.gz: 2d5f6a7eeca4d0104f870879af37bd0e58212b10f662cf35bfa73707612be481ff151922ca53cc54c47e877fa08ce3a24ddbdd6bda6a1059734c395214e4add2
7
- data.tar.gz: 6ac229b0372fbf7a7a994e2448281a3648fa68865b850c287a54b17e3f52bfefd5b228c6aaf217d61e78efab260637464264d1a2094f48a1a78b87f5b8253a97
6
+ metadata.gz: 596b27d020a8f96623718ffe04e17dbe83da95b2f9af28e3504dfb58f5076dab3cd6e9183fabcd6f26d1e6e12cfdd76558fd657094ac4d52fc2fbee251590715
7
+ data.tar.gz: 97d61ce5860418155b40d2d07938d2a99fccf1db3c6492cbc2710d0afe23da63be040abfbd00139602d9bb2828eb5c7b5c05ec45e3ee980fd7249c0c284e49bc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- oye (0.1.5)
4
+ oye (0.1.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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 use port_open? method
13
- - also you should remove the '--port' option. instead specify the port in unicorn.rb
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
@@ -1,3 +1,3 @@
1
1
  module Oye
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
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 (default 3000)
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
- %x{unicorn_rails -l :#{@port} -c #{unicorn_file(dir)} -E #{@environment} -D}
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oye
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - sergioro