123456789_123456789_123456789_123456789_123456789_

Class: Minitest::Bisect::PathExpander

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Minitest::VendoredPathExpander
Defined in: lib/minitest/bisect.rb

Constant Summary

Class Method Summary

::Minitest::VendoredPathExpander - Inherited

.new

Create a new path expander that operates on args and expands via glob as necessary.

Instance Attribute Summary

::Minitest::VendoredPathExpander - Inherited

#args

The args array to process.

#glob

The glob used to expand dirs to files.

#path

The path to scan if no paths are found in the initial scan.

Instance Method Summary

::Minitest::VendoredPathExpander - Inherited

#expand_dirs_to_files

Takes an array of paths and returns an array of paths where all directories are expanded to all files found via the glob provided to PathExpander.

#filter_files

A file filter mechanism similar to, but not as extensive as, .gitignore files:

#post_process, #pre_process,
#process

Top-level method processes args.

#process_args

Enumerate over args passed to PathExpander and return a list of files and flags to process.

#process_file

Process a file into more arguments.

#process_flags

Process over flags and treat any special ones here.

Constructor Details

.new(args = ARGV) ⇒ PathExpander

[ GitHub ]

  
# File 'lib/minitest/bisect.rb', line 20

def initialize args = ARGV # :nodoc:
  super args, TEST_GLOB, "test"
  self.rb_flags = %w[-Itest:lib]
end

Instance Attribute Details

#rb_flags (rw)

[ GitHub ]

  
# File 'lib/minitest/bisect.rb', line 18

attr_accessor :rb_flags

Instance Method Details

#process_flags(flags)

Overrides #process_flags to filter out ruby flags from minitest flags. Only supports -I<paths>, -d, and -w for ruby.

[ GitHub ]

  
# File 'lib/minitest/bisect.rb', line 30

def process_flags flags
  flags.reject { |flag| # all hits are truthy, so this works out well
    case flag
    when /^-I(.*)/ then
      rb_flags << flag
    when /^-d/ then
      rb_flags << flag
    when /^-w/ then
      rb_flags << flag
    else
      false
    end
  }
end