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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c359aed6c4deb0d0a24de1ca8708f6cdb8fac8da481392df5e8a375c5c9edb1a
4
- data.tar.gz: b967d7822af606bcd9f19d6601498d8b00693599512f3a008ece9336334e8f40
3
+ metadata.gz: f3e066098cbe84a5b065695c6fdc533a45bb9e5e077537eaedb0d36b8d98f5de
4
+ data.tar.gz: eab40577e1cdd5b6b7d08f210ebf2c98b1879c09d38760227b4d7bf670c61d47
5
5
  SHA512:
6
- metadata.gz: 6f4c779de8bbcda39f648e7b3e8d062cf9d2462092b109ac23870eb397f23ad15950a1ef32cc461dca17c116a2893595ebd7dd801e798939b4b76b812d0ce433
7
- data.tar.gz: 12c2f331075d390b253928200024b82cea9c78367f0a4155a0407ad0c0c077ddef8037004959cb7c1c41bb92d5e6ff5fb39244c8d23fe5e36fbe3338e841d6da
6
+ metadata.gz: db883f083ea6c65dc4f396e01566876f347202d80cef8ff3bc792df14c088f085cdd72a9b36ea2ee24e8a0162c1bb1d0ed8c39c418918b0062cfb965872352cd
7
+ data.tar.gz: 388beed99a60d17b4cc0a5fd2f4148379e0c91c4a1aa6fa62488574efb07ba137715c784f5c65151e68540bdafb73641fe35c2701ca85d699e2c04239d1b8649
@@ -22,8 +22,8 @@
22
22
 
23
23
  require 'slop'
24
24
  require 'rainbow'
25
+ require 'backtrace'
25
26
  require_relative 'args'
26
- require_relative '../backtrace'
27
27
  require_relative '../age'
28
28
  require_relative '../log'
29
29
  require_relative '../id'
@@ -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'
@@ -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)
@@ -24,7 +24,7 @@ require 'rainbow'
24
24
  require 'uri'
25
25
  require 'timeout'
26
26
  require 'net/http'
27
- require_relative 'backtrace'
27
+ require 'backtrace'
28
28
  require_relative 'version'
29
29
  require_relative 'type'
30
30
 
@@ -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
- "#{t.name}: status=#{t.status}; alive=#{t.alive?};\n #{t.backtrace.join("\n ")}"
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
 
@@ -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.
@@ -31,7 +31,7 @@ require 'get_process_mem'
31
31
  require 'diffy'
32
32
  require 'usagewatch_ext'
33
33
  require 'concurrent'
34
- require_relative '../backtrace'
34
+ require 'backtrace'
35
35
  require_relative '../version'
36
36
  require_relative '../size'
37
37
  require_relative '../wallet'
@@ -26,7 +26,7 @@ require 'uri'
26
26
  require 'net/http'
27
27
  require 'time'
28
28
  require 'fileutils'
29
- require_relative 'backtrace'
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
 
@@ -20,8 +20,8 @@
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
- require_relative 'backtrace'
25
25
 
26
26
  # Verbose thread.
27
27
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
@@ -25,6 +25,6 @@
25
25
  # Copyright:: Copyright (c) 2018 Yegor Bugayenko
26
26
  # License:: MIT
27
27
  module Zold
28
- VERSION = '0.14.46'
28
+ VERSION = '0.14.47'
29
29
  PROTOCOL = 2
30
30
  end
@@ -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
@@ -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.46
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 00:00:00.000000000 Z
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
@@ -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
@@ -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