Sha256: 33d6f898e6630674742bcd88670cdaebc4f1da95cf49cc4ed7e837f8e8fde138

Contents?: true

Size: 546 Bytes

Versions: 16

Compression:

Stored size: 546 Bytes

Contents

# frozen_string_literal: true

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..]
      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

16 entries across 16 versions & 3 rubygems

Version Path
cucumber-9.2.1 lib/cucumber/cli/rerun_file.rb
cucumber-9.2.0 lib/cucumber/cli/rerun_file.rb
cucumber-9.1.2 lib/cucumber/cli/rerun_file.rb
cucumber-9.1.1 lib/cucumber/cli/rerun_file.rb
honeybadger-5.4.0 vendor/bundle/ruby/3.2.0/gems/cucumber-9.1.0/lib/cucumber/cli/rerun_file.rb
cucumber-9.1.0 lib/cucumber/cli/rerun_file.rb
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/cucumber-9.0.2/lib/cucumber/cli/rerun_file.rb
cucumber-9.0.2 lib/cucumber/cli/rerun_file.rb
cucumber-9.0.1 lib/cucumber/cli/rerun_file.rb
cucumber-9.0.0 lib/cucumber/cli/rerun_file.rb
rubypitaya-3.12.5 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/cli/rerun_file.rb
rubypitaya-3.12.4 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/cli/rerun_file.rb
rubypitaya-3.12.3 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/cli/rerun_file.rb
rubypitaya-3.12.2 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/cli/rerun_file.rb
cucumber-8.0.0 lib/cucumber/cli/rerun_file.rb
cucumber-8.0.0.rc.1 lib/cucumber/cli/rerun_file.rb