better_errors 0.7.2 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of better_errors might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/Gemfile +1 -1
- data/README.md +2 -0
- data/lib/better_errors.rb +6 -1
- data/lib/better_errors/stack_frame.rb +6 -2
- data/lib/better_errors/templates/main.erb +0 -5
- data/lib/better_errors/version.rb +1 -1
- data/spec/better_errors/error_page_spec.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 092b8845c91cd3c3ea3134d950e5c25075f19c96
|
4
|
+
data.tar.gz: 989272a11a82a89c5fa51715d97ab6b27586760e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a4f8df6ad24fe881afd99292f39826035cdbe77f3ccd7e751d1f0b123c6c8d805aebdd708d857e0f5de046a58f1f1ac6139cc9b90cc8247bf35644674474fbe
|
7
|
+
data.tar.gz: 674c43d266041da8918725037d2227dddb6ac38d19e4122a581f719b90d4943d8c962fa31722be2d26d581ef01f134401bf3e7792cbfd2266410dc60068a4ccd
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -80,6 +80,8 @@ end
|
|
80
80
|
* JRuby (1.9 mode) - *advanced features unsupported*
|
81
81
|
* Rubinius (1.9 mode) - *advanced features unsupported*
|
82
82
|
|
83
|
+
[![Build Status](https://travis-ci.org/charliesome/better_errors.png)](https://travis-ci.org/charliesome/better_errors)
|
84
|
+
|
83
85
|
## Get in touch!
|
84
86
|
|
85
87
|
If you're using better_errors, I'd love to hear from you. Drop me a line and tell me what you think!
|
data/lib/better_errors.rb
CHANGED
@@ -32,8 +32,13 @@ module BetterErrors
|
|
32
32
|
|
33
33
|
# @private
|
34
34
|
alias_method :binding_of_caller_available?, :binding_of_caller_available
|
35
|
+
|
36
|
+
# The ignored instance variables.
|
37
|
+
# @return [Array]
|
38
|
+
attr_accessor :ignored_instance_variables
|
35
39
|
end
|
36
|
-
|
40
|
+
@ignored_instance_variables = []
|
41
|
+
|
37
42
|
# Returns a proc, which when called with a filename and line number argument,
|
38
43
|
# returns a URL to open the filename and line in the selected editor.
|
39
44
|
#
|
@@ -95,11 +95,15 @@ module BetterErrors
|
|
95
95
|
|
96
96
|
def instance_variables
|
97
97
|
return {} unless frame_binding
|
98
|
-
Hash[
|
98
|
+
Hash[visible_instance_variables.map { |x|
|
99
99
|
[x, frame_binding.eval(x.to_s)]
|
100
100
|
}]
|
101
101
|
end
|
102
|
-
|
102
|
+
|
103
|
+
def visible_instance_variables
|
104
|
+
frame_binding.eval("instance_variables") - BetterErrors.ignored_instance_variables
|
105
|
+
end
|
106
|
+
|
103
107
|
def to_s
|
104
108
|
"#{pretty_path}:#{line}:in `#{name}'"
|
105
109
|
end
|
@@ -48,6 +48,15 @@ module BetterErrors
|
|
48
48
|
html.should include("inst_d")
|
49
49
|
html.should include(":value_for_inst_d")
|
50
50
|
end
|
51
|
+
|
52
|
+
it "should show filter instance variables" do
|
53
|
+
BetterErrors.stub(:ignored_instance_variables).and_return([ :@inst_d ])
|
54
|
+
html = error_page.do_variables("index" => 0)[:html]
|
55
|
+
html.should include("inst_c")
|
56
|
+
html.should include(":value_for_inst_c")
|
57
|
+
html.should_not include('<td class="name">@inst_d</td>')
|
58
|
+
html.should_not include("<pre>:value_for_inst_d</pre>")
|
59
|
+
end
|
51
60
|
end
|
52
61
|
|
53
62
|
it "should not die if the source file is not a real filename" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: better_errors
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charlie Somerville
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|