Class: Gurke::Runner
- Inherits:
-
Object
- Object
- Gurke::Runner
- Defined in:
- lib/gurke/runner.rb
Direct Known Subclasses
Defined Under Namespace
Classes: DRbClient, DRbServer, LocalRunner
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #builder ⇒ Object
- #hook(scope, world, &block) ⇒ Object
-
#initialize(config, options = {}) ⇒ Runner
constructor
A new instance of Runner.
- #reporter ⇒ Object
- #run(files, reporter = self.reporter) ⇒ Object
- #with_filtered_backtrace ⇒ Object
Constructor Details
#initialize(config, options = {}) ⇒ Runner
Returns a new instance of Runner.
5 6 7 8 |
# File 'lib/gurke/runner.rb', line 5 def initialize(config, = {}) @config = config @options = end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
3 4 5 |
# File 'lib/gurke/runner.rb', line 3 def config @config end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/gurke/runner.rb', line 3 def @options end |
Instance Method Details
#builder ⇒ Object
14 15 16 |
# File 'lib/gurke/runner.rb', line 14 def builder @builder ||= Builder.new end |
#hook(scope, world, &block) ⇒ Object
28 29 30 |
# File 'lib/gurke/runner.rb', line 28 def hook(scope, world, &block) config.hooks[scope].run world, &block end |
#reporter ⇒ Object
10 11 12 |
# File 'lib/gurke/runner.rb', line 10 def reporter @reporter ||= Reporters::DefaultReporter.new end |
#run(files, reporter = self.reporter) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/gurke/runner.rb', line 18 def run(files, reporter = self.reporter) files.map! do |file| split = file.split(':') [split[0], split[1..-1].map{|i| Integer(i) }] end features = builder.load files.map{|file, _| file } features.filter(, files).run self, reporter end |