Sha256: 8655921fb61b4c36ee31c6596e7df739bebaa99ce56358d57f4855766ad3f079

Contents?: true

Size: 536 Bytes

Versions: 5

Compression:

Stored size: 536 Bytes

Contents

module Cucumber
  module Cli
    class RerunFile
      attr_reader :path

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

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

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

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

      private

      def lines
        IO.read(@path).split("\n")
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
cucumber-2.99.0 lib/cucumber/cli/rerun_file.rb
mobiusloop-0.1.5 lib/cucumber/cli/rerun_file.rb
cucumber-2.4.0 lib/cucumber/cli/rerun_file.rb
mobiusloop-0.1.3 lib/cucumber/cli/rerun_file.rb
mobiusloop-0.1.2 lib/cucumber/cli/rerun_file.rb