Class: Cucumber::Cli::RerunFile

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber/cli/rerun_file.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ RerunFile

Returns a new instance of RerunFile.



14
15
16
# File 'lib/cucumber/cli/rerun_file.rb', line 14

def initialize(path)
  @path = self.class.real_path(path)
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



4
5
6
# File 'lib/cucumber/cli/rerun_file.rb', line 4

def path
  @path
end

Class Method Details

.can_read?(path) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/cucumber/cli/rerun_file.rb', line 6

def self.can_read?(path)
  path[0] == '@' && File.file?(real_path(path))
end

.real_path(path) ⇒ Object



10
11
12
# File 'lib/cucumber/cli/rerun_file.rb', line 10

def self.real_path(path)
  path[1..-1] # remove leading @
end

Instance Method Details

#featuresObject



18
19
20
# File 'lib/cucumber/cli/rerun_file.rb', line 18

def features
  lines.map { |l| l.scan(/(?:^| |)(.*?\.feature(?:(?::\d+)*))/) }.flatten
end