Sha256: bb666a8e64d099ee7d9677dafd7ea21a880c77aaaac75d6a25c29735782d67f5

Contents?: true

Size: 567 Bytes

Versions: 25

Compression:

Stored size: 567 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..-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

25 entries across 25 versions & 3 rubygems

Version Path
phillipug-foodie-0.1.0 .vendor/ruby/3.0.0/gems/cucumber-7.1.0/lib/cucumber/cli/rerun_file.rb
cucumber-7.1.0 lib/cucumber/cli/rerun_file.rb
cucumber-7.0.0 lib/cucumber/cli/rerun_file.rb
cucumber-6.1.0 lib/cucumber/cli/rerun_file.rb
cucumber-6.0.0 lib/cucumber/cli/rerun_file.rb
cucumber-5.3.0 lib/cucumber/cli/rerun_file.rb
cucumber-5.2.0 lib/cucumber/cli/rerun_file.rb
cucumber-5.1.3 lib/cucumber/cli/rerun_file.rb
cucumber-5.1.2 lib/cucumber/cli/rerun_file.rb
cucumber-5.1.1 lib/cucumber/cli/rerun_file.rb
cucumber-5.1.0 lib/cucumber/cli/rerun_file.rb
cucumber-5.0.0 lib/cucumber/cli/rerun_file.rb
cucumber-4.1.0 lib/cucumber/cli/rerun_file.rb
cucumber-4.0.1 lib/cucumber/cli/rerun_file.rb
cucumber-4.0.0 lib/cucumber/cli/rerun_file.rb
cucumber-3.2.0 lib/cucumber/cli/rerun_file.rb
cucumber-4.0.0.rc.6 lib/cucumber/cli/rerun_file.rb
cucumber-4.0.0.rc.5 lib/cucumber/cli/rerun_file.rb
cucumber-4.0.0.rc.4 lib/cucumber/cli/rerun_file.rb
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/cucumber-3.1.2/lib/cucumber/cli/rerun_file.rb