lib/bigfiles/option_parser.rb in bigfiles-0.2.1 vs lib/bigfiles/option_parser.rb in bigfiles-0.2.2
- old
+ new
@@ -3,16 +3,15 @@
require_relative 'config'
module BigFiles
# Parse options passed to bigfiles command
class OptionParser
- def initialize(option_parser_class: ::OptionParser,
- io: Kernel,
- exiter: Kernel,
- source_finder_option_parser:)
+ def initialize(source_finder_option_parser:, option_parser_class: ::OptionParser,
+ io_class: Kernel,
+ exiter: Kernel)
@option_parser_class = option_parser_class
- @io = io
+ @io_class = io_class
@exiter = exiter
@source_finder_option_parser = source_finder_option_parser
end
def setup_options(opts)
@@ -46,10 +45,10 @@
Config.new(**options,
source_finder_option_parser: @source_finder_option_parser)
end
def usage
- @io.puts @option_parser
+ @io_class.puts @option_parser
@exiter.exit(1)
end
end
end