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



16
17
18
# File 'lib/cucumber/cli/rerun_file.rb', line 16

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

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path



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

def path
  @path
end

Class Method Details

.can_read?(path) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/cucumber/cli/rerun_file.rb', line 8

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

.real_path(path) ⇒ Object



12
13
14
# File 'lib/cucumber/cli/rerun_file.rb', line 12

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

Instance Method Details

#featuresObject



20
21
22
# File 'lib/cucumber/cli/rerun_file.rb', line 20

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