Class: Cucumber::Cli::RerunFile
- Inherits:
-
Object
- Object
- Cucumber::Cli::RerunFile
- Defined in:
- lib/cucumber/cli/rerun_file.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
- #features ⇒ Object
-
#initialize(path) ⇒ RerunFile
constructor
A new instance of RerunFile.
Constructor Details
#initialize(path) ⇒ RerunFile
Returns a new instance of RerunFile.
15 16 17 |
# File 'lib/cucumber/cli/rerun_file.rb', line 15 def initialize(path) @path = self.class.real_path(path) end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/cucumber/cli/rerun_file.rb', line 5 def path @path end |
Class Method Details
.can_read?(path) ⇒ Boolean
7 8 9 |
# File 'lib/cucumber/cli/rerun_file.rb', line 7 def self.can_read?(path) path[0] == '@' && File.file?(real_path(path)) end |
.real_path(path) ⇒ Object
11 12 13 |
# File 'lib/cucumber/cli/rerun_file.rb', line 11 def self.real_path(path) path[1..-1] # remove leading @ end |
Instance Method Details
#features ⇒ Object
19 20 21 |
# File 'lib/cucumber/cli/rerun_file.rb', line 19 def features lines.map { |l| l.scan(/(?:^| |)(.*?\.feature(?:(?::\d+)*))/) }.flatten end |