lib/sym/app/args.rb in sym-2.8.5 vs lib/sym/app/args.rb in sym-2.10.0
- old
+ new
@@ -10,11 +10,11 @@
attr_accessor :opts, :selected_options
def initialize(opts)
self.opts = opts
- self.selected_options = opts.keys.reject { |k| !opts[k] }
+ self.selected_options = opts.keys.select { |k| opts[k] }
end
def specify_key?
do?(OPTIONS_SPECIFY_KEY)
end
@@ -31,13 +31,14 @@
output_type = OPTIONS_SPECIFY_OUTPUT.find { |o| opts[o] } # includes nil
Sym::App::Output.outputs[output_type]
end
def provided_options
- opts.to_hash.keys.reject { |k| !opts[k] }
+ opts.to_hash.keys.select { |k| opts[k] }
end
private
+
def do?(list)
!(list & selected_options).empty?
end
end