zold 0.14.46 → 0.14.47
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/merge.rb +1 -1
- data/lib/zold/commands/node.rb +1 -1
- data/lib/zold/copies.rb +1 -1
- data/lib/zold/http.rb +1 -1
- data/lib/zold/metronome.rb +7 -2
- data/lib/zold/node/farm.rb +1 -1
- data/lib/zold/node/front.rb +1 -1
- data/lib/zold/remotes.rb +2 -2
- data/lib/zold/verbose_thread.rb +1 -1
- data/lib/zold/version.rb +1 -1
- data/test/test_metronome.rb +7 -0
- data/zold.gemspec +1 -0
- metadata +16 -5
- data/lib/zold/backtrace.rb +0 -44
- data/test/test_backtrace.rb +0 -42
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3e066098cbe84a5b065695c6fdc533a45bb9e5e077537eaedb0d36b8d98f5de
|
4
|
+
data.tar.gz: eab40577e1cdd5b6b7d08f210ebf2c98b1879c09d38760227b4d7bf670c61d47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db883f083ea6c65dc4f396e01566876f347202d80cef8ff3bc792df14c088f085cdd72a9b36ea2ee24e8a0162c1bb1d0ed8c39c418918b0062cfb965872352cd
|
7
|
+
data.tar.gz: 388beed99a60d17b4cc0a5fd2f4148379e0c91c4a1aa6fa62488574efb07ba137715c784f5c65151e68540bdafb73641fe35c2701ca85d699e2c04239d1b8649
|
data/lib/zold/commands/merge.rb
CHANGED
data/lib/zold/commands/node.rb
CHANGED
@@ -22,10 +22,10 @@
|
|
22
22
|
|
23
23
|
require 'open3'
|
24
24
|
require 'slop'
|
25
|
+
require 'backtrace'
|
25
26
|
require_relative '../version'
|
26
27
|
require_relative '../age'
|
27
28
|
require_relative '../score'
|
28
|
-
require_relative '../backtrace'
|
29
29
|
require_relative '../metronome'
|
30
30
|
require_relative '../wallet'
|
31
31
|
require_relative '../wallets'
|
data/lib/zold/copies.rb
CHANGED
@@ -22,11 +22,11 @@
|
|
22
22
|
|
23
23
|
require 'time'
|
24
24
|
require 'csv'
|
25
|
+
require 'backtrace'
|
25
26
|
require_relative 'atomic_file'
|
26
27
|
require_relative 'log'
|
27
28
|
require_relative 'size'
|
28
29
|
require_relative 'wallet'
|
29
|
-
require_relative 'backtrace'
|
30
30
|
|
31
31
|
# The list of copies.
|
32
32
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
data/lib/zold/http.rb
CHANGED
data/lib/zold/metronome.rb
CHANGED
@@ -20,10 +20,10 @@
|
|
20
20
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
21
|
# SOFTWARE.
|
22
22
|
|
23
|
+
require 'backtrace'
|
23
24
|
require_relative 'log'
|
24
25
|
require_relative 'age'
|
25
26
|
require_relative 'verbose_thread'
|
26
|
-
require_relative 'backtrace'
|
27
27
|
|
28
28
|
# Background routines.
|
29
29
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
@@ -41,7 +41,12 @@ module Zold
|
|
41
41
|
|
42
42
|
def to_text
|
43
43
|
@threads.map do |t|
|
44
|
-
|
44
|
+
[
|
45
|
+
"#{t.name}:",
|
46
|
+
"status=#{t.status};",
|
47
|
+
"alive=#{t.alive?};\n",
|
48
|
+
t.backtrace.nil? ? '---' : " #{t.backtrace.join("\n ")}"
|
49
|
+
].join(' ')
|
45
50
|
end.join("\n") + "\n\n" + @failures.map { |r, f| "#{r}\n#{f}\n" }.join("\n")
|
46
51
|
end
|
47
52
|
|
data/lib/zold/node/farm.rb
CHANGED
@@ -22,11 +22,11 @@
|
|
22
22
|
|
23
23
|
require 'time'
|
24
24
|
require 'open3'
|
25
|
+
require 'backtrace'
|
25
26
|
require_relative '../log'
|
26
27
|
require_relative '../score'
|
27
28
|
require_relative '../age'
|
28
29
|
require_relative '../verbose_thread'
|
29
|
-
require_relative '../backtrace'
|
30
30
|
require_relative '../atomic_file'
|
31
31
|
|
32
32
|
# The farm of scores.
|
data/lib/zold/node/front.rb
CHANGED
data/lib/zold/remotes.rb
CHANGED
@@ -26,7 +26,7 @@ require 'uri'
|
|
26
26
|
require 'net/http'
|
27
27
|
require 'time'
|
28
28
|
require 'fileutils'
|
29
|
-
|
29
|
+
require 'backtrace'
|
30
30
|
require_relative 'age'
|
31
31
|
require_relative 'score'
|
32
32
|
require_relative 'http'
|
@@ -114,7 +114,7 @@ module Zold
|
|
114
114
|
end
|
115
115
|
|
116
116
|
def assert_score_value(score, min)
|
117
|
-
raise "Score is too small (<#{min}): #{score}" if score.value < min
|
117
|
+
raise "Score #{score.value} is too small (<#{min}): #{score}" if score.value < min
|
118
118
|
end
|
119
119
|
end
|
120
120
|
|
data/lib/zold/verbose_thread.rb
CHANGED
data/lib/zold/version.rb
CHANGED
data/test/test_metronome.rb
CHANGED
@@ -46,6 +46,13 @@ class TestMetronome < Minitest::Test
|
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
|
+
def test_prints_empty_to_text
|
50
|
+
metronome = Zold::Metronome.new(test_log)
|
51
|
+
metronome.start do |m|
|
52
|
+
assert(!m.to_text.nil?)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
49
56
|
def test_continues_even_after_error
|
50
57
|
metronome = Zold::Metronome.new(test_log)
|
51
58
|
routine = BrokenRoutine.new
|
data/zold.gemspec
CHANGED
@@ -54,6 +54,7 @@ and suggests a different architecture for digital wallet maintenance.'
|
|
54
54
|
s.test_files = s.files.grep(%r{^(test|features)/})
|
55
55
|
s.rdoc_options = ['--charset=UTF-8']
|
56
56
|
s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
|
57
|
+
s.add_runtime_dependency 'backtrace', '0.1.0'
|
57
58
|
s.add_runtime_dependency 'cachy', '0.4.2'
|
58
59
|
s.add_runtime_dependency 'concurrent-ruby', '~>1.0'
|
59
60
|
s.add_runtime_dependency 'cucumber', '~>3.1' # has to stay here for Heroku
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zold
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.47
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: backtrace
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.1.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.1.0
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: cachy
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -475,7 +489,6 @@ files:
|
|
475
489
|
- lib/zold/age.rb
|
476
490
|
- lib/zold/amount.rb
|
477
491
|
- lib/zold/atomic_file.rb
|
478
|
-
- lib/zold/backtrace.rb
|
479
492
|
- lib/zold/cached_wallets.rb
|
480
493
|
- lib/zold/commands/alias.rb
|
481
494
|
- lib/zold/commands/args.rb
|
@@ -575,7 +588,6 @@ files:
|
|
575
588
|
- test/test_age.rb
|
576
589
|
- test/test_amount.rb
|
577
590
|
- test/test_atomic_file.rb
|
578
|
-
- test/test_backtrace.rb
|
579
591
|
- test/test_cached_wallets.rb
|
580
592
|
- test/test_copies.rb
|
581
593
|
- test/test_gem.rb
|
@@ -673,7 +685,6 @@ test_files:
|
|
673
685
|
- test/test_age.rb
|
674
686
|
- test/test_amount.rb
|
675
687
|
- test/test_atomic_file.rb
|
676
|
-
- test/test_backtrace.rb
|
677
688
|
- test/test_cached_wallets.rb
|
678
689
|
- test/test_copies.rb
|
679
690
|
- test/test_gem.rb
|
data/lib/zold/backtrace.rb
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2018 Yegor Bugayenko
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in all
|
13
|
-
# copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
# SOFTWARE.
|
22
|
-
|
23
|
-
# Backtrace.
|
24
|
-
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
25
|
-
# Copyright:: Copyright (c) 2018 Yegor Bugayenko
|
26
|
-
# License:: MIT
|
27
|
-
module Zold
|
28
|
-
# Backtrace of an exception
|
29
|
-
class Backtrace
|
30
|
-
def initialize(error)
|
31
|
-
@error = error
|
32
|
-
end
|
33
|
-
|
34
|
-
def to_s
|
35
|
-
[
|
36
|
-
@error.class.name,
|
37
|
-
': ',
|
38
|
-
@error.message,
|
39
|
-
"\n\t",
|
40
|
-
@error.backtrace.reverse.drop_while { |t| !t.include?('zold/') }.reverse.join("\n\t")
|
41
|
-
].join
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
data/test/test_backtrace.rb
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2018 Yegor Bugayenko
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in all
|
13
|
-
# copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
# SOFTWARE.
|
22
|
-
|
23
|
-
require 'minitest/autorun'
|
24
|
-
require_relative '../lib/zold/backtrace'
|
25
|
-
|
26
|
-
# Backtrace test.
|
27
|
-
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
28
|
-
# Copyright:: Copyright (c) 2018 Yegor Bugayenko
|
29
|
-
# License:: MIT
|
30
|
-
class TestBacktrace < Minitest::Test
|
31
|
-
def test_prints_backtrace
|
32
|
-
obj = Object.new
|
33
|
-
def obj.exec
|
34
|
-
raise 'Intended to be here'
|
35
|
-
end
|
36
|
-
obj.exec
|
37
|
-
rescue RuntimeError => e
|
38
|
-
text = Zold::Backtrace.new(e).to_s
|
39
|
-
assert(text.include?('Intended to be here'), text)
|
40
|
-
assert(!text.include?('lib/minitest'), text)
|
41
|
-
end
|
42
|
-
end
|