lib/signore/cli.rb in signore-0.3.1 vs lib/signore/cli.rb in signore-0.3.2

- old
+ new

@@ -1,38 +1,38 @@ require 'forwardable' -require_relative 'database' +require_relative 'repo' require_relative 'settings' require_relative 'sig_from_stream' module Signore class CLI extend Forwardable delegate %i(action tags) => :settings - def initialize(args = ARGV, db: Database.new) + def initialize(args = ARGV, repo: Repo.new) @settings = Settings.new(args) - @db = db + @repo = repo end def run(input: $stdin) case action when 'prego' then puts retrieve_sig when 'pronto' then puts create_sig_from(input) else abort 'usage: signore prego|pronto [tag, …]' end end - attr_reader :db, :settings - private :db, :settings + attr_reader :repo, :settings + private :repo, :settings private def create_sig_from(input) - SigFromStream.sig_from(input, tags: tags).tap { |sig| db << sig } + SigFromStream.sig_from(input, tags: tags).tap { |sig| repo << sig } end def retrieve_sig - db.find(tags: tags) + repo.find(tags: tags) end end end