zold 0.13.42 → 0.13.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/zold/commands/fetch.rb +2 -2
- data/lib/zold/copies.rb +2 -0
- data/lib/zold/version.rb +1 -1
- data/lib/zold/wallet.rb +1 -1
- data/test/test_wallet.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c1b984c84978412b1cbbc753771396705f0d544
|
4
|
+
data.tar.gz: 653f5e746fbae90ab0609915452eb646e49d86d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7aa48a078b7b037d165eae145f995ce886fb62f3bfe7d0f8b3e6fac984c80b02c6d4c0c5afc51f0c7411d9de28f6e0a607818043bd6c66f8fff4a38b82690784
|
7
|
+
data.tar.gz: 31e5789f3c7bc710b3ee970376c40c140f0d73251ebd0a182e5acf7185ea4e9b0ed94f82b753722d8ca5824fd68274d997d26fe4e7d9038324181d6ffd65b65a
|
data/lib/zold/commands/fetch.rb
CHANGED
@@ -98,8 +98,8 @@ Available options:"
|
|
98
98
|
body = json['body']
|
99
99
|
File.write(f, body)
|
100
100
|
wallet = Wallet.new(f.path)
|
101
|
-
cps.add(body, score.host, score.port, score.value)
|
102
|
-
@log.info("#{r} returned #{body.length}b/#{wallet.txns.count}t \
|
101
|
+
copy = cps.add(body, score.host, score.port, score.value)
|
102
|
+
@log.info("#{r} returned #{body.length}b/#{wallet.txns.count}t as copy ##{copy} \
|
103
103
|
of #{id} in #{(Time.now - start).round(2)}s: #{Rainbow(score.value).green} (#{json['version']})")
|
104
104
|
end
|
105
105
|
score.value
|
data/lib/zold/copies.rb
CHANGED
@@ -54,6 +54,7 @@ module Zold
|
|
54
54
|
save(load.reject { |s| s[:host] == host && s[:port] == port })
|
55
55
|
end
|
56
56
|
|
57
|
+
# Returns the name of the copy
|
57
58
|
def add(content, host, port, score, time = Time.now)
|
58
59
|
raise "Content can't be empty" if content.empty?
|
59
60
|
raise 'TCP port must be of type Integer' unless port.is_a?(Integer)
|
@@ -88,6 +89,7 @@ module Zold
|
|
88
89
|
time: time
|
89
90
|
}
|
90
91
|
save(list)
|
92
|
+
name
|
91
93
|
end
|
92
94
|
|
93
95
|
def all
|
data/lib/zold/version.rb
CHANGED
data/lib/zold/wallet.rb
CHANGED
data/test/test_wallet.rb
CHANGED