bin/pushyd in pushyd-0.3.4 vs bin/pushyd in pushyd-0.4.0
- old
+ new
@@ -3,11 +3,10 @@
# Try to load external libs, helpers and constants
begin
require "rubygems"
require "optparse"
require 'daemons'
- require 'logger'
require_relative "../lib/pushyd/conf"
rescue LoadError
raise "EXITING: some basic libs were not found"
end
include PushyDaemon
@@ -31,28 +30,27 @@
opts.on("-d", "--dump") { cmd_dump = true }
opts.on("", "--dev") { cmd_env = "development" }
end.order!(ARGV)
# Build Chamber-based configuration from Gemspec with initial context
- Conf.prepare root: APP_ROOT, gemspec: "pushyd", env: cmd_env, config: cmd_config, log: cmd_logfile
+ Conf.prepare root: APP_ROOT, gemspec: "pushyd", env: cmd_env, config: cmd_config, logfile: cmd_logfile
rescue OptionParser::InvalidOption => e
- abort "EXITING: option parser: #{e.message}"
+ abort "EXITING: InvalidOption: #{e.message} \n #{e.backtrace.to_yaml}"
rescue PushyDaemon::ConfigParseError => e
- abort "EXITING: ConfigParseError: #{e.message}"
+ abort "EXITING: ConfigParseError: #{e.message} \n #{e.backtrace.to_yaml}"
rescue StandardError => e
- abort "EXITING: Exception: #{e.message}"
+ abort "EXITING: StandardError: #{e.message} \n #{e.backtrace.to_yaml}"
end
# Display final configuration
puts "--- #{Conf.name} #{Conf.version}"
puts "YAML Parser \t #{YAML.name}"
puts "Environment \t #{Conf.env}"
puts "Config files \t #{Conf.files}"
-puts "Loging to file \t #{Conf[:log]}"
+puts "Loging to file \t #{Conf.log.logfile}"
-
# Quit if config dump requested
if cmd_dump
puts Conf.dump
exit(0)
end
@@ -63,12 +61,12 @@
:backtrace => true,
:multiple => false
}
Daemons.run_proc('pushy-daemon', run_options) do
# Load code
- puts "--- loading code"
+ puts "--- load code"
require_relative "../lib/pushyd"
# Start daemon
- puts "--- starting daemon"
+ puts "--- start daemon"
PushyDaemon::Daemon.run
end