lib/zold/commands/fetch.rb in zold-0.1.1 vs lib/zold/commands/fetch.rb in zold-0.1.2

- old
+ new

@@ -30,20 +30,20 @@ # Copyright:: Copyright (c) 2018 Yegor Bugayenko # License:: MIT module Zold # FETCH pulling command class Fetch - def initialize(wallet:, remotes:, copies:, log: Log::Quiet.new) - @wallet = wallet + def initialize(id:, remotes:, copies:, log: Log::Quiet.new) + @id = id @remotes = remotes @copies = copies @log = log end def run(_ = []) total = 0 @remotes.all.each do |r| - uri = URI("#{r[:home]}wallet/#{@wallet.id}") + uri = URI("#{r[:home]}wallet/#{@id}") res = Http.new(uri).get unless res.code == '200' @log.error("#{r[:host]}:#{r[:port]} \ #{Rainbow(res.code).red}/#{res.message} at #{uri}") next