class BigFiles::Config

Configuration for bigfiles gem

Constants

NUM_FILES_DEFAULT

Attributes

exclude[R]
glob[R]
help[R]
minimum_high_water_mark[R]
num_files[R]

Public Class Methods

new(source_finder_option_parser: SourceFinder::OptionParser.new, num_files: Config::NUM_FILES_DEFAULT, quality_threshold: ::HighWaterMark::Threshold.new('bigfiles'), minimum_high_water_mark: 300, help: false, glob: source_finder_option_parser.default_source_files_glob, exclude: source_finder_option_parser .default_source_files_exclude_glob) click to toggle source
# File lib/bigfiles/config.rb, line 12
def initialize(source_finder_option_parser: SourceFinder::OptionParser.new,
               num_files: Config::NUM_FILES_DEFAULT,
               quality_threshold:
                 ::HighWaterMark::Threshold.new('bigfiles'),
               minimum_high_water_mark: 300,
               help: false,
               glob: source_finder_option_parser.default_source_files_glob,
               exclude: source_finder_option_parser
                 .default_source_files_exclude_glob)
  @num_files = num_files
  @help = help
  @glob = glob
  @exclude = exclude
  @quality_threshold = quality_threshold
  @minimum_high_water_mark = minimum_high_water_mark
end

Public Instance Methods

high_water_mark() click to toggle source
# File lib/bigfiles/config.rb, line 29
def high_water_mark
  @quality_threshold.threshold || @minimum_high_water_mark
end
under_limit?(num_lines) click to toggle source
# File lib/bigfiles/config.rb, line 33
def under_limit?(num_lines)
  num_lines <= high_water_mark
end