zold 0.9.5 → 0.9.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/zold +2 -2
- data/lib/zold/commands/clean.rb +2 -1
- data/lib/zold/commands/node.rb +1 -1
- data/lib/zold/node/entrance.rb +1 -1
- data/lib/zold/version.rb +1 -1
- data/test/commands/test_clean.rb +5 -5
- data/test/commands/test_push.rb +6 -13
- 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: 03f770700b197238978800aa6bb79d2b65dc973a
|
4
|
+
data.tar.gz: 0cc1fcc216c91280b4a79b5fcc37b2acb3b71129
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3aca2c11779ca1fee660873ff96d46ef63dc300461cdf0893be52fb169dbe517e1aae726ca36e70ba9b78cc17a6c6bd7a98b449daa1e5fd4f5a2b9c761df490e
|
7
|
+
data.tar.gz: 33cf35b1d960adfeee89236e51589305eff0f7c361c693b95a4c7f02380b657401c55ee436782781cc4b147cebf1edb0c32f620b46660f1a69af289ad96ebe8f
|
data/bin/zold
CHANGED
@@ -145,7 +145,7 @@ Available options:"
|
|
145
145
|
Zold::Fetch.new(wallets: wallets, remotes: remotes, copies: copies, log: log).run(args)
|
146
146
|
when 'clean'
|
147
147
|
require_relative '../lib/zold/commands/clean'
|
148
|
-
Zold::Clean.new(copies: copies, log: log).run(args)
|
148
|
+
Zold::Clean.new(wallets: wallets, copies: copies, log: log).run(args)
|
149
149
|
when 'diff'
|
150
150
|
require_relative '../lib/zold/commands/diff'
|
151
151
|
Zold::Diff.new(wallets: wallets, copies: copies, log: log).run(args)
|
@@ -161,7 +161,7 @@ Available options:"
|
|
161
161
|
require_relative '../lib/zold/commands/merge'
|
162
162
|
Zold::Merge.new(wallets: wallets, copies: copies, log: log).run(args)
|
163
163
|
require_relative '../lib/zold/commands/clean'
|
164
|
-
Zold::Clean.new(copies: copies, log: log).run(args)
|
164
|
+
Zold::Clean.new(wallets: wallets, copies: copies, log: log).run(args)
|
165
165
|
when 'taxes'
|
166
166
|
require_relative '../lib/zold/commands/taxes'
|
167
167
|
Zold::Taxes.new(wallets: wallets, log: log).run(args)
|
data/lib/zold/commands/clean.rb
CHANGED
data/lib/zold/commands/node.rb
CHANGED
@@ -97,7 +97,7 @@ module Zold
|
|
97
97
|
invoice = opts[:invoice]
|
98
98
|
unless invoice.include?('@')
|
99
99
|
require_relative 'invoice'
|
100
|
-
invoice = Invoice.new(wallets:
|
100
|
+
invoice = Invoice.new(wallets: wallets, log: @log).run(['invoice', invoice])
|
101
101
|
end
|
102
102
|
farm = Farm.new(invoice, log: @log)
|
103
103
|
farm.start(
|
data/lib/zold/node/entrance.rb
CHANGED
@@ -82,7 +82,7 @@ module Zold
|
|
82
82
|
Push.new(
|
83
83
|
wallets: @wallets, remotes: @remotes, log: @log
|
84
84
|
).run(['push'] + modified.map(&:to_s))
|
85
|
-
Clean.new(copies: copies.root, log: @log).run(['clean', id.to_s])
|
85
|
+
Clean.new(wallets: @wallets, copies: copies.root, log: @log).run(['clean', id.to_s])
|
86
86
|
modified
|
87
87
|
end
|
88
88
|
end
|
data/lib/zold/version.rb
CHANGED
data/test/commands/test_clean.rb
CHANGED
@@ -19,8 +19,8 @@
|
|
19
19
|
# SOFTWARE.
|
20
20
|
|
21
21
|
require 'minitest/autorun'
|
22
|
-
require 'tmpdir'
|
23
22
|
require 'time'
|
23
|
+
require_relative '../fake_home'
|
24
24
|
require_relative '../test__helper'
|
25
25
|
require_relative '../../lib/zold/copies'
|
26
26
|
require_relative '../../lib/zold/commands/clean'
|
@@ -31,12 +31,12 @@ require_relative '../../lib/zold/commands/clean'
|
|
31
31
|
# License:: MIT
|
32
32
|
class TestClean < Minitest::Test
|
33
33
|
def test_cleans_copies
|
34
|
-
|
35
|
-
|
36
|
-
copies =
|
34
|
+
FakeHome.new.run do |home|
|
35
|
+
wallet = home.create_wallet
|
36
|
+
copies = home.copies(wallet)
|
37
37
|
copies.add('a1', 'host-1', 80, 1, Time.now - 26 * 60 * 60)
|
38
38
|
copies.add('a2', 'host-2', 80, 2, Time.now - 26 * 60 * 60)
|
39
|
-
Zold::Clean.new(copies: copies.root, log: $log).run(['clean', id.to_s])
|
39
|
+
Zold::Clean.new(wallets: home.wallets, copies: copies.root, log: $log).run(['clean', wallet.id.to_s])
|
40
40
|
assert(copies.all.empty?)
|
41
41
|
end
|
42
42
|
end
|
data/test/commands/test_push.rb
CHANGED
@@ -19,10 +19,8 @@
|
|
19
19
|
# SOFTWARE.
|
20
20
|
|
21
21
|
require 'minitest/autorun'
|
22
|
-
require 'tmpdir'
|
23
|
-
require 'json'
|
24
|
-
require 'time'
|
25
22
|
require 'webmock/minitest'
|
23
|
+
require_relative '../fake_home'
|
26
24
|
require_relative '../test__helper'
|
27
25
|
require_relative '../../lib/zold/wallet'
|
28
26
|
require_relative '../../lib/zold/wallets'
|
@@ -37,16 +35,11 @@ require_relative '../../lib/zold/commands/push'
|
|
37
35
|
# License:: MIT
|
38
36
|
class TestPush < Minitest::Test
|
39
37
|
def test_pushes_wallet
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
remotes = Zold::Remotes.new(File.join(dir, 'remotes.csv'))
|
46
|
-
remotes.clean
|
47
|
-
stub_request(:put, "http://fake-1/wallet/#{id}").to_return(status: 304)
|
48
|
-
Zold::Push.new(wallets: wallets, remotes: remotes, log: $log).run(
|
49
|
-
['--ignore-this-stupid-option', 'push', id.to_s]
|
38
|
+
FakeHome.new.run do |home|
|
39
|
+
wallet = home.create_wallet
|
40
|
+
stub_request(:put, "http://fake-1/wallet/#{wallet.id}").to_return(status: 304)
|
41
|
+
Zold::Push.new(wallets: home.wallets, remotes: home.remotes, log: $log).run(
|
42
|
+
['--ignore-this-stupid-option', 'push', wallet.id.to_s]
|
50
43
|
)
|
51
44
|
end
|
52
45
|
end
|