pry-rescue 1.4.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -1
- data/lib/pry-rescue/kernel_exit_hooks.rb +4 -1
- data/lib/pry-rescue/minitest.rb +4 -2
- data/lib/pry-rescue/rails.rb +5 -3
- data/lib/pry-rescue/rspec.rb +8 -1
- data/pry-rescue.gemspec +1 -1
- metadata +23 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c100b1d2a77a25c90d941e40641bdf84382df35
|
4
|
+
data.tar.gz: 9bf84fe4f040c636b6e1c456ef28f5378d88bdc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7b8e77d58f7fa9e0f7d7170b38904833027ead2ace1216ad86283679c7a76225202a4a4cb686be9cac3de884d60458de7650d00f9b2240b80eaeb8bc5af0ebf
|
7
|
+
data.tar.gz: 1b161c794e9fa6749e9921fe7c02468ddf67147c96252c62f03c018f2f35299865b9fd3a9a9e7bef5783b56a04709977cef1e8764dfb92e3c600eea736229afb
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Super-fast debugging for Ruby. (See [Pry to the rescue!](http://cirw.in/blog/pry-to-the-rescue))
|
4
4
|
<a href="https://travis-ci.org/ConradIrwin/pry-rescue">
|
5
|
-
<img src="https://secure.travis-ci.org/ConradIrwin/pry-rescue.
|
5
|
+
<img src="https://secure.travis-ci.org/ConradIrwin/pry-rescue.svg?branch=master" alt="Build status">
|
6
6
|
</a>
|
7
7
|
|
8
8
|
## Introduction
|
@@ -69,6 +69,15 @@ Then whenever an unhandled exception happens inside Rails, a Pry console will op
|
|
69
69
|
stdout. This is the same terminal that you see the Rails logs on, so if you're
|
70
70
|
using something like [pow](https://pow.cx) then you will run into difficulties.
|
71
71
|
|
72
|
+
If you are using non-default http servers like Unicorn or Thin, you can also trigger
|
73
|
+
this behavior via (after including pry-rescue in your Gemfile):
|
74
|
+
|
75
|
+
```
|
76
|
+
PRY_RESCUE_RAILS=1 bundle exec unicorn
|
77
|
+
```
|
78
|
+
|
79
|
+
|
80
|
+
|
72
81
|
You might also be interested in
|
73
82
|
[better_errors](https://github.com/charliesome/better_errors) which opens consoles in your
|
74
83
|
browser on unhandled exceptions, and [pry-rails](https://github.com/rweng/pry-rails) which
|
data/lib/pry-rescue/minitest.rb
CHANGED
@@ -2,7 +2,9 @@ require 'pry-rescue'
|
|
2
2
|
|
3
3
|
# Minitest 5 handles all unknown exceptions, so to get them out of
|
4
4
|
# minitest, we need to add Exception to its passthrough types
|
5
|
-
|
5
|
+
# Note: We need to check the explicit minitest version because the minitest ecosystem
|
6
|
+
# may redefine Minitest::Test for Minitest versions < 5.
|
7
|
+
if defined?(Minitest::Test) && Minitest::Unit::VERSION.split('.').first.to_i >= 5
|
6
8
|
|
7
9
|
class Minitest::Test
|
8
10
|
alias_method :run_without_rescue, :run
|
@@ -22,7 +24,7 @@ else
|
|
22
24
|
# Unfortunately the version of minitest bundled with ruby seems to
|
23
25
|
# take precedence over the new gem, so we can't do this and still
|
24
26
|
# support ruby-1.9.3
|
25
|
-
|
27
|
+
|
26
28
|
class MiniTest::Unit::TestCase
|
27
29
|
alias_method :run_without_rescue, :run
|
28
30
|
|
data/lib/pry-rescue/rails.rb
CHANGED
@@ -6,9 +6,11 @@ class PryRescue
|
|
6
6
|
# Just adding 'use PryRescue::Rack' inside your rails app will add
|
7
7
|
# the middleware above the rails exception handling middleware,
|
8
8
|
# and so it will not work.
|
9
|
-
|
10
|
-
|
11
|
-
app
|
9
|
+
if defined?(::Rails)
|
10
|
+
class Railtie < ::Rails::Railtie
|
11
|
+
initializer "pry_rescue" do |app|
|
12
|
+
app.config.middleware.use PryRescue::Rack
|
13
|
+
end
|
12
14
|
end
|
13
15
|
end
|
14
16
|
end
|
data/lib/pry-rescue/rspec.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
require 'pry-rescue'
|
2
|
+
require 'rspec'
|
3
|
+
|
2
4
|
class PryRescue
|
3
5
|
class RSpec
|
4
6
|
|
@@ -11,8 +13,13 @@ class PryRescue
|
|
11
13
|
before
|
12
14
|
|
13
15
|
example.binding.eval('@exception = nil; @example && @example.instance_variable_set(:@exception, nil)')
|
16
|
+
example.binding.eval('example.instance_variable_set(:@exception, nil) if defined?(example)')
|
17
|
+
example.binding.eval('@example && @example.example_group_instance.instance_variable_set(:@__memoized, {})')
|
18
|
+
example.binding.eval('example.example_group_instance.instance_variable_set(:@__memoized, {}) if defined?(example)')
|
14
19
|
example.run
|
15
|
-
|
20
|
+
e = example.binding.eval('@exception || @example && @example.instance_variable_get(:@exception)')
|
21
|
+
e ||= example.binding.eval('example.instance_variable_get(:@exception) if defined?(example)')
|
22
|
+
if e
|
16
23
|
Pry::rescued(e)
|
17
24
|
end
|
18
25
|
|
data/pry-rescue.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'pry-rescue'
|
3
|
-
s.version = '1.4.
|
3
|
+
s.version = '1.4.2'
|
4
4
|
s.summary = 'Open a pry session on any unhandled exceptions'
|
5
5
|
s.description = 'Allows you to wrap code in Pry::rescue{ } to open a pry session at any unhandled exceptions'
|
6
6
|
s.homepage = 'https://github.com/ConradIrwin/pry-rescue'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pry-rescue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Conrad Irwin
|
@@ -10,118 +10,118 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2015-05-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: pry
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ">="
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
|
-
- -
|
26
|
+
- - ">="
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: '0'
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: interception
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
|
-
- -
|
33
|
+
- - ">="
|
34
34
|
- !ruby/object:Gem::Version
|
35
35
|
version: '0.5'
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
|
-
- -
|
40
|
+
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '0.5'
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: pry-stack_explorer
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- -
|
47
|
+
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: '0'
|
50
50
|
type: :development
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- -
|
54
|
+
- - ">="
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: '0'
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: rake
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
|
-
- -
|
61
|
+
- - ">="
|
62
62
|
- !ruby/object:Gem::Version
|
63
63
|
version: '0'
|
64
64
|
type: :development
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
|
-
- -
|
68
|
+
- - ">="
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: '0'
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: rspec
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
|
-
- -
|
75
|
+
- - ">="
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '0'
|
78
78
|
type: :development
|
79
79
|
prerelease: false
|
80
80
|
version_requirements: !ruby/object:Gem::Requirement
|
81
81
|
requirements:
|
82
|
-
- -
|
82
|
+
- - ">="
|
83
83
|
- !ruby/object:Gem::Version
|
84
84
|
version: '0'
|
85
85
|
- !ruby/object:Gem::Dependency
|
86
86
|
name: yard
|
87
87
|
requirement: !ruby/object:Gem::Requirement
|
88
88
|
requirements:
|
89
|
-
- -
|
89
|
+
- - ">="
|
90
90
|
- !ruby/object:Gem::Version
|
91
91
|
version: '0'
|
92
92
|
type: :development
|
93
93
|
prerelease: false
|
94
94
|
version_requirements: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
|
-
- -
|
96
|
+
- - ">="
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: '0'
|
99
99
|
- !ruby/object:Gem::Dependency
|
100
100
|
name: redcarpet
|
101
101
|
requirement: !ruby/object:Gem::Requirement
|
102
102
|
requirements:
|
103
|
-
- -
|
103
|
+
- - ">="
|
104
104
|
- !ruby/object:Gem::Version
|
105
105
|
version: '0'
|
106
106
|
type: :development
|
107
107
|
prerelease: false
|
108
108
|
version_requirements: !ruby/object:Gem::Requirement
|
109
109
|
requirements:
|
110
|
-
- -
|
110
|
+
- - ">="
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: '0'
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: capybara
|
115
115
|
requirement: !ruby/object:Gem::Requirement
|
116
116
|
requirements:
|
117
|
-
- -
|
117
|
+
- - ">="
|
118
118
|
- !ruby/object:Gem::Version
|
119
119
|
version: '0'
|
120
120
|
type: :development
|
121
121
|
prerelease: false
|
122
122
|
version_requirements: !ruby/object:Gem::Requirement
|
123
123
|
requirements:
|
124
|
-
- -
|
124
|
+
- - ">="
|
125
125
|
- !ruby/object:Gem::Version
|
126
126
|
version: '0'
|
127
127
|
description: Allows you to wrap code in Pry::rescue{ } to open a pry session at any
|
@@ -136,8 +136,8 @@ executables:
|
|
136
136
|
extensions: []
|
137
137
|
extra_rdoc_files: []
|
138
138
|
files:
|
139
|
-
- .gitignore
|
140
|
-
- .travis.yml
|
139
|
+
- ".gitignore"
|
140
|
+
- ".travis.yml"
|
141
141
|
- Gemfile
|
142
142
|
- LICENSE.MIT
|
143
143
|
- README.md
|
@@ -191,17 +191,17 @@ require_paths:
|
|
191
191
|
- lib
|
192
192
|
required_ruby_version: !ruby/object:Gem::Requirement
|
193
193
|
requirements:
|
194
|
-
- -
|
194
|
+
- - ">="
|
195
195
|
- !ruby/object:Gem::Version
|
196
196
|
version: '0'
|
197
197
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
198
198
|
requirements:
|
199
|
-
- -
|
199
|
+
- - ">="
|
200
200
|
- !ruby/object:Gem::Version
|
201
201
|
version: '0'
|
202
202
|
requirements: []
|
203
203
|
rubyforge_project:
|
204
|
-
rubygems_version: 2.
|
204
|
+
rubygems_version: 2.2.2
|
205
205
|
signing_key:
|
206
206
|
specification_version: 4
|
207
207
|
summary: Open a pry session on any unhandled exceptions
|