procman 1.7.0 → 1.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/proc_man.rb +1 -1
  2. data/lib/proc_man/process.rb +11 -6
  3. metadata +2 -2
data/lib/proc_man.rb CHANGED
@@ -4,7 +4,7 @@ require 'proc_man/constraint'
4
4
 
5
5
  module ProcMan
6
6
 
7
- VERSION = '1.7.0'
7
+ VERSION = '1.7.1'
8
8
 
9
9
  class Error < StandardError; end
10
10
 
@@ -71,21 +71,26 @@ module ProcMan
71
71
  end
72
72
  end
73
73
 
74
+ def run(command)
75
+ puts " -----> #{command}"
76
+ system(command)
77
+ end
78
+
74
79
  # A shortcut method for defining a set of RBG processes
75
80
  def rbg(options = {})
76
81
  options[:config_file] ||= "Rbgfile"
77
- start { system("bundle exec rbg start -c #{root}/#{options[:config_file]} -E #{environment}") }
78
- stop { system("bundle exec rbg stop -c #{root}/#{options[:config_file]} -E #{environment}") }
79
- restart { system("bundle exec rbg restart -c #{root}/#{options[:config_file]} -E #{environment}") }
82
+ start { run("bundle exec rbg start -c #{root}/#{options[:config_file]} -E #{environment}") }
83
+ stop { run("bundle exec rbg stop -c #{root}/#{options[:config_file]} -E #{environment}") }
84
+ restart { run("bundle exec rbg restart -c #{root}/#{options[:config_file]} -E #{environment}") }
80
85
  end
81
86
 
82
87
  # A shortcut method for defining a unicorn
83
88
  def unicorn(options = {})
84
89
  options[:config_file] ||= "config/unicorn.rb"
85
90
  options[:pid_path] ||= "log/unicorn.pid"
86
- start { system("bundle exec unicorn -D -E #{environment} -c #{root}/#{options[:config_file]}") }
87
- stop { system("kill `cat #{root}/#{options[:pid_path]}`") if File.exist?(options[:pid_path]) }
88
- restart { system("kill -USR2 `cat #{root}/#{options[:pid_path]}`") if File.exist?(options[:pid_path]) }
91
+ start { run("bundle exec unicorn -D -E #{environment} -c #{root}/#{options[:config_file]}") }
92
+ stop { run("kill `cat #{root}/#{options[:pid_path]}`") if File.exist?(options[:pid_path]) }
93
+ restart { run("kill -USR2 `cat #{root}/#{options[:pid_path]}`") if File.exist?(options[:pid_path]) }
89
94
  end
90
95
 
91
96
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: procman
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.7.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-21 00:00:00.000000000 Z
12
+ date: 2014-02-22 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A very very simple library for starting/stopping/restarting processes
15
15
  for a Ruby application