better_errors 1.0.0.rc1 → 1.0.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,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NjYyNmFjYTQ1MjJmN2M4ZTIyODQ0MGY2YzNjOTE5ODU5ODU2NzQyZQ==
5
- data.tar.gz: !binary |-
6
- OWRjYzA4NTI5YzI1YWViZDAyMjlhN2RmOWQ4NDA3MWYwMTlkMzUyNA==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- MTBhZDMwMTI5MzFiZTYwNzNlNzk2YWI2NTE2OTYzODc2ODZjZjFkYjQ4MGIw
10
- MGI5ZGM5NzVkMzQzZmUzYzBjOTJlYmYzMWZjMDZlMjZjYmQzNjQ2NDM5OTY5
11
- NTdlNDMwMjFhNTlhY2VhYWU1YzVlMTA2ZGZmYmI0OGYwYzYxNmQ=
12
- data.tar.gz: !binary |-
13
- ZTZmNjc4ZTRmZjlhZTZhOTJhMjc1MDM0NDAwMDMyYjdkNzY4MDdkOTNlN2Nk
14
- YjBhMjhlNjE3YTZhZmFkODU1OTk1MGFkMjk4MWRhMzljNzc4ZTczMzdhMTBk
15
- MTRjNWJhMGU4NDllYWFiMDFiOWNiMmNhZTQ4OGU2MzE3MGQyMzQ=
2
+ SHA1:
3
+ metadata.gz: b488ee0f5ae9ab59d99cdf4600dcd8068142f7af
4
+ data.tar.gz: 16eb29a92fc99d51ac5bec8bfda47551ee70eb5e
5
+ SHA512:
6
+ metadata.gz: 011da282c504e61de751a0ac51084fe71bca604ade85fc6fd432d7fd2cf87d2f13396766d78b1f80d54481b605bc490acf7d5a44d358d2721ce87b3058617078
7
+ data.tar.gz: ed553954f0e7471ec4ad323d96e5db470e0c94db4545ecaf97f84c828ac2d4c8a257cfe8f54aa48e1f0f1b8ee3394e33c6649a046572c21f35efb4f6912d14e3
@@ -1,4 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 2.0.0
4
+ - 1.9.3
5
+ - 1.9.2
4
6
  - jruby-1.7.4
data/Gemfile CHANGED
@@ -5,7 +5,7 @@ gemspec
5
5
  gem "rake"
6
6
  gem "rspec", "2.14.1"
7
7
  gem "binding_of_caller", platforms: :ruby
8
- gem "pry"
8
+ gem "pry", "0.9.12"
9
9
  gem "simplecov"
10
10
  gem "yard"
11
11
  gem "kramdown"
data/README.md CHANGED
@@ -21,14 +21,6 @@ group :development do
21
21
  end
22
22
  ```
23
23
 
24
- If you would like to use Better Errors' **advanced features** (REPL, local/instance variable inspection, pretty stack frame names), you need to add the [`binding_of_caller`](https://github.com/banister/binding_of_caller) gem by [@banisterfiend](http://twitter.com/banisterfiend) to your Gemfile:
25
-
26
- ```ruby
27
- gem "binding_of_caller"
28
- ```
29
-
30
- This is an optional dependency however, and Better Errors will work without it.
31
-
32
24
  ## Security
33
25
 
34
26
  **NOTE:** It is *critical* you put better\_errors in the **development** section. **Do NOT run better_errors in production, or on Internet facing hosts.**
@@ -16,6 +16,7 @@ Gem::Specification.new do |s|
16
16
  s.files = `git ls-files`.split($/)
17
17
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
18
18
  s.require_paths = ["lib"]
19
+ s.extensions = ["ext/mkrf_conf.rb"]
19
20
 
20
21
  s.required_ruby_version = ">= 1.9.2"
21
22
 
@@ -0,0 +1,11 @@
1
+ require 'rubygems/dependency_installer'
2
+
3
+ gem = Gem::DependencyInstaller.new
4
+
5
+ if ["rbx", "ruby"].include?(RUBY_ENGINE)
6
+ # This MUST match the version specified in lib/better_errors.rb, or else
7
+ # weird shit will happen.
8
+ if Gem::Dependency.new("binding_of_caller", "0.7.2").matching_specs.empty?
9
+ gem.install "binding_of_caller", "0.7.2"
10
+ end
11
+ end
@@ -134,10 +134,11 @@ module BetterErrors
134
134
  BetterErrors.editor = default_editor
135
135
  end
136
136
 
137
- begin
137
+ if Gem::Dependency.new("binding_of_caller", "0.7.2").matching_specs.any?
138
+ gem "binding_of_caller", "0.7.2"
138
139
  require "binding_of_caller"
139
140
  BetterErrors.binding_of_caller_available = true
140
- rescue LoadError => e
141
+ else
141
142
  BetterErrors.binding_of_caller_available = false
142
143
  end
143
144
 
@@ -39,7 +39,7 @@ module BetterErrors
39
39
  @input = Input.new
40
40
  @output = Output.new
41
41
  @pry = ::Pry.new input: @input, output: @output
42
- @pry.hooks.clear_all
42
+ @pry.hooks.clear_all if defined?(@pry.hooks.clear_all)
43
43
  @fiber.resume
44
44
  end
45
45
 
@@ -252,6 +252,12 @@
252
252
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(0, 0, 0, 0.4);
253
253
  }
254
254
 
255
+ nav.tabs a.disabled {
256
+ text-decoration: line-through;
257
+ text-shadow: none;
258
+ cursor: default;
259
+ }
260
+
255
261
  /* ---------------------------------------------------------------------
256
262
  * Sidebar
257
263
  * --------------------------------------------------------------------- */
@@ -953,24 +959,40 @@
953
959
  document.querySelector(".frames li")
954
960
  ).onclick();
955
961
 
962
+ // This is the second query performed for frames; maybe the 'allFrames' list
963
+ // currently used and this list can be better used to avoid the repetition:
964
+ var applicationFramesCount = document.querySelectorAll(
965
+ "ul.frames li[data-context=application]"
966
+ ).length;
967
+
968
+ var applicationFramesButtonIsInstalled = false;
956
969
  var applicationFramesButton = document.getElementById("application_frames");
957
970
  var allFramesButton = document.getElementById("all_frames");
958
971
 
959
- applicationFramesButton.onclick = function() {
960
- allFramesButton.className = "";
961
- applicationFramesButton.className = "selected";
962
- for(var i = 0; i < allFrames.length; i++) {
963
- if(allFrames[i].attributes["data-context"].value == "application") {
964
- allFrames[i].style.display = "block";
965
- } else {
966
- allFrames[i].style.display = "none";
972
+ // The application frames button only needs to be bound if
973
+ // there are actually any application frames to look at.
974
+ var installApplicationFramesButton = function() {
975
+ applicationFramesButton.onclick = function() {
976
+ allFramesButton.className = "";
977
+ applicationFramesButton.className = "selected";
978
+ for(var i = 0; i < allFrames.length; i++) {
979
+ if(allFrames[i].attributes["data-context"].value == "application") {
980
+ allFrames[i].style.display = "block";
981
+ } else {
982
+ allFrames[i].style.display = "none";
983
+ }
967
984
  }
968
- }
969
- return false;
970
- };
985
+ return false;
986
+ };
987
+
988
+ applicationFramesButtonIsInstalled = true;
989
+ }
971
990
 
972
991
  allFramesButton.onclick = function() {
973
- applicationFramesButton.className = "";
992
+ if(applicationFramesButtonIsInstalled) {
993
+ applicationFramesButton.className = "";
994
+ }
995
+
974
996
  allFramesButton.className = "selected";
975
997
  for(var i = 0; i < allFrames.length; i++) {
976
998
  allFrames[i].style.display = "block";
@@ -978,7 +1000,16 @@
978
1000
  return false;
979
1001
  };
980
1002
 
981
- applicationFramesButton.onclick();
1003
+ // If there are no application frames, select the 'All Frames'
1004
+ // tab by default.
1005
+ if(applicationFramesCount > 0) {
1006
+ installApplicationFramesButton();
1007
+ applicationFramesButton.onclick();
1008
+ } else {
1009
+ applicationFramesButton.className = "disabled";
1010
+ applicationFramesButton.title = "No application frames available";
1011
+ allFramesButton.onclick();
1012
+ }
982
1013
  })();
983
1014
  </script>
984
1015
  </html>
@@ -1,3 +1,3 @@
1
1
  module BetterErrors
2
- VERSION = "1.0.0.rc1"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: better_errors
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc1
4
+ version: 1.0.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-08-29 00:00:00.000000000 Z
11
+ date: 2013-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: erubis
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: 2.6.6
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: 2.6.6
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: coderay
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.0.0
41
41
  description: Provides a better error page for Rails and other Rack apps. Includes
@@ -44,7 +44,8 @@ description: Provides a better error page for Rails and other Rack apps. Include
44
44
  email:
45
45
  - charlie@charliesomerville.com
46
46
  executables: []
47
- extensions: []
47
+ extensions:
48
+ - ext/mkrf_conf.rb
48
49
  extra_rdoc_files: []
49
50
  files:
50
51
  - .gitignore
@@ -55,6 +56,7 @@ files:
55
56
  - README.md
56
57
  - Rakefile
57
58
  - better_errors.gemspec
59
+ - ext/mkrf_conf.rb
58
60
  - lib/better_errors.rb
59
61
  - lib/better_errors/code_formatter.rb
60
62
  - lib/better_errors/code_formatter/html.rb
@@ -91,17 +93,17 @@ require_paths:
91
93
  - lib
92
94
  required_ruby_version: !ruby/object:Gem::Requirement
93
95
  requirements:
94
- - - ! '>='
96
+ - - '>='
95
97
  - !ruby/object:Gem::Version
96
98
  version: 1.9.2
97
99
  required_rubygems_version: !ruby/object:Gem::Requirement
98
100
  requirements:
99
- - - ! '>'
101
+ - - '>='
100
102
  - !ruby/object:Gem::Version
101
- version: 1.3.1
103
+ version: '0'
102
104
  requirements: []
103
105
  rubyforge_project:
104
- rubygems_version: 2.0.6
106
+ rubygems_version: 2.0.3
105
107
  signing_key:
106
108
  specification_version: 4
107
109
  summary: Better error page for Rails and other Rack apps