Class: Guard::Busted
- Inherits:
-
Plugin
- Object
- Plugin
- Guard::Busted
- Includes:
- BustedUtils
- Defined in:
- lib/guard/busted.rb
Overview
Plugin for ‘guard’ which starts ‘busted’ (lua unit testing framework) if a change is detected.
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#runner ⇒ Object
readonly
Returns the value of attribute runner.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Busted
constructor
Initializes a Guard plugin.
-
#run_all ⇒ Object
Called when just ‘enter` is pressed.
-
#run_on_modifications(paths) ⇒ Object
Called on file(s) modifications that the Guard plugin watches.
-
#start ⇒ Object
Called once when Guard starts.
Methods included from BustedUtils
Constructor Details
#initialize(options = {}) ⇒ Busted
Initializes a Guard plugin.
17 18 19 20 21 22 |
# File 'lib/guard/busted.rb', line 17 def initialize( = {}) super @options = Guard::BustedOptions::DEFAULTS.merge() @runner = Guard::BustedRunner.new(@options) end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
14 15 16 |
# File 'lib/guard/busted.rb', line 14 def @options end |
#runner ⇒ Object (readonly)
Returns the value of attribute runner.
14 15 16 |
# File 'lib/guard/busted.rb', line 14 def runner @runner end |
Instance Method Details
#run_all ⇒ Object
Called when just ‘enter` is pressed
31 32 33 |
# File 'lib/guard/busted.rb', line 31 def run_all @runner.run_all end |
#run_on_modifications(paths) ⇒ Object
Called on file(s) modifications that the Guard plugin watches.
36 37 38 |
# File 'lib/guard/busted.rb', line 36 def run_on_modifications(paths) @runner.run(paths) end |
#start ⇒ Object
Called once when Guard starts.
25 26 27 28 |
# File 'lib/guard/busted.rb', line 25 def start check_if_busted_exist run_all if @options[:run_all_on_start] end |