Class: Cucumber::Rake::Task::ForkedCucumberRunner
- Defined in:
- lib/cucumber/rake/task.rb
Overview
:nodoc:
Direct Known Subclasses
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
Instance Method Summary collapse
-
#initialize(libs, cucumber_bin, cucumber_opts, feature_files) ⇒ ForkedCucumberRunner
constructor
A new instance of ForkedCucumberRunner.
- #load_path(libs) ⇒ Object
- #quoted_binary(cucumber_bin) ⇒ Object
- #run ⇒ Object
- #runner ⇒ Object
Constructor Details
#initialize(libs, cucumber_bin, cucumber_opts, feature_files) ⇒ ForkedCucumberRunner
Returns a new instance of ForkedCucumberRunner.
50 51 52 53 54 55 56 57 |
# File 'lib/cucumber/rake/task.rb', line 50 def initialize(libs, cucumber_bin, cucumber_opts, feature_files) @args = ( ['-I'] + load_path(libs) + quoted_binary(cucumber_bin) + cucumber_opts + feature_files ).flatten end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
48 49 50 |
# File 'lib/cucumber/rake/task.rb', line 48 def args @args end |
Instance Method Details
#load_path(libs) ⇒ Object
59 60 61 |
# File 'lib/cucumber/rake/task.rb', line 59 def load_path(libs) ['"%s"' % libs.join(File::PATH_SEPARATOR)] end |
#quoted_binary(cucumber_bin) ⇒ Object
63 64 65 |
# File 'lib/cucumber/rake/task.rb', line 63 def quoted_binary(cucumber_bin) ['"%s"' % cucumber_bin] end |
#run ⇒ Object
71 72 73 |
# File 'lib/cucumber/rake/task.rb', line 71 def run sh((runner + args).join(" ")) end |
#runner ⇒ Object
67 68 69 |
# File 'lib/cucumber/rake/task.rb', line 67 def runner File.exist?("./Gemfile") && Gem.available?("bundler") ? ["bundle", "exec", RUBY] : [RUBY] end |