lib/signore/executable.rb in signore-0.2.0 vs lib/signore/executable.rb in signore-0.2.1

- old
+ new

@@ -1,15 +1,15 @@ module Signore class Executable def initialize args = ARGV, db_factory: Database @settings = settings_from args @db = db_factory.new settings.db_path - unless %w[prego pronto].include? settings.action + unless %w(prego pronto).include? settings.action abort 'usage: signore prego|pronto [tag, …]' end end - def run(input: $stdin) + def run input: $stdin sig = case settings.action when 'prego' then handle_prego settings when 'pronto' then handle_pronto input end puts sig.to_s @@ -27,16 +27,16 @@ value.strip end def handle_prego settings db.find required_tags: settings.required_tags, - forbidden_tags: settings.forbidden_tags + forbidden_tags: settings.forbidden_tags end def handle_pronto input params = params_from input sig = Signature.new params.text, params.author, params.source, - params.subject, settings.required_tags + params.subject, settings.required_tags db << sig sig end def settings_from args