Class: Zold::Diff
- Inherits:
-
Object
- Object
- Zold::Diff
- Defined in:
- lib/zold/commands/diff.rb
Overview
DIFF pulling command
Instance Method Summary collapse
-
#initialize(wallets:, copies:, log: Log::Quiet.new) ⇒ Diff
constructor
A new instance of Diff.
- #run(args = []) ⇒ Object
Constructor Details
Instance Method Details
#run(args = []) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/zold/commands/diff.rb', line 43 def run(args = []) opts = Slop.parse(args, help: true, suppress_errors: true) do |o| o. = "Usage: zold diff [ID...] [options] Available options:" o.bool '--help', 'Print instructions' end mine = Args.new(opts, @log).take || return raise 'At least one wallet ID is required' if mine.empty? stdout = '' mine.each do |id| stdout += diff( @wallets.find(Id.new(id)), Copies.new(File.join(@copies, id)), opts ) end stdout end |