better_errors 2.0.0 → 2.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +5 -5
  2. data/.coveralls.yml +1 -0
  3. data/.gitignore +3 -0
  4. data/.travis.yml +96 -2
  5. data/CHANGELOG.md +1 -1
  6. data/Gemfile +2 -7
  7. data/LICENSE.txt +1 -1
  8. data/README.md +99 -39
  9. data/better_errors.gemspec +23 -4
  10. data/gemfiles/pry010.gemfile +9 -0
  11. data/gemfiles/pry011.gemfile +8 -0
  12. data/gemfiles/pry09.gemfile +8 -0
  13. data/gemfiles/rack.gemfile +7 -0
  14. data/gemfiles/rack_boc.gemfile +8 -0
  15. data/gemfiles/rails42.gemfile +9 -0
  16. data/gemfiles/rails42_boc.gemfile +10 -0
  17. data/gemfiles/rails42_haml.gemfile +10 -0
  18. data/gemfiles/rails50.gemfile +8 -0
  19. data/gemfiles/rails50_boc.gemfile +9 -0
  20. data/gemfiles/rails50_haml.gemfile +9 -0
  21. data/gemfiles/rails51.gemfile +8 -0
  22. data/gemfiles/rails51_boc.gemfile +9 -0
  23. data/gemfiles/rails51_haml.gemfile +9 -0
  24. data/gemfiles/rails52.gemfile +8 -0
  25. data/gemfiles/rails52_boc.gemfile +9 -0
  26. data/gemfiles/rails52_haml.gemfile +9 -0
  27. data/gemfiles/rails60.gemfile +7 -0
  28. data/gemfiles/rails60_boc.gemfile +8 -0
  29. data/gemfiles/rails60_haml.gemfile +8 -0
  30. data/lib/better_errors/code_formatter/html.rb +1 -1
  31. data/lib/better_errors/code_formatter.rb +7 -7
  32. data/lib/better_errors/error_page.rb +56 -15
  33. data/lib/better_errors/inspectable_value.rb +45 -0
  34. data/lib/better_errors/middleware.rb +96 -16
  35. data/lib/better_errors/raised_exception.rb +13 -3
  36. data/lib/better_errors/repl/basic.rb +3 -3
  37. data/lib/better_errors/repl/pry.rb +18 -8
  38. data/lib/better_errors/repl.rb +6 -4
  39. data/lib/better_errors/stack_frame.rb +33 -8
  40. data/lib/better_errors/templates/main.erb +71 -34
  41. data/lib/better_errors/templates/text.erb +2 -2
  42. data/lib/better_errors/templates/variable_info.erb +32 -23
  43. data/lib/better_errors/version.rb +1 -1
  44. data/lib/better_errors.rb +21 -3
  45. metadata +118 -35
  46. data/Rakefile +0 -13
  47. data/spec/better_errors/code_formatter_spec.rb +0 -92
  48. data/spec/better_errors/error_page_spec.rb +0 -76
  49. data/spec/better_errors/middleware_spec.rb +0 -154
  50. data/spec/better_errors/raised_exception_spec.rb +0 -52
  51. data/spec/better_errors/repl/basic_spec.rb +0 -18
  52. data/spec/better_errors/repl/pry_spec.rb +0 -40
  53. data/spec/better_errors/repl/shared_examples.rb +0 -18
  54. data/spec/better_errors/stack_frame_spec.rb +0 -157
  55. data/spec/better_errors/support/my_source.rb +0 -20
  56. data/spec/better_errors_spec.rb +0 -73
  57. data/spec/spec_helper.rb +0 -5
  58. data/spec/without_binding_of_caller.rb +0 -9
@@ -1,73 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe BetterErrors do
4
- context ".editor" do
5
- it "defaults to textmate" do
6
- subject.editor["foo.rb", 123].should == "txmt://open?url=file://foo.rb&line=123"
7
- end
8
-
9
- it "url escapes the filename" do
10
- subject.editor["&.rb", 0].should == "txmt://open?url=file://%26.rb&line=0"
11
- end
12
-
13
- [:emacs, :emacsclient].each do |editor|
14
- it "uses emacs:// scheme when set to #{editor.inspect}" do
15
- subject.editor = editor
16
- subject.editor[].should start_with "emacs://"
17
- end
18
- end
19
-
20
- [:macvim, :mvim].each do |editor|
21
- it "uses mvim:// scheme when set to #{editor.inspect}" do
22
- subject.editor = editor
23
- subject.editor[].should start_with "mvim://"
24
- end
25
- end
26
-
27
- [:sublime, :subl, :st].each do |editor|
28
- it "uses subl:// scheme when set to #{editor.inspect}" do
29
- subject.editor = editor
30
- subject.editor[].should start_with "subl://"
31
- end
32
- end
33
-
34
- [:textmate, :txmt, :tm].each do |editor|
35
- it "uses txmt:// scheme when set to #{editor.inspect}" do
36
- subject.editor = editor
37
- subject.editor[].should start_with "txmt://"
38
- end
39
- end
40
-
41
- ["emacsclient", "/usr/local/bin/emacsclient"].each do |editor|
42
- it "uses emacs:// scheme when EDITOR=#{editor}" do
43
- ENV["EDITOR"] = editor
44
- subject.editor = subject.default_editor
45
- subject.editor[].should start_with "emacs://"
46
- end
47
- end
48
-
49
- ["mvim -f", "/usr/local/bin/mvim -f"].each do |editor|
50
- it "uses mvim:// scheme when EDITOR=#{editor}" do
51
- ENV["EDITOR"] = editor
52
- subject.editor = subject.default_editor
53
- subject.editor[].should start_with "mvim://"
54
- end
55
- end
56
-
57
- ["subl -w", "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"].each do |editor|
58
- it "uses mvim:// scheme when EDITOR=#{editor}" do
59
- ENV["EDITOR"] = editor
60
- subject.editor = subject.default_editor
61
- subject.editor[].should start_with "subl://"
62
- end
63
- end
64
-
65
- ["mate -w", "/usr/bin/mate -w"].each do |editor|
66
- it "uses txmt:// scheme when EDITOR=#{editor}" do
67
- ENV["EDITOR"] = editor
68
- subject.editor = subject.default_editor
69
- subject.editor[].should start_with "txmt://"
70
- end
71
- end
72
- end
73
- end
data/spec/spec_helper.rb DELETED
@@ -1,5 +0,0 @@
1
- $: << File.expand_path("../../lib", __FILE__)
2
-
3
- ENV["EDITOR"] = nil
4
-
5
- require "better_errors"
@@ -1,9 +0,0 @@
1
- module Kernel
2
- alias_method :require_with_binding_of_caller, :require
3
-
4
- def require(feature)
5
- raise LoadError if feature == "binding_of_caller"
6
-
7
- require_with_binding_of_caller(feature)
8
- end
9
- end