interception 0.2 → 0.3
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.
- data/ext/interception.c +1 -1
- data/interception.gemspec +1 -1
- data/spec/interception_spec.rb +15 -0
- metadata +39 -61
data/ext/interception.c
CHANGED
@@ -44,7 +44,7 @@ interception_start(VALUE self)
|
|
44
44
|
void
|
45
45
|
interception_hook(rb_event_flag_t evflag, VALUE data, VALUE self, ID mid, VALUE klass)
|
46
46
|
{
|
47
|
-
VALUE binding = rb_funcall(
|
47
|
+
VALUE binding = rb_funcall(rb_mKernel, rb_intern("binding"), 0, NULL);
|
48
48
|
rb_funcall(rb_mInterception, rb_intern("rescue"), 2, rb_errinfo(), binding);
|
49
49
|
}
|
50
50
|
|
data/interception.gemspec
CHANGED
data/spec/interception_spec.rb
CHANGED
@@ -138,4 +138,19 @@ describe Interception do
|
|
138
138
|
it "should have the right exception and binding at the top level" do
|
139
139
|
$initial_eb.last.eval("self").should == TOPLEVEL_BINDING.eval("self")
|
140
140
|
end
|
141
|
+
|
142
|
+
if defined? BasicObject
|
143
|
+
it "should catch exceptions on basic objects" do
|
144
|
+
|
145
|
+
line = __LINE__ + 1
|
146
|
+
foo = Class.new(BasicObject){ def oops; shoulder = :bracket; foops; end }.new
|
147
|
+
begin
|
148
|
+
foo.oops
|
149
|
+
rescue => e1
|
150
|
+
#
|
151
|
+
end
|
152
|
+
|
153
|
+
@exceptions.map{ |e, b| [e] + b.eval('[self, shoulder, __LINE__]') }.should == [[e1, foo, :bracket, line]]
|
154
|
+
end
|
155
|
+
end
|
141
156
|
end
|
metadata
CHANGED
@@ -1,58 +1,46 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: interception
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.3'
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
version: "0.2"
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- Conrad Irwin
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
12
|
+
date: 2012-09-24 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
version_requirements: &7220 !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ! '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
23
20
|
none: false
|
24
|
-
requirements:
|
25
|
-
- - ">="
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
hash: 2002549777813010636
|
28
|
-
segments:
|
29
|
-
- 0
|
30
|
-
version: "0"
|
31
21
|
type: :development
|
32
|
-
version_requirements: *id001
|
33
|
-
- !ruby/object:Gem::Dependency
|
34
|
-
name: rspec
|
35
22
|
prerelease: false
|
36
|
-
|
23
|
+
name: rake
|
24
|
+
requirement: *7220
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
version_requirements: &7284 !ruby/object:Gem::Requirement
|
27
|
+
requirements:
|
28
|
+
- - ! '>='
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '0'
|
37
31
|
none: false
|
38
|
-
requirements:
|
39
|
-
- - ">="
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
hash: 2002549777813010636
|
42
|
-
segments:
|
43
|
-
- 0
|
44
|
-
version: "0"
|
45
32
|
type: :development
|
46
|
-
|
47
|
-
|
33
|
+
prerelease: false
|
34
|
+
name: rspec
|
35
|
+
requirement: *7284
|
36
|
+
description: Provides a cross-platform ability to intercept all exceptions as they
|
37
|
+
are raised.
|
48
38
|
email: conrad.irwin@gmail.com
|
49
39
|
executables: []
|
50
|
-
|
51
|
-
extensions:
|
40
|
+
extensions:
|
52
41
|
- ext/extconf.rb
|
53
42
|
extra_rdoc_files: []
|
54
|
-
|
55
|
-
files:
|
43
|
+
files:
|
56
44
|
- .gitignore
|
57
45
|
- .travis.yml
|
58
46
|
- Gemfile
|
@@ -71,36 +59,26 @@ files:
|
|
71
59
|
- spec/spec_helpers.rb
|
72
60
|
homepage: http://github.com/ConradIrwin/interception
|
73
61
|
licenses: []
|
74
|
-
|
75
62
|
post_install_message:
|
76
63
|
rdoc_options: []
|
77
|
-
|
78
|
-
require_paths:
|
64
|
+
require_paths:
|
79
65
|
- lib
|
80
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
66
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ! '>='
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
81
71
|
none: false
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
- 0
|
88
|
-
version: "0"
|
89
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
90
77
|
none: false
|
91
|
-
requirements:
|
92
|
-
- - ">="
|
93
|
-
- !ruby/object:Gem::Version
|
94
|
-
hash: 2002549777813010636
|
95
|
-
segments:
|
96
|
-
- 0
|
97
|
-
version: "0"
|
98
78
|
requirements: []
|
99
|
-
|
100
79
|
rubyforge_project:
|
101
|
-
rubygems_version: 1.8.
|
80
|
+
rubygems_version: 1.8.12
|
102
81
|
signing_key:
|
103
82
|
specification_version: 3
|
104
83
|
summary: Intercept exceptions as they are being raised
|
105
84
|
test_files: []
|
106
|
-
|