lib/bolt.rb in marcinbunsch-bolt-0.2.7 vs lib/bolt.rb in marcinbunsch-bolt-0.2.8

- old
+ new

@@ -36,40 +36,57 @@ end end # check for verbose execution def self.verbose? - @@config['verbose'] || false + @@config['verbose'] == true end + # Trap appropriate signals + def self.trap_signals + # ctrl-c should exit + trap 'INT' do + $stdout.puts "\n** Exiting Bolt..." + exit(0) + end + end + # start bolt def self.start $stdout.puts "** Starting Bolt..." # read the dotfile Bolt.read_dotfile # read the arguments passed Bolt.read_argv - Bolt::Listener.new + # trap signals + Bolt.trap_signals + + listener = Bolt::Listener.new + + # display info to user + listener.selected.notifier.info 'Bolt running', "Bolt is enabled and running in #{Dir.pwd}" + + # if in Rails, start environment + listener.selected.start end + + autoload :Runner, File.dirname(__FILE__) + '/bolt/runner' + autoload :Notifier, File.dirname(__FILE__) + '/bolt/notifier' + autoload :Listener, File.dirname(__FILE__) + '/bolt/listener' - autoload :Mapper, 'bolt/mapper' - autoload :Runner, 'bolt/runner' - autoload :Notifier, 'bolt/notifier' - autoload :Listener, 'bolt/listener' - # # Bolt::Listeners # # Wrapper for specific listeners # module Listeners - autoload :Generic, 'bolt/listeners/generic' - autoload :Kqueue, 'bolt/listeners/kqueue' - autoload :Osx, 'bolt/listeners/osx' + autoload :Generic, File.dirname(__FILE__) + '/bolt/listeners/generic' + autoload :Kqueue, File.dirname(__FILE__) + '/bolt/listeners/kqueue' + autoload :Osx, File.dirname(__FILE__) + '/bolt/listeners/osx' end # # Bolt::Runners # @@ -84,22 +101,23 @@ def self.files @@noticed_files end - autoload :Base, 'bolt/runners/base' - autoload :Cucumber, 'bolt/runners/cucumber' - autoload :TestUnit, 'bolt/runners/test_unit' - autoload :RSpec, 'bolt/runners/rspec' + autoload :Base, File.dirname(__FILE__) + '/bolt/runners/base' + autoload :Cucumber, File.dirname(__FILE__) + '/bolt/runners/cucumber' + autoload :TestUnit, File.dirname(__FILE__) + '/bolt/runners/test_unit' + autoload :LegacyTestUnit, File.dirname(__FILE__) + '/bolt/runners/legacy_test_unit' + autoload :RSpec, File.dirname(__FILE__) + '/bolt/runners/rspec' end # # Bolt::Notifiers # # Wrapper for specific notifier # module Notifiers - autoload :Generic, 'bolt/notifiers/generic' - autoload :Growl, 'bolt/notifiers/growl' - autoload :NotifyOsd, 'bolt/notifiers/notify_osd' + autoload :Generic, File.dirname(__FILE__) + '/bolt/notifiers/generic' + autoload :Growl, File.dirname(__FILE__) + '/bolt/notifiers/growl' + autoload :NotifyOsd, File.dirname(__FILE__) + '/bolt/notifiers/notify_osd' end end