grid_runner 0.0.8 → 0.0.9

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: 3d7a8c5a7bf8bba8325ab47198f7eef5fe9ea0e2
4
- data.tar.gz: a890cd6f7cc8f58f93bb0afcf5a96f1cd5eb7437
3
+ metadata.gz: 70f55992a0c7bb4a0eb739a733a68bf23ed55496
4
+ data.tar.gz: 9334a9feb173442082d07d9f9b529b4f0aded3dc
5
5
  SHA512:
6
- metadata.gz: 6d7cd64be7233def5625a4f0f0eb7990819a4be542baf3cf29ca4b75da64979a44ecf15f715265f8ff6bcb91465b97aa555319b899e4601090bbea8b78c9197c
7
- data.tar.gz: 45a5739270bf6d2e08c7a10f96030fdfeef189434b41f50de29b3c0b9bd0a95a1d0805925ef6238a13f2794498cac2b746a39dc12f78f6c081b58d3d64513808
6
+ metadata.gz: bc7ca09a106100893859400c5cacbac7d91ff8d9ea801158c2bcf6cae163df17961d10af84b3cc8f3dc8b97ecf9e40a76fc470814ba7a5856642d1966350a5f8
7
+ data.tar.gz: 931d1ca6329f0ad4dc732ed97dea3a3c3a7ef20b82e09ad6ccff71b3ffca9da6658647932a7f1fdcea25c86e99a0eaa941b56f2812e39c6e5963e3d1893cbb6f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- grid_runner (0.0.7)
4
+ grid_runner (0.0.9)
5
5
  gli (= 2.13.4)
6
6
 
7
7
  GEM
data/Procfile CHANGED
@@ -9,3 +9,4 @@ metadata-editor: sbt "project metadata-editor" "~ run 9007"
9
9
  imgops: cd imgops; ./dev-start.sh
10
10
  usage: sbt "project usage" "~ run 9009"
11
11
  collections: sbt "project collections" "~ run 9010"
12
+ auth: sbt "project auth" "~ run 9011"
data/README.md CHANGED
@@ -22,7 +22,13 @@ Commands
22
22
  * ``` grid_runner run <APP_NAME || 'all' > ```
23
23
  * ``` grid_runner kill <APP_NAME || 'all' > ```
24
24
  * ``` grid_runner restart <APP_NAME || 'all' > ```
25
+ * ``` grid_runner running ```
26
+ * ``` grid_runner not_running ```
25
27
 
28
+ All commands that take an app name can take a space delimited list of app names:
29
+
30
+ e.g.
31
+ ``` gr log media-api cropper thrall ```
26
32
 
27
33
  Logs
28
34
  ----
data/bin/grid_runner CHANGED
@@ -13,19 +13,54 @@ arguments :strict
13
13
 
14
14
  def apps_from_args(args)
15
15
  return App.all if args.first == "all"
16
- return App.find(args)
16
+ return App.find(args) unless args.empty?
17
17
  end
18
18
 
19
+ desc 'lists apps that are running'
20
+ command :running do |c|
21
+ c.action do |global_options,options,args|
22
+ running_apps = App.all.select { |a| a.status == :running}
23
+ if running_apps.empty?
24
+ puts Rainbow("No apps running").red
25
+ else
26
+ puts Rainbow("Running apps:").blue
27
+ puts Rainbow("#{running_apps.map(&:name)}").green
28
+ end
29
+ end
30
+ end
31
+
32
+
33
+ desc 'lists apps that are not running'
34
+ command :not_running do |c|
35
+ c.action do |global_options,options,args|
36
+ not_running = App.all.reject { |a| a.status == :running}
37
+ puts Rainbow("All apps running").red and return if not_running.empty?
38
+ if not_running.empty?
39
+ puts Rainbow("All apps running").red
40
+ else
41
+ puts Rainbow("Not running:").red.underline.bright
42
+ puts Rainbow("#{not_running.map(&:name).join(", ")}").red
43
+ end
44
+ end
45
+ end
46
+
47
+
48
+
19
49
  desc 'runs a given app listed in the Procfile (or all)'
20
50
  arg_name "app names separated by a SPACE or 'all'"
21
51
  command :run do |c|
22
52
  c.action do |global_options,options,args|
23
- apps_from_args(args).each do |app|
24
- if app.status == :running
25
- puts Rainbow("#{app.name} already running!").red
26
- puts
27
- else
28
- app.run
53
+ apps_to_run = apps_from_args(args)
54
+ if apps_to_run.empty?
55
+ Rainbow("No app #{args.first} found in Procfile")
56
+ else
57
+ apps_to_run.each do |app|
58
+ if app.status == :running
59
+ puts Rainbow("#{app.name} already running!").red
60
+ puts
61
+ else
62
+ app.run
63
+ end
29
64
  end
30
65
  end
31
66
  end
@@ -39,7 +39,6 @@ class App
39
39
  puts "status: #{status}"
40
40
  puts "pid: #{pid}" if status == :running
41
41
  puts "log: #{log.path}"
42
- puts
43
42
  end
44
43
 
45
44
  def kill!
@@ -52,7 +51,7 @@ class App
52
51
  end
53
52
 
54
53
  def log
55
- File.open((Dir.pwd + "/logs/" + "#{name}.log"), "w+")
54
+ File.open((Dir.pwd + "/logs/" + "#{name}.log"), "ab")
56
55
  end
57
56
 
58
57
  def run
@@ -77,6 +76,9 @@ class App
77
76
  stdout.split(/\n/).find do |l|
78
77
  l.match(name) &&
79
78
  !l.match("grep") &&
79
+ !l.match("tail") &&
80
+ # for auth
81
+ !l.match("MacOS") &&
80
82
  !l.match("grid_runner")
81
83
  end
82
84
  end
@@ -1,3 +1,3 @@
1
1
  module GridRunner
2
- VERSION = '0.0.8'
2
+ VERSION = '0.0.9'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grid_runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - NickyPStraightStylinOnEm
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-11 00:00:00.000000000 Z
11
+ date: 2016-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -79,10 +79,6 @@ files:
79
79
  - README.md
80
80
  - Rakefile
81
81
  - bin/grid_runner
82
- - grid_runner-0.0.1.gem
83
- - grid_runner-0.0.3.gem
84
- - grid_runner-0.0.5.gem
85
- - grid_runner-0.0.6.gem
86
82
  - grid_runner.gemspec
87
83
  - grid_runner.rdoc
88
84
  - lib/grid_runner.rb
Binary file
Binary file
Binary file
Binary file