Sha256: aa7f2ec1f8f1f72dfe8d062fff67821acd4fe681b2eadd0d969cc7991ba22e97

Contents?: true

Size: 535 Bytes

Versions: 8

Compression:

Stored size: 535 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

8 entries across 8 versions & 1 rubygems

Version Path
cucumber-2.3.3 lib/cucumber/cli/rerun_file.rb
cucumber-2.3.2 lib/cucumber/cli/rerun_file.rb
cucumber-2.3.1 lib/cucumber/cli/rerun_file.rb
cucumber-2.3.0 lib/cucumber/cli/rerun_file.rb
cucumber-2.2.0 lib/cucumber/cli/rerun_file.rb
cucumber-2.1.0 lib/cucumber/cli/rerun_file.rb
cucumber-2.0.2 lib/cucumber/cli/rerun_file.rb
cucumber-2.0.1 lib/cucumber/cli/rerun_file.rb