lib/bigfiles.rb in bigfiles-0.2.2 vs lib/bigfiles.rb in bigfiles-0.3.0

- old
+ new

@@ -1,11 +1,13 @@ # frozen_string_literal: true require 'optparse' require 'bigfiles/file_with_lines' +require 'bigfiles/config_file_parser' require 'bigfiles/option_parser' +require 'bigfiles/config' require 'bigfiles/inspector' require 'bigfiles/version' require 'source_finder/source_file_globber' require 'source_finder/option_parser' @@ -19,17 +21,22 @@ file_with_lines: FileWithLines, source_file_globber: SourceFinder::SourceFileGlobber.new, inspector_class: Inspector, option_parser_class: ::OptionParser, source_finder_option_parser: SourceFinder::OptionParser.new, + yaml_class: YAML, bigfiles_option_parser: ::BigFiles::OptionParser .new(option_parser_class: option_parser_class, io_class: io_class, exiter: exiter, source_finder_option_parser: source_finder_option_parser), - config: bigfiles_option_parser.parse_options(args)) + config_file_parser: ::BigFiles::ConfigFileParser.new(yaml_class: yaml_class), + raw_config: config_file_parser.parse_config_files + .merge(bigfiles_option_parser.parse_options(args)), + config: Config.new(**raw_config)) + @bigfiles_option_parser = bigfiles_option_parser @config = config @inspector = inspector_class.new(source_file_globber: source_file_globber, config: config, file_with_lines: file_with_lines,