lib/rubysmith/cli/parsers/build.rb in rubysmith-0.9.1 vs lib/rubysmith/cli/parsers/build.rb in rubysmith-0.10.0
- old
+ new
@@ -4,27 +4,25 @@
module CLI
module Parsers
# Handles parsing of Command Line Interface (CLI) build options.
# :reek:TooManyMethods
class Build
- def self.call client:, options:
- new(client: client, options: options).call
- end
+ def self.call(options: {}, client: CLIENT) = new(options: options, client: client).call
- def initialize client: CLIENT, options: {}
- @client = client
+ def initialize options: {}, client: CLIENT
@options = options
+ @client = client
end
def call arguments = []
client.separator "\nBUILD OPTIONS:\n"
private_methods.sort.grep(/add_/).each { |method| __send__ method }
arguments.empty? ? arguments : client.parse!(arguments)
end
private
- attr_reader :client, :options
+ attr_reader :options, :client
def add_minimum
client.on "--min", "Use minimum/no options." do |value|
options[:build_minimum] = value
end