Class: Guard::Teabag::Runner
- Inherits:
-
Object
- Object
- Guard::Teabag::Runner
- Defined in:
- lib/guard/teabag/runner.rb
Instance Attribute Summary collapse
-
#console ⇒ Object
Returns the value of attribute console.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Runner
constructor
A new instance of Runner.
- #run(files = [], options = {}) ⇒ Object
- #run_all(options = {}) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Runner
Returns a new instance of Runner.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/guard/teabag/runner.rb', line 7 def initialize( = {}) @options = begin require "teabag/console" @console = ::Teabag::Console.new(@options) rescue ::Teabag::EnvironmentNotFound => e STDOUT.print "Unable to load Teabag environment in {#{::Teabag::Environment.standard_environments.join(', ')}}.\n" STDOUT.print "Consider using -r path/to/teabag_env\n" abort end end |
Instance Attribute Details
#console ⇒ Object
Returns the value of attribute console.
5 6 7 |
# File 'lib/guard/teabag/runner.rb', line 5 def console @console end |
Instance Method Details
#run(files = [], options = {}) ⇒ Object
24 25 26 27 |
# File 'lib/guard/teabag/runner.rb', line 24 def run(files = [], = {}) return false if files.empty? @console.execute(@options.merge(), files) end |
#run_all(options = {}) ⇒ Object
20 21 22 |
# File 'lib/guard/teabag/runner.rb', line 20 def run_all( = {}) @console.execute(@options.merge()) end |