Module: Bolt
- Defined in:
- lib/bolt.rb,
lib/bolt/runner.rb,
lib/bolt/listener.rb,
lib/bolt/notifier.rb,
lib/bolt/runners/base.rb,
lib/bolt/listeners/osx.rb,
lib/bolt/runners/rspec.rb,
lib/bolt/adapters/rails.rb,
lib/bolt/notifiers/growl.rb,
lib/bolt/runners/cucumber.rb,
lib/bolt/listeners/generic.rb,
lib/bolt/notifiers/generic.rb,
lib/bolt/runners/test_unit.rb,
lib/bolt/notifiers/notify_osd.rb,
lib/bolt/runners/legacy_test_unit.rb
Overview
The TestUnit Runners maps the filename to the appropriate test
Defined Under Namespace
Modules: Adapters, Listeners, Notifiers, Runners Classes: Listener, Notifier, Runner
Constant Summary collapse
- @@config =
static location for settings
{}
Class Method Summary collapse
-
.[](key) ⇒ Object
convienience accessor.
-
.get(key) ⇒ Object
retrieve a value for a config setting.
-
.read_argv ⇒ Object
read the arguments passed in cli.
-
.read_dotfile ⇒ Object
read the .bolt file for configuration.
-
.set(key, value) ⇒ Object
set a config setting.
-
.start ⇒ Object
start bolt.
-
.trap_signals ⇒ Object
Trap appropriate signals.
-
.verbose? ⇒ Boolean
check for verbose execution.
Class Method Details
.[](key) ⇒ Object
convienience accessor
19 20 21 |
# File 'lib/bolt.rb', line 19 def self.[](key) @@config[key] end |
.get(key) ⇒ Object
retrieve a value for a config setting
14 15 16 |
# File 'lib/bolt.rb', line 14 def self.get(key) @@config[key] end |
.read_argv ⇒ Object
read the arguments passed in cli
33 34 35 36 37 |
# File 'lib/bolt.rb', line 33 def self.read_argv ARGV.each do |arg| @@config['verbose'] = true if arg == '-v' end end |
.read_dotfile ⇒ Object
read the .bolt file for configuration
24 25 26 27 28 29 30 |
# File 'lib/bolt.rb', line 24 def self.read_dotfile if File.exists?('.bolt') parsed_dotfile = YAML.load_file('.bolt') @@config.merge!(parsed_dotfile) if parsed_dotfile $stdout.puts "** Found .bolt file" if Bolt.verbose? end end |
.set(key, value) ⇒ Object
set a config setting
9 10 11 |
# File 'lib/bolt.rb', line 9 def self.set(key, value) @@config[key] = value end |
.start ⇒ Object
start bolt
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/bolt.rb', line 54 def self.start $stdout.puts "** Starting Bolt..." # read the dotfile Bolt.read_dotfile # read the arguments passed Bolt.read_argv # 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 |
.trap_signals ⇒ Object
Trap appropriate signals
45 46 47 48 49 50 51 |
# File 'lib/bolt.rb', line 45 def self.trap_signals # ctrl-c should exit trap 'INT' do $stdout.puts "\n** Exiting Bolt..." exit(0) end end |
.verbose? ⇒ Boolean
check for verbose execution
40 41 42 |
# File 'lib/bolt.rb', line 40 def self.verbose? @@config['verbose'] == true end |