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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b80f74faf0a3ec8007646508b4cab950b2293544
4
- data.tar.gz: dcd59c65455600df65d6bdffe865d1a8c1d9ebd1
3
+ metadata.gz: 092b8845c91cd3c3ea3134d950e5c25075f19c96
4
+ data.tar.gz: 989272a11a82a89c5fa51715d97ab6b27586760e
5
5
  SHA512:
6
- metadata.gz: b0866749892c2f498ac68530aada5532bbe1871e87cdf1e943576a8e79bf5aef66e29745e81eb6474659af53a6e95a0cdb3d158723b1eedacf03f059e6bdbf27
7
- data.tar.gz: 7595ec7b6aa0f0e0701100ade0e84d9d297cb4817fe04619aba4d58311c6c779a031d804776a33ca58e8970bb5cdbe293c750cb3e0313e58aa00f7d33c5eb1e4
6
+ metadata.gz: 4a4f8df6ad24fe881afd99292f39826035cdbe77f3ccd7e751d1f0b123c6c8d805aebdd708d857e0f5de046a58f1f1ac6139cc9b90cc8247bf35644674474fbe
7
+ data.tar.gz: 674c43d266041da8918725037d2227dddb6ac38d19e4122a581f719b90d4943d8c962fa31722be2d26d581ef01f134401bf3e7792cbfd2266410dc60068a4ccd
data/.travis.yml CHANGED
@@ -1,3 +1,3 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.0.0-rc2
3
+ - 2.0.0
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
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[frame_binding.eval("instance_variables").map { |x|
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
@@ -940,9 +940,4 @@
940
940
  </script>
941
941
  </html>
942
942
 
943
- <!--
944
-
945
- <%== render('text') %>
946
-
947
- -->
948
943
  <!-- generated by Better Errors in <%= Time.now.to_f - @start_time %> seconds -->
@@ -1,3 +1,3 @@
1
1
  module BetterErrors
2
- VERSION = "0.7.2"
2
+ VERSION = "0.8.0"
3
3
  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.7.2
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-03-09 00:00:00.000000000 Z
11
+ date: 2013-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake