interception 0.1 → 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.
data/README.md CHANGED
@@ -74,9 +74,8 @@ Known bugs
74
74
  ==========
75
75
 
76
76
  * On rubinius we don't catch some low-level exceptions (like `ZeroDivisionError`).
77
- * On jruby, the binding sometimes has the wrong value for `self` (in `NoMethodError`s).
77
+ * On jruby 1.6, the binding has the wrong value for `self` in `NoMethodError`s. ([fixed](https://github.com/jruby/jruby/commit/4246d96f63155aeb70694a9a0ace0eeb2c936065) in jruby-head)
78
78
  * On MRI-1.8.7, the binding sometimes has the wrong value for `self`.
79
- * No known bugs on MRI-1.9.3
80
79
 
81
80
  Meta-fu
82
81
  =======
@@ -10,7 +10,7 @@ if RbConfig::CONFIG['ruby_install_name'] == 'jruby'
10
10
  elsif RbConfig::CONFIG['ruby_install_name'] =~ /^ruby/
11
11
 
12
12
  require 'mkmf'
13
- $CFLAGS += " -DRUBY_19" if RUBY_VERSION =~ /^1.9/
13
+ $CFLAGS += " -DRUBY_18" if RUBY_VERSION =~ /^(1.8)/
14
14
  extension_name = "interception"
15
15
  dir_config(extension_name)
16
16
  create_makefile(extension_name)
@@ -16,22 +16,7 @@ extern struct FRAME {
16
16
  unsigned long uniq;
17
17
  } *ruby_frame;
18
18
 
19
- #ifdef RUBY_19
20
-
21
- void
22
- interception_hook(rb_event_flag_t evflag, VALUE data, VALUE self, ID mid, VALUE klass)
23
- {
24
- VALUE binding = rb_funcall(self, rb_intern("binding"), 0, NULL);
25
- rb_funcall(rb_mInterception, rb_intern("rescue"), 2, rb_errinfo(), binding);
26
- }
27
-
28
- VALUE
29
- interception_start(VALUE self)
30
- {
31
- rb_add_event_hook(interception_hook, RUBY_EVENT_RAISE, rb_mInterception);
32
- }
33
-
34
- #else
19
+ #ifdef RUBY_18
35
20
 
36
21
  #include "node.h"
37
22
 
@@ -51,6 +36,23 @@ VALUE
51
36
  interception_start(VALUE self)
52
37
  {
53
38
  rb_add_event_hook(interception_hook, RUBY_EVENT_RAISE);
39
+ return Qnil;
40
+ }
41
+
42
+ #else
43
+
44
+ void
45
+ interception_hook(rb_event_flag_t evflag, VALUE data, VALUE self, ID mid, VALUE klass)
46
+ {
47
+ VALUE binding = rb_funcall(self, rb_intern("binding"), 0, NULL);
48
+ rb_funcall(rb_mInterception, rb_intern("rescue"), 2, rb_errinfo(), binding);
49
+ }
50
+
51
+ VALUE
52
+ interception_start(VALUE self)
53
+ {
54
+ rb_add_event_hook(interception_hook, RUBY_EVENT_RAISE, rb_mInterception);
55
+ return Qnil;
54
56
  }
55
57
 
56
58
  #endif
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "interception"
3
- s.version = "0.1"
3
+ s.version = "0.2"
4
4
  s.author = "Conrad Irwin"
5
5
  s.email = "conrad.irwin@gmail.com"
6
6
  s.homepage = "http://github.com/ConradIrwin/interception"
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: interception
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 4423076201732757652
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 1
9
- version: "0.1"
8
+ - 2
9
+ version: "0.2"
10
10
  platform: ruby
11
11
  authors:
12
12
  - Conrad Irwin
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2012-08-12 00:00:00 Z
17
+ date: 2012-09-23 00:00:00 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: rake
@@ -24,7 +24,7 @@ dependencies:
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- hash: 3
27
+ hash: 2002549777813010636
28
28
  segments:
29
29
  - 0
30
30
  version: "0"
@@ -38,7 +38,7 @@ dependencies:
38
38
  requirements:
39
39
  - - ">="
40
40
  - !ruby/object:Gem::Version
41
- hash: 3
41
+ hash: 2002549777813010636
42
42
  segments:
43
43
  - 0
44
44
  version: "0"
@@ -82,7 +82,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
82
82
  requirements:
83
83
  - - ">="
84
84
  - !ruby/object:Gem::Version
85
- hash: 3
85
+ hash: 2002549777813010636
86
86
  segments:
87
87
  - 0
88
88
  version: "0"
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  requirements:
92
92
  - - ">="
93
93
  - !ruby/object:Gem::Version
94
- hash: 3
94
+ hash: 2002549777813010636
95
95
  segments:
96
96
  - 0
97
97
  version: "0"
@@ -104,4 +104,3 @@ specification_version: 3
104
104
  summary: Intercept exceptions as they are being raised
105
105
  test_files: []
106
106
 
107
- has_rdoc: