errorspray 0.0.2

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.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NDNhMWY0MWQyYTg0MWI0ODQ4ZjQ3MzY1OTEwYzU1ZjUyZjdmMjBlZg==
5
+ data.tar.gz: !binary |-
6
+ ODc4ODg1MTE3OTVlOWIwODY1NWM5ZWIyMTg4NmNiOWJlNzRkZjk2NA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ YTQ4OWVjOTZkZmExNTE3MDM4MGU3NjNiYzVjNjM3ZDk2ODczNTcyNTgzODFk
10
+ NWVmM2IzYTNlYmNmNGQzNWM2OTYyZjY4MDM0MTU5MzJiN2MxZTBmMzk2MDlh
11
+ YzMzMDE1NWE4NzkzNDkxNTlkNTE2NWViNDU5YWM2YzcyZjgyNDQ=
12
+ data.tar.gz: !binary |-
13
+ MjBlMzNhOTQ4MjE3NjIzNGEyZTZhMTNjNTRmMzQwNmFmOWYwNDA0ZjAwNzNh
14
+ NTc1OGUzZDE5NjAyNTFlODA2MGVjODkzOGZhMmZlOWY0YzhlNzk0Yjk0NjUy
15
+ OTBiZDgyNWJlNmE2NTNmZGJmOWUyYjcxYjI1NWYwNjc1NzMwMjY=
@@ -0,0 +1,2 @@
1
+ require_relative 'exception'
2
+ require_relative 'kernel'
@@ -0,0 +1,23 @@
1
+ class Exception
2
+
3
+ def append_and_raise(*appends)
4
+ message = self.message
5
+ appends.each do |a|
6
+ s = case a
7
+ when String; a
8
+ when Proc
9
+ a.arity > 0 ? a.call(self) : a.call
10
+ else raise "invalid append object: #{a.inspect}"
11
+ end
12
+
13
+ message = case message
14
+ when /\S/
15
+ "#{message}\n #{s}"
16
+ else
17
+ s
18
+ end
19
+ end
20
+ raise self, message, self.backtrace
21
+ end
22
+
23
+ end
@@ -0,0 +1,12 @@
1
+ module Kernel
2
+
3
+ private
4
+ def raise_append(*appends)
5
+ begin
6
+ yield
7
+ rescue Exception => e
8
+ e.append_and_raise *appends
9
+ end
10
+ end
11
+
12
+ end
metadata ADDED
@@ -0,0 +1,46 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: errorspray
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Chris Rogers
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-06-24 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: ''
14
+ email: ''
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/errorspray.rb
20
+ - lib/exception.rb
21
+ - lib/kernel.rb
22
+ homepage: https://github.com/rcrogers/errorspray
23
+ licenses: []
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ! '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubyforge_project:
41
+ rubygems_version: 2.0.3
42
+ signing_key:
43
+ specification_version: 4
44
+ summary: ''
45
+ test_files: []
46
+ has_rdoc: