lib/zold/commands/push.rb in zold-0.14.44 vs lib/zold/commands/push.rb in zold-0.14.45

- old
+ new

@@ -24,10 +24,11 @@ require 'slop' require 'json' require 'net/http' require_relative 'args' require_relative '../age' +require_relative '../size' require_relative '../log' require_relative '../id' require_relative '../http' require_relative '../json_page' require_relative '../atomic_file' @@ -94,21 +95,21 @@ end uri = "/wallet/#{id}" response = r.http(uri).put(content) @wallets.find(id) do |wallet| if response.code == '304' - @log.info("#{r}: same version #{content.length}b/#{wallet.txns.count}t \ + @log.info("#{r}: same version #{Size.new(content.length)}/#{wallet.txns.count}t \ of #{wallet.id} there, in #{Age.new(start)}") return 0 end r.assert_code(200, response) json = JsonPage.new(response.body, uri).to_hash score = Score.parse_json(json['score']) r.assert_valid_score(score) r.assert_score_ownership(score) r.assert_score_strength(score) unless opts['ignore-score-weakness'] - @log.info("#{r} accepted #{content.length}b/#{wallet.digest[0, 6]}/#{wallet.txns.count}t of #{wallet.id} \ -in #{Age.new(start)}: #{Rainbow(score.value).green} (#{json['version']})") + @log.info("#{r} accepted #{Size.new(content.length)}/#{wallet.digest[0, 6]}/#{wallet.txns.count}t \ +of #{wallet.id} in #{Age.new(start)}: #{Rainbow(score.value).green} (#{json['version']})") score.value end end end end