pry-exception_explorer 0.1.3.1 → 0.1.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -29,7 +29,7 @@ class Object
29
29
  end
30
30
 
31
31
  if !PryExceptionExplorer.enabled?
32
- if exception.is_a?(Exception)
32
+ if exception.is_a?(Exception) || (exception.is_a?(Class) && exception < Exception)
33
33
  return super(*args)
34
34
  elsif exception.nil?
35
35
  if $!
@@ -42,14 +42,30 @@ class Object
42
42
  end
43
43
  end
44
44
 
45
- if string
46
- ex = exception.exception(string)
45
+
46
+ # puts exception
47
+
48
+ if exception.is_a?(Exception) || (exception.is_a?(Class) && exception < Exception)
49
+ if string
50
+ ex = exception.exception(string)
51
+ else
52
+ ex = exception.exception
53
+ end
54
+ elsif exception.nil?
55
+ if $!
56
+ ex = $!.exception
57
+ else
58
+ ex = RuntimeError.exception
59
+ end
47
60
  else
48
- ex = exception.exception
61
+ ex = RuntimeError.exception
49
62
  end
50
63
 
64
+
51
65
  ex.set_backtrace(array ? array : caller)
52
66
 
67
+ # puts ex
68
+
53
69
  # revert to normal exception behaviour if EE not enabled.
54
70
  # if !PryExceptionExplorer.enabled?
55
71
  # return super(*args)
@@ -1,3 +1,3 @@
1
1
  module PryExceptionExplorer
2
- VERSION = "0.1.3.1"
2
+ VERSION = "0.1.3.2"
3
3
  end
@@ -22,9 +22,9 @@ module PryExceptionExplorer
22
22
 
23
23
  class << self
24
24
 
25
- # @return [Hash] A thread-local hash.
25
+ # @return [Hash] A local hash.
26
26
  def local_hash
27
- Thread.current[:__pry_exception_explorer_hash__] ||= {}
27
+ @hash ||= {}
28
28
  end
29
29
 
30
30
  # @param [Boolean] v Whether Exception Explorer is enabled.
@@ -1,20 +1,20 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
3
  Gem::Specification.new do |s|
4
- s.name = %q{pry-exception_explorer}
5
- s.version = "0.1.3"
4
+ s.name = "pry-exception_explorer"
5
+ s.version = "0.1.3.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
- s.authors = [%q{John Mair (banisterfiend)}]
9
- s.date = %q{2012-02-02}
10
- s.description = %q{Enter the context of exceptions}
11
- s.email = %q{jrmair@gmail.com}
12
- s.files = [%q{.gemtest}, %q{.gitignore}, %q{.travis.yml}, %q{.yardopts}, %q{CHANGELOG}, %q{Gemfile}, %q{LICENSE}, %q{README.md}, %q{Rakefile}, %q{examples/example_c_inline.rb}, %q{examples/example_inline.rb}, %q{examples/example_wrap.rb}, %q{lib/pry-exception_explorer.rb}, %q{lib/pry-exception_explorer/cli.rb}, %q{lib/pry-exception_explorer/commands.rb}, %q{lib/pry-exception_explorer/core_ext.rb}, %q{lib/pry-exception_explorer/intercept.rb}, %q{lib/pry-exception_explorer/lazy_frame.rb}, %q{lib/pry-exception_explorer/shim_builder.rb}, %q{lib/pry-exception_explorer/version.rb}, %q{pry-exception_explorer.gemspec}, %q{test/helper.rb}, %q{test/test_exceptions_in_pry.rb}, %q{test/test_inline_exceptions.rb}, %q{test/test_wrapped_exceptions.rb}]
13
- s.homepage = %q{https://github.com/banister/pry-exception_explorer}
14
- s.require_paths = [%q{lib}]
15
- s.rubygems_version = %q{1.8.6}
16
- s.summary = %q{Enter the context of exceptions}
17
- s.test_files = [%q{test/helper.rb}, %q{test/test_exceptions_in_pry.rb}, %q{test/test_inline_exceptions.rb}, %q{test/test_wrapped_exceptions.rb}]
8
+ s.authors = ["John Mair (banisterfiend)"]
9
+ s.date = "2012-02-06"
10
+ s.description = "Enter the context of exceptions"
11
+ s.email = "jrmair@gmail.com"
12
+ s.files = [".gemtest", ".gitignore", ".travis.yml", ".yardopts", "CHANGELOG", "Gemfile", "LICENSE", "README.md", "Rakefile", "examples/example_c_inline.rb", "examples/example_inline.rb", "examples/example_wrap.rb", "lib/pry-exception_explorer.rb", "lib/pry-exception_explorer/cli.rb", "lib/pry-exception_explorer/commands.rb", "lib/pry-exception_explorer/core_ext.rb", "lib/pry-exception_explorer/intercept.rb", "lib/pry-exception_explorer/lazy_frame.rb", "lib/pry-exception_explorer/shim_builder.rb", "lib/pry-exception_explorer/version.rb", "pry-exception_explorer.gemspec", "test/helper.rb", "test/test_exceptions_in_pry.rb", "test/test_inline_exceptions.rb", "test/test_wrapped_exceptions.rb"]
13
+ s.homepage = "https://github.com/banister/pry-exception_explorer"
14
+ s.require_paths = ["lib"]
15
+ s.rubygems_version = "1.8.11"
16
+ s.summary = "Enter the context of exceptions"
17
+ s.test_files = ["test/helper.rb", "test/test_exceptions_in_pry.rb", "test/test_inline_exceptions.rb", "test/test_wrapped_exceptions.rb"]
18
18
 
19
19
  if s.respond_to? :specification_version then
20
20
  s.specification_version = 3
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: pry-exception_explorer
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.3.1
5
+ version: 0.1.3.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - John Mair (banisterfiend)
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-02-03 00:00:00 Z
13
+ date: 2012-02-06 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: pry-stack_explorer
@@ -111,3 +111,4 @@ test_files:
111
111
  - test/test_exceptions_in_pry.rb
112
112
  - test/test_inline_exceptions.rb
113
113
  - test/test_wrapped_exceptions.rb
114
+ has_rdoc: