bin/pushyd in pushyd-0.6.0 vs bin/pushyd in pushyd-0.7.0
- old
+ new
@@ -21,17 +21,18 @@
# Init Chamber-based configuration from Gemspec
Conf.init File.dirname(__FILE__) + "/../"
Conf.app_env = "production"
# Parse options and check compliance
- OptionParser.new do |opts|
+ parser = OptionParser.new do |opts|
opts.banner = "Usage: #{File.basename $PROGRAM_NAME} [options] start|stop"
opts.on("-l", "--log LOGFILE") { |path| cmd_logfile = File.expand_path(path)}
opts.on("-c", "--config CONFIGFILE") { |path| cmd_config = File.expand_path(path)}
opts.on("-e", "--environment ENV") { |env| Conf.app_env = env }
opts.on("", "--dev") { Conf.app_env = "development" }
- end.order!(ARGV)
+ end
+ parser.order!(ARGV)
# Load Chamber-based configuration
Conf.prepare config: cmd_config, logfile: cmd_logfile
# Override log file
@@ -51,20 +52,23 @@
puts "--- #{Conf.app_name} #{Conf.app_ver}"
puts "Environment \t #{Conf.app_env}"
puts "Config files \t #{Conf.files}"
puts "Started at \t #{Conf.app_started}"
puts "Loging to file \t #{Conf[:log][:file]}" if Conf[:log].is_a? Enumerable
-puts "Process name \t #{Conf.gen_process_name}"
+puts "Process name \t #{Conf.generate(:process_name)}"
puts
puts Conf.dump
# Run daemon
run_options = {
+monitor: false,
ontop: false,
- :backtrace => true,
- :multiple => false
+ backtrace: true,
+ multiple: false,
+ dir_mode: :normal,
+ dir: '/tmp/'
}
-Daemons.run_proc(Conf.gen_process_name, run_options) do
+Daemons.run_proc(Conf.generate(:process_name), run_options) do
# Load code
puts "--- load code"
require_relative "../lib/pushyd"
# Start daemon