bin/tap in tap-0.9.0 vs bin/tap in tap-0.9.1

- old
+ new

@@ -10,18 +10,16 @@ # tap command --help # prints help for 'command' # require File.join( File.dirname(__FILE__), "../lib/tap.rb") -# setup environment +# setup the environment env = Tap::Env.instance app = Tap::App.instance env.logger = app.logger -if ARGV.delete("-d-") - env.debug_setup -end +env.debug_setup if ARGV.delete('-d-') before = nil after = nil def handle_error(err) @@ -34,22 +32,21 @@ else puts err.message end end # configure the app to tap.yml if it exists -default_config_file = File.expand_path( Tap::Env::DEFAULT_CONFIG_FILE ) +default_config_file = Tap::Env::DEFAULT_CONFIG_FILE begin - env.load_config(default_config_file, app) do |app, config_file, config| - unless config_file == default_config_file - env.log(:warn, "ignoring configs: #{config_file} (#{config.keys.join(',')})", Logger::WARN) - next - end + + env.load_config(default_config_file, app) do |non_env_configs| + before = non_env_configs.delete('before') + after = non_env_configs.delete('after') - before = config.delete('before') - after = config.delete('after') - - app.reconfigure(config) + app.reconfigure(non_env_configs) end + + env.discover_gems unless File.exists?(default_config_file) + rescue(Exception) # catch errors and exit gracefully # (errors usu from gem loading errors) puts "Configuration error: #{$!.message}" puts $!.backtrace if $DEBUG