class BigFiles::BigFiles
Simple tool to find the largest source files in your project.
Public Class Methods
new(args, io_class: Kernel, exiter: Kernel, 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_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))
click to toggle source
# File lib/bigfiles.rb, line 18 def initialize(args, io_class: Kernel, exiter: Kernel, 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_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, io_class: io_class) end
Public Instance Methods
run()
click to toggle source
# File lib/bigfiles.rb, line 47 def run if @config.help @bigfiles_option_parser.usage else @inspector.find_analyze_and_report_on_files end end