pry-rescue 0.9 → 0.9.1.martin

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -11,19 +11,6 @@ instead of `ruby`:
11
11
  rescue <script.rb> [arguments..]
12
12
  ```
13
13
 
14
- If you're using Rails, you should add `pry-rescue` to the development section of your
15
- Gemspec and then run rails server using rescue:
16
-
17
- ```
18
- rescue rails server
19
- ```
20
-
21
- If you're using `bundle exec` the rescue should go after the exec:
22
-
23
- ```
24
- bundle exec rescue rails server
25
- ```
26
-
27
14
  If you're using Rack, you should use the middleware instead (though be careful to only
28
15
  include it in development!)
29
16
  ```
@@ -62,19 +49,6 @@ from examples/example.rb:7:in `rescue in test'
62
49
  [1] pry(main)>
63
50
  ```
64
51
 
65
- Finally. If you're doing your own exception handling, you can ask pry to open on an exception that you've caught.
66
- For this to work you must be inside a Pry::rescue{ } block.
67
-
68
- ```ruby
69
- def test
70
- raise "foo"
71
- rescue => e
72
- Pry::rescued(e)
73
- end
74
-
75
- Pry::rescue{ test }
76
- ```
77
-
78
52
  cd-cause
79
53
  ========
80
54
 
@@ -119,24 +93,51 @@ From: examples/example.rb @ line 4 Object#test:
119
93
  foo
120
94
  ```
121
95
 
96
+ Pry::rescued
97
+ ============
98
+
99
+ If your exception handling needs are truly complicated then you can pass explicitly
100
+ rescued exceptions into Pry::rescue:
101
+
102
+ ```ruby
103
+ def test
104
+ raise "foo"
105
+ end
106
+
107
+ def safely_test
108
+ test
109
+ rescue => e
110
+ Pry::rescued e
111
+ end
112
+
113
+ Pry::rescue do
114
+ safely_test
115
+ end
116
+ ```
117
+
118
+ This lets you open a Pry session as part of your normal exception handling. N.B.
119
+ `Pry::rescued` must always be called from somewhere within a `Pry::rescue`, and the
120
+ exception object you pass to it must have actually been raised!
121
+
122
122
  pry-stack explorer
123
123
  ==================
124
124
 
125
125
  If you're running rubinius, or ruby-1.9, then you can use `pry-rescue` alongside
126
- `pry-stack\_explorer`. This gives you the ability to move `up` or `down` the stack so that
126
+ `pry-stack_explorer`. This gives you the ability to move `up` or `down` the stack so that
127
127
  you can get a better idea of why your function ended up in a bad state. Run
128
128
  [example2.rb](https://github.com/ConradIrwin/pry-rescue/blob/master/examples/example2.rb) to get a feel for what this is like.
129
129
 
130
- Known bugs
131
- ==========
132
-
133
- * ruby 2.0, 1.9.3, 1.9.2 – no known bugs
134
- * ruby 1.9.1 — not supported
135
- * ruby 1.8.7 — occasional incorrect values for self
136
- * ree 1.8.7 — no known bugs
137
- * jruby 1.7 (1.8 mode and 1.9 mode) no known bugs
138
- * jruby 1.6 (1.8 mode and 1.9 mode) — incorrect value for self in NoMethodErrors
139
- * rbx (1.8 mode and 1.9 mode) does not catch some low-level errors (e.g. ZeroDivisionError)
130
+ Compatibility
131
+ =============
132
+
133
+ * mri 2.0
134
+ * mri 1.9.3
135
+ * mri 1.9.2
136
+ * mri 1.8.7 — occasionally the value for `self` will be incorrect.
137
+ * ree 1.8.7 occasionally the value for `self` will be incorrect.
138
+ * jruby-head (--1.8, --1.9)
139
+ * jruby 1.6 (--1.8, --1.9) the value for `self` is incorrect in `NoMethodError`s.
140
+ * rubinius (-Xversion=18, -Xversion=19) — some low-level exceptions are missed (e.g. ZeroDivisionError when doing `1 / 0`)
140
141
 
141
142
  Meta-fu
142
143
  =======
data/bin/rescue CHANGED
@@ -17,11 +17,6 @@ What it does:
17
17
 
18
18
  }
19
19
 
20
- if ARGV[0] == 'rails'
21
- ENV['PRY_RESCUE_RAILS'] = 'true'
22
- exec(*ARGV)
23
- end
24
-
25
20
  if script = ARGV.shift
26
21
  $0 = File.expand_path(script)
27
22
  if File.exists? script
@@ -6,10 +6,6 @@ require File.expand_path('../pry-rescue/core_ext', __FILE__)
6
6
  require File.expand_path('../pry-rescue/commands', __FILE__)
7
7
  require File.expand_path('../pry-rescue/rack', __FILE__)
8
8
 
9
- if ENV['PRY_RESCUE_RAILS']
10
- require File.expand_path('../pry-rescue/rails', __FILE__)
11
- end
12
-
13
9
  begin
14
10
  require 'pry-stack_explorer'
15
11
  rescue LoadError
@@ -93,9 +89,7 @@ class PryRescue
93
89
  # @param [String] file the absolute path
94
90
  # @return [Boolean]
95
91
  def user_path?(file)
96
- !file.start_with?(RbConfig::CONFIG['libdir']) &&
97
- !Gem::Specification.any?{ |gem| file.start_with?(gem.full_gem_path) } &&
98
- !(file == '<internal:prelude>')
92
+ !file.start_with?(RbConfig::CONFIG['libdir'])
99
93
  end
100
94
 
101
95
  # Remove bindings that are part of Interception/Pry.rescue's internal
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'pry-rescue'
3
- s.version = '0.9'
3
+ s.version = '0.9.1.martin'
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,96 +1,109 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: pry-rescue
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 9
8
- version: "0.9"
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.9.1.martin
5
+ prerelease: 6
9
6
  platform: ruby
10
- authors:
7
+ authors:
11
8
  - Conrad Irwin
12
9
  - banisterfiend
13
10
  - epitron
14
11
  autorequire:
15
12
  bindir: bin
16
13
  cert_chain: []
17
-
18
- date: 2012-09-30 00:00:00 -07:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
14
+ date: 2012-10-03 00:00:00.000000000 Z
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
22
17
  name: pry
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- segments:
29
- - 0
30
- version: "0"
18
+ requirement: !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - ! '>='
22
+ - !ruby/object:Gem::Version
23
+ version: '0'
31
24
  type: :runtime
32
- version_requirements: *id001
33
- - !ruby/object:Gem::Dependency
34
- name: interception
35
25
  prerelease: false
36
- requirement: &id002 !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- segments:
41
- - 0
42
- - 3
43
- version: "0.3"
26
+ version_requirements: !ruby/object:Gem::Requirement
27
+ none: false
28
+ requirements:
29
+ - - ! '>='
30
+ - !ruby/object:Gem::Version
31
+ version: '0'
32
+ - !ruby/object:Gem::Dependency
33
+ name: interception
34
+ requirement: !ruby/object:Gem::Requirement
35
+ none: false
36
+ requirements:
37
+ - - ! '>='
38
+ - !ruby/object:Gem::Version
39
+ version: '0.3'
44
40
  type: :runtime
45
- version_requirements: *id002
46
- - !ruby/object:Gem::Dependency
47
- name: rspec
48
41
  prerelease: false
49
- requirement: &id003 !ruby/object:Gem::Requirement
50
- requirements:
51
- - - ">="
52
- - !ruby/object:Gem::Version
53
- segments:
54
- - 0
55
- version: "0"
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ none: false
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0.3'
48
+ - !ruby/object:Gem::Dependency
49
+ name: rspec
50
+ requirement: !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
56
  type: :development
57
- version_requirements: *id003
58
- - !ruby/object:Gem::Dependency
59
- name: yard
60
57
  prerelease: false
61
- requirement: &id004 !ruby/object:Gem::Requirement
62
- requirements:
63
- - - ">="
64
- - !ruby/object:Gem::Version
65
- segments:
66
- - 0
67
- version: "0"
58
+ version_requirements: !ruby/object:Gem::Requirement
59
+ none: false
60
+ requirements:
61
+ - - ! '>='
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ - !ruby/object:Gem::Dependency
65
+ name: yard
66
+ requirement: !ruby/object:Gem::Requirement
67
+ none: false
68
+ requirements:
69
+ - - ! '>='
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
68
72
  type: :development
69
- version_requirements: *id004
70
- - !ruby/object:Gem::Dependency
71
- name: redcarpet
72
73
  prerelease: false
73
- requirement: &id005 !ruby/object:Gem::Requirement
74
- requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- segments:
78
- - 0
79
- version: "0"
74
+ version_requirements: !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - ! '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ - !ruby/object:Gem::Dependency
81
+ name: redcarpet
82
+ requirement: !ruby/object:Gem::Requirement
83
+ none: false
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
80
88
  type: :development
81
- version_requirements: *id005
82
- description: Allows you to wrap code in Pry::rescue{ } to open a pry session at any unhandled exceptions
83
- email:
89
+ prerelease: false
90
+ version_requirements: !ruby/object:Gem::Requirement
91
+ none: false
92
+ requirements:
93
+ - - ! '>='
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ description: Allows you to wrap code in Pry::rescue{ } to open a pry session at any
97
+ unhandled exceptions
98
+ email:
84
99
  - conrad.irwin@gmail.com
85
100
  - jrmair@gmail.com
86
101
  - chris@ill-logic.com
87
- executables:
102
+ executables:
88
103
  - rescue
89
104
  extensions: []
90
-
91
105
  extra_rdoc_files: []
92
-
93
- files:
106
+ files:
94
107
  - .gitignore
95
108
  - Gemfile
96
109
  - LICENSE.MIT
@@ -105,7 +118,6 @@ files:
105
118
  - lib/pry-rescue/commands.rb
106
119
  - lib/pry-rescue/core_ext.rb
107
120
  - lib/pry-rescue/rack.rb
108
- - lib/pry-rescue/rails.rb
109
121
  - lib/pry/rescue.rb
110
122
  - pry-rescue.gemspec
111
123
  - spec/commands_spec.rb
@@ -118,35 +130,28 @@ files:
118
130
  - spec/fixtures/super.rb
119
131
  - spec/fixtures/uri.rb
120
132
  - spec/pry_rescue_spec.rb
121
- has_rdoc: true
122
133
  homepage: https://github.com/ConradIrwin/pry-rescue
123
134
  licenses: []
124
-
125
135
  post_install_message:
126
136
  rdoc_options: []
127
-
128
- require_paths:
137
+ require_paths:
129
138
  - lib
130
- required_ruby_version: !ruby/object:Gem::Requirement
131
- requirements:
132
- - - ">="
133
- - !ruby/object:Gem::Version
134
- segments:
135
- - 0
136
- version: "0"
137
- required_rubygems_version: !ruby/object:Gem::Requirement
138
- requirements:
139
- - - ">="
140
- - !ruby/object:Gem::Version
141
- segments:
142
- - 0
143
- version: "0"
139
+ required_ruby_version: !ruby/object:Gem::Requirement
140
+ none: false
141
+ requirements:
142
+ - - ! '>='
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
145
+ required_rubygems_version: !ruby/object:Gem::Requirement
146
+ none: false
147
+ requirements:
148
+ - - ! '>'
149
+ - !ruby/object:Gem::Version
150
+ version: 1.3.1
144
151
  requirements: []
145
-
146
152
  rubyforge_project:
147
- rubygems_version: 1.3.6
153
+ rubygems_version: 1.8.23
148
154
  signing_key:
149
155
  specification_version: 3
150
156
  summary: Open a pry session on any unhandled exceptions
151
157
  test_files: []
152
-
@@ -1,8 +0,0 @@
1
- require 'pry-rescue'
2
- class PryRescue
3
- class Railtie < ::Rails::Railtie
4
- initializer "pry_rescue" do |app|
5
- app.config.middleware.use PryRescue::Rack
6
- end
7
- end
8
- end