interception 0.4 → 0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/CHANGELOG.md +8 -1
- data/README.md +1 -2
- data/ext/extconf.rb +1 -2
- data/ext/interception.c +1 -3
- data/interception.gemspec +1 -1
- data/lib/cross_platform.rb +18 -1
- data/lib/interception.rb +2 -23
- metadata +11 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 851998e2e4fc456efc841bbd27446f74b818e0c1
|
4
|
+
data.tar.gz: 6c3393635cfe406821426805b79c07f4039ba01a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a736ee795daf46f9a115a082aa0dc07fe6069a86f3ca021dddff62a96bb6b53b0b1ba61eb1d2e6e8631bd832e4e5146b4eb4dcc23aa57877ba73768dbae1b63
|
7
|
+
data.tar.gz: c2e1d91162ef85aeaaf1b30326745714e29732803069c6e13866dfd8f73c14545d094ba3ac4885e6522d208832e879bc902750ceb6f24c27eec244b0f61895c1
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,17 @@
|
|
1
1
|
Interception changelog
|
2
2
|
======================
|
3
3
|
|
4
|
+
### v0.5 (March 6, 2014)
|
5
|
+
|
6
|
+
* Added support for MRI 2.1.1
|
7
|
+
* Added support for MRI 2.0.0-p451 (Interception v0.4 supports all the
|
8
|
+
patchlevels prior to this one)
|
9
|
+
* Dropped support for MRI 2.0.0 with patchlevel lower than p451.
|
10
|
+
|
4
11
|
### v0.4 (January 21, 2014)
|
5
12
|
|
6
13
|
* Added support for MRI 2.1.0
|
7
14
|
|
8
15
|
### v0.3 and lower
|
9
16
|
|
10
|
-
* We
|
17
|
+
* We weren't writing changelogs before, sorry.
|
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 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
77
|
* On MRI-1.8.7, the binding sometimes has the wrong value for `self`.
|
79
|
-
* The Interception versions prior to `0.4` **do not** support MRI-2.1.0.
|
78
|
+
* The Interception versions prior to `0.4` **do not** support MRI-2.1.0. `>= 0.4` does support it.
|
80
79
|
|
81
80
|
Meta-fu
|
82
81
|
=======
|
data/ext/extconf.rb
CHANGED
@@ -7,12 +7,11 @@ if RbConfig::CONFIG['ruby_install_name'] == 'jruby'
|
|
7
7
|
f.write "install:\n\tjrubyc --javac org/pryrepl/InterceptionEventHook.java\n"
|
8
8
|
end
|
9
9
|
|
10
|
-
elsif RbConfig::CONFIG['ruby_install_name'] =~ /^ruby/
|
10
|
+
elsif RbConfig::CONFIG['ruby_install_name'] =~ /^ruby/ && RUBY_VERSION.to_f < 2.0
|
11
11
|
|
12
12
|
require 'mkmf'
|
13
13
|
$CFLAGS += " -DRUBY_18" if RUBY_VERSION =~ /^(1.8)/
|
14
14
|
$CFLAGS += " -DRUBY_19" if RUBY_VERSION =~ /^(1.9)/
|
15
|
-
$CFLAGS += " -DRUBY_20" if RUBY_VERSION =~ /^(2.0)/
|
16
15
|
extension_name = "interception"
|
17
16
|
dir_config(extension_name)
|
18
17
|
create_makefile(extension_name)
|
data/ext/interception.c
CHANGED
@@ -46,7 +46,7 @@ interception_stop(VALUE self)
|
|
46
46
|
return Qnil;
|
47
47
|
}
|
48
48
|
|
49
|
-
#elif RUBY_19
|
49
|
+
#elif RUBY_19
|
50
50
|
|
51
51
|
void
|
52
52
|
interception_hook(rb_event_flag_t evflag, VALUE data, VALUE self, ID mid, VALUE klass)
|
@@ -75,8 +75,6 @@ Init_interception()
|
|
75
75
|
{
|
76
76
|
rb_mInterception = rb_define_module("Interception");
|
77
77
|
|
78
|
-
#if defined(RUBY_18) || defined(RUBY_19) || defined(RUBY_20)
|
79
78
|
rb_define_singleton_method(rb_mInterception, "start", interception_start, 0);
|
80
79
|
rb_define_singleton_method(rb_mInterception, "stop", interception_stop, 0);
|
81
|
-
#endif
|
82
80
|
}
|
data/interception.gemspec
CHANGED
data/lib/cross_platform.rb
CHANGED
@@ -59,7 +59,24 @@ class << Interception
|
|
59
59
|
end)
|
60
60
|
end
|
61
61
|
|
62
|
-
|
62
|
+
# For MRI
|
63
|
+
# @note For Ruby 2.0 and later we use the new TracePoint API.
|
64
|
+
elsif RUBY_VERSION.to_f >= 2.0 && RUBY_ENGINE == 'ruby'
|
65
|
+
|
66
|
+
def start
|
67
|
+
@tracepoint ||= TracePoint.new(:raise) do |tp|
|
68
|
+
self.rescue(tp.raised_exception, tp.binding)
|
69
|
+
end
|
70
|
+
|
71
|
+
@tracepoint.enable
|
72
|
+
end
|
73
|
+
|
74
|
+
def stop
|
75
|
+
@tracepoint.disable
|
76
|
+
end
|
77
|
+
|
78
|
+
# For old MRI
|
79
|
+
else
|
63
80
|
|
64
81
|
require File.expand_path('../../ext/interception', __FILE__)
|
65
82
|
|
data/lib/interception.rb
CHANGED
@@ -110,32 +110,11 @@ module Interception
|
|
110
110
|
|
111
111
|
# Start sending events to rescue.
|
112
112
|
# Implemented per-platform
|
113
|
-
|
114
|
-
def self.start
|
115
|
-
if ruby_21?
|
116
|
-
@tracepoint ||= TracePoint.new(:raise) do |tp|
|
117
|
-
self.rescue(tp.raised_exception, tp.binding)
|
118
|
-
end
|
119
|
-
|
120
|
-
@tracepoint.enable
|
121
|
-
else
|
122
|
-
raise NotImplementedError
|
123
|
-
end
|
124
|
-
end
|
113
|
+
def self.start; raise NotImplementedError end
|
125
114
|
|
126
115
|
# Stop sending events to rescue.
|
127
116
|
# Implemented per-platform
|
128
|
-
def self.stop
|
129
|
-
if ruby_21?
|
130
|
-
@tracepoint.disable
|
131
|
-
else
|
132
|
-
raise NotImplementedError
|
133
|
-
end
|
134
|
-
end
|
135
|
-
|
136
|
-
def self.ruby_21?
|
137
|
-
RUBY_VERSION == '2.1.0' && RUBY_ENGINE == 'ruby'
|
138
|
-
end
|
117
|
+
def self.stop; raise NotImplementedError end
|
139
118
|
|
140
119
|
require File.expand_path('../cross_platform.rb', __FILE__)
|
141
120
|
end
|
metadata
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: interception
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.5'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Conrad Irwin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
description: Provides a cross-platform ability to intercept all exceptions as they
|
@@ -46,8 +46,8 @@ extensions:
|
|
46
46
|
- ext/extconf.rb
|
47
47
|
extra_rdoc_files: []
|
48
48
|
files:
|
49
|
-
- .gitignore
|
50
|
-
- .travis.yml
|
49
|
+
- ".gitignore"
|
50
|
+
- ".travis.yml"
|
51
51
|
- CHANGELOG.md
|
52
52
|
- Gemfile
|
53
53
|
- LICENSE.MIT
|
@@ -72,19 +72,18 @@ require_paths:
|
|
72
72
|
- lib
|
73
73
|
required_ruby_version: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
|
-
- -
|
75
|
+
- - ">="
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '0'
|
78
78
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
requirements: []
|
84
84
|
rubyforge_project:
|
85
|
-
rubygems_version: 2.
|
85
|
+
rubygems_version: 2.2.2
|
86
86
|
signing_key:
|
87
87
|
specification_version: 4
|
88
88
|
summary: Intercept exceptions as they are being raised
|
89
89
|
test_files: []
|
90
|
-
has_rdoc:
|