abstractivator 0.11.0 → 0.12.0

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: f18af3078d619bc2873868c5380d6805176fb293
4
- data.tar.gz: 04f5323cd31527c7bc054d85442f75d4f7af004d
3
+ metadata.gz: df9bb6dd07703c4bacac08956bd4e51a3534a5a1
4
+ data.tar.gz: 2fd3fba6853fb45048b54d1dd5c2291e32349595
5
5
  SHA512:
6
- metadata.gz: 5b0770b3a986cc32eaba2cf16f580213945d2f0ddcc952b9e4329a6172546eb2730b3b48ab00ed43dbda90cd410450259cc2b2f9a5c601f0c394feeccef6c816
7
- data.tar.gz: fedfa2e90a1babb66d26047547d5f52f6298b3ecdd7e2c78f3baacd11426a35a5aac6b1706ae7fb53ebe95792106bd9558aef522f1be407c25a1380376560891
6
+ metadata.gz: 44a9cf135bf5f587a19b27919fa4e55d51decdfc1f5d9ea1da56e09525e6a232079151050753cad2bef5809caf3671e9681c3ea1691358deaebc70d0568669c3
7
+ data.tar.gz: a543479b06698f25045f4056971c208c711d24394a374e638aaf4fc3f3174e6eba9b9efd1674f90d0327f40f9c8046bf1be5ea60678b7e0fb2745f159206c3c7
@@ -0,0 +1,12 @@
1
+ class Exception
2
+ def print_full_trace(io=STDOUT)
3
+ io.puts "#{self.class}: #{message}"
4
+ backtrace.each do |f|
5
+ io.puts " at #{f}"
6
+ end
7
+ if cause
8
+ io.puts '--- Caused by ---'
9
+ cause.print_full_trace(io)
10
+ end
11
+ end
12
+ end
@@ -1,3 +1,3 @@
1
1
  module Abstractivator
2
- VERSION = '0.11.0'
2
+ VERSION = '0.12.0'
3
3
  end
@@ -0,0 +1,22 @@
1
+ require 'rspec'
2
+ require 'abstractivator/exception_ext'
3
+ require 'stringio'
4
+
5
+ describe Exception do
6
+ describe '#print_full_trace' do
7
+ it 'prints the full trace including causes' do
8
+ io = StringIO.new
9
+ begin
10
+ begin
11
+ raise ArgumentError, 'x must not be nil'
12
+ rescue => e
13
+ raise 'there was an error'
14
+ end
15
+ rescue => e
16
+ e.print_full_trace
17
+ e.print_full_trace(io)
18
+ end
19
+ expect(io.string).to match /RuntimeError: there was an error.*Caused by.*ArgumentError: x must not be nil/m
20
+ end
21
+ end
22
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abstractivator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Winton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-07 00:00:00.000000000 Z
11
+ date: 2017-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -124,6 +124,7 @@ files:
124
124
  - lib/abstractivator/enumerable_ext.rb
125
125
  - lib/abstractivator/enumerator_ext.rb
126
126
  - lib/abstractivator/event.rb
127
+ - lib/abstractivator/exception_ext.rb
127
128
  - lib/abstractivator/fiber_defer.rb
128
129
  - lib/abstractivator/lazy.rb
129
130
  - lib/abstractivator/module_ext.rb
@@ -162,6 +163,7 @@ files:
162
163
  - spec/lib/abstractivator/trees/tree_map_spec.rb
163
164
  - spec/lib/abstractivator/value_map_spec.rb
164
165
  - spec/lib/enumerable_ext_spec.rb
166
+ - spec/lib/exception_ext_spec.rb
165
167
  - update_version.sh
166
168
  homepage: ''
167
169
  licenses:
@@ -209,3 +211,5 @@ test_files:
209
211
  - spec/lib/abstractivator/trees/tree_map_spec.rb
210
212
  - spec/lib/abstractivator/value_map_spec.rb
211
213
  - spec/lib/enumerable_ext_spec.rb
214
+ - spec/lib/exception_ext_spec.rb
215
+ has_rdoc: