class Cucumber::Cli::RerunFile

Attributes

path[R]

Public Class Methods

can_read?(path) click to toggle source
# File lib/cucumber/cli/rerun_file.rb, line 8
def self.can_read?(path)
  path[0] == '@' && File.file?(real_path(path))
end
new(path) click to toggle source
# File lib/cucumber/cli/rerun_file.rb, line 16
def initialize(path)
  @path = self.class.real_path(path)
end
real_path(path) click to toggle source
# File lib/cucumber/cli/rerun_file.rb, line 12
def self.real_path(path)
  path[1..-1] # remove leading @
end

Public Instance Methods

features() click to toggle source
# File lib/cucumber/cli/rerun_file.rb, line 20
def features
  lines.map { |l| l.scan(/(?:^| |)(.*?\.feature(?:(?::\d+)*))/) }.flatten
end

Private Instance Methods

lines() click to toggle source
# File lib/cucumber/cli/rerun_file.rb, line 26
def lines
  IO.read(@path).split("\n")
end