Class: BigFiles::Config
- Inherits:
-
Object
- Object
- BigFiles::Config
- Defined in:
- lib/bigfiles/config.rb
Overview
Configuration for bigfiles gem
Constant Summary collapse
- NUM_FILES_DEFAULT =
3
Instance Attribute Summary collapse
-
#exclude ⇒ Object
readonly
Returns the value of attribute exclude.
-
#glob ⇒ Object
readonly
Returns the value of attribute glob.
-
#help ⇒ Object
readonly
Returns the value of attribute help.
-
#minimum_high_water_mark ⇒ Object
readonly
Returns the value of attribute minimum_high_water_mark.
-
#num_files ⇒ Object
readonly
Returns the value of attribute num_files.
Instance Method Summary collapse
- #high_water_mark ⇒ Object
-
#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) ⇒ Config
constructor
A new instance of Config.
- #under_limit?(num_lines) ⇒ Boolean
Constructor Details
#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) ⇒ Config
Returns a new instance of Config.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/bigfiles/config.rb', line 13 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 |
Instance Attribute Details
#exclude ⇒ Object (readonly)
Returns the value of attribute exclude.
11 12 13 |
# File 'lib/bigfiles/config.rb', line 11 def exclude @exclude end |
#glob ⇒ Object (readonly)
Returns the value of attribute glob.
11 12 13 |
# File 'lib/bigfiles/config.rb', line 11 def glob @glob end |
#help ⇒ Object (readonly)
Returns the value of attribute help.
11 12 13 |
# File 'lib/bigfiles/config.rb', line 11 def help @help end |
#minimum_high_water_mark ⇒ Object (readonly)
Returns the value of attribute minimum_high_water_mark.
11 12 13 |
# File 'lib/bigfiles/config.rb', line 11 def minimum_high_water_mark @minimum_high_water_mark end |
#num_files ⇒ Object (readonly)
Returns the value of attribute num_files.
11 12 13 |
# File 'lib/bigfiles/config.rb', line 11 def num_files @num_files end |
Instance Method Details
#high_water_mark ⇒ Object
30 31 32 |
# File 'lib/bigfiles/config.rb', line 30 def high_water_mark @quality_threshold.threshold || @minimum_high_water_mark end |
#under_limit?(num_lines) ⇒ Boolean
34 35 36 |
# File 'lib/bigfiles/config.rb', line 34 def under_limit?(num_lines) num_lines <= high_water_mark end |