zold 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b8696570973418a3a7949a97a04ca75960e89901
4
- data.tar.gz: 218143effd7d49db522ee6fb2e94ac8acbaf8830
3
+ metadata.gz: 148ca4cd62aba20f6f36418633367a7e40507ba8
4
+ data.tar.gz: a3f2c6133d23487bacb37b4ba9dddaf4a1035d2d
5
5
  SHA512:
6
- metadata.gz: b8d317357191c4601e93692c3f781353163d11f52142899ccbe60cf0797318133b62f5dd9cdf00cdeb89df9bbf863b1bfad8ddf277482180f2dfd83fd7156719
7
- data.tar.gz: c91677573ba5ecbe85de3753b887efe5070a03f43b201955b723f50d89cbb008ab24f53792e1976f677f122d58d2c43f173adbefef816bf43bf9492d51119af5
6
+ metadata.gz: d9e53c293c80ad8ac94f4270f2cb6501265c7bade6fa2b98e0bf55c4c8da1982c50a149736ce357c781379b0fc61dcbaf50a46edaa1929517abeeff24682f476
7
+ data.tar.gz: 16fe75629039be9c7ea748891900788a37a317fc64d800b29abd263bfeabf60547c081638a9a1276594a2573b43e6568466c0204d71a284cc2ea32b0260fb73c
@@ -111,6 +111,10 @@ module Zold
111
111
  # nothing
112
112
  end
113
113
 
114
+ def fatal(msg)
115
+ @log.error(msg)
116
+ end
117
+
114
118
  def debug?
115
119
  @log.info?
116
120
  end
@@ -60,7 +60,11 @@ Available options:"
60
60
  @remotes.all.each do |r|
61
61
  uri = URI("#{r[:home]}wallet/#{wallet.id}")
62
62
  response = Http.new(uri).put(File.read(wallet.path))
63
- if response.code != '304' && response.code != '200'
63
+ if response.code == '304'
64
+ @log.info("#{uri}: same version there")
65
+ next
66
+ end
67
+ unless response.code == '200'
64
68
  @log.error("#{uri} failed as #{response.code}/#{response.message}")
65
69
  next
66
70
  end
@@ -110,9 +110,7 @@ module Zold
110
110
  body = request.body.read
111
111
  if wallet.exists? && File.read(wallet.path) == body
112
112
  status 304
113
- return JSON.pretty_generate(
114
- version: VERSION, score: score.to_h
115
- )
113
+ return
116
114
  end
117
115
  cps = copies(id)
118
116
  cps.add(body, 'remote', Remotes::PORT, 0)
@@ -127,6 +125,7 @@ module Zold
127
125
  log: settings.log
128
126
  ).run([id.to_s])
129
127
  cps.remove('remote', Remotes::PORT)
128
+ require_relative '../commands/push'
130
129
  modified.each do |m|
131
130
  Zold::Push.new(
132
131
  wallets: wallets, remotes: settings.remotes,
@@ -23,5 +23,5 @@
23
23
  # Copyright:: Copyright (c) 2018 Yegor Bugayenko
24
24
  # License:: MIT
25
25
  module Zold
26
- VERSION = '0.4.3'.freeze
26
+ VERSION = '0.4.4'.freeze
27
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zold
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko