better_errors 1.0.0 → 2.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. checksums.yaml +5 -5
  2. data/.coveralls.yml +1 -0
  3. data/.github/workflows/ci.yml +130 -0
  4. data/.github/workflows/release.yml +64 -0
  5. data/.gitignore +10 -5
  6. data/.ruby-version +1 -0
  7. data/CHANGELOG.md +3 -0
  8. data/Gemfile +7 -7
  9. data/LICENSE.txt +1 -1
  10. data/README.md +103 -33
  11. data/better_errors.gemspec +26 -8
  12. data/gemfiles/pry010.gemfile +10 -0
  13. data/gemfiles/pry011.gemfile +9 -0
  14. data/gemfiles/pry09.gemfile +9 -0
  15. data/gemfiles/rack.gemfile +8 -0
  16. data/gemfiles/rack_boc.gemfile +9 -0
  17. data/gemfiles/rails42.gemfile +10 -0
  18. data/gemfiles/rails42_boc.gemfile +11 -0
  19. data/gemfiles/rails42_haml.gemfile +11 -0
  20. data/gemfiles/rails50.gemfile +9 -0
  21. data/gemfiles/rails50_boc.gemfile +10 -0
  22. data/gemfiles/rails50_haml.gemfile +10 -0
  23. data/gemfiles/rails51.gemfile +9 -0
  24. data/gemfiles/rails51_boc.gemfile +10 -0
  25. data/gemfiles/rails51_haml.gemfile +10 -0
  26. data/gemfiles/rails52.gemfile +9 -0
  27. data/gemfiles/rails52_boc.gemfile +10 -0
  28. data/gemfiles/rails52_haml.gemfile +10 -0
  29. data/gemfiles/rails60.gemfile +8 -0
  30. data/gemfiles/rails60_boc.gemfile +9 -0
  31. data/gemfiles/rails60_haml.gemfile +9 -0
  32. data/lib/better_errors/code_formatter/html.rb +1 -1
  33. data/lib/better_errors/code_formatter.rb +7 -7
  34. data/lib/better_errors/editor.rb +99 -0
  35. data/lib/better_errors/error_page.rb +83 -49
  36. data/lib/better_errors/exception_extension.rb +17 -0
  37. data/lib/better_errors/exception_hint.rb +29 -0
  38. data/lib/better_errors/inspectable_value.rb +45 -0
  39. data/lib/better_errors/middleware.rb +101 -21
  40. data/lib/better_errors/raised_exception.rb +89 -0
  41. data/lib/better_errors/repl/basic.rb +3 -3
  42. data/lib/better_errors/repl/pry.rb +20 -10
  43. data/lib/better_errors/repl.rb +6 -4
  44. data/lib/better_errors/stack_frame.rb +48 -71
  45. data/lib/better_errors/templates/main.erb +167 -94
  46. data/lib/better_errors/templates/text.erb +6 -3
  47. data/lib/better_errors/templates/variable_info.erb +33 -24
  48. data/lib/better_errors/version.rb +1 -1
  49. data/lib/better_errors.rb +35 -37
  50. metadata +150 -46
  51. data/.travis.yml +0 -6
  52. data/Rakefile +0 -4
  53. data/ext/mkrf_conf.rb +0 -11
  54. data/lib/better_errors/core_ext/exception.rb +0 -21
  55. data/spec/better_errors/code_formatter_spec.rb +0 -92
  56. data/spec/better_errors/error_page_spec.rb +0 -76
  57. data/spec/better_errors/middleware_spec.rb +0 -112
  58. data/spec/better_errors/repl/basic_spec.rb +0 -18
  59. data/spec/better_errors/repl/pry_spec.rb +0 -36
  60. data/spec/better_errors/repl/shared_examples.rb +0 -18
  61. data/spec/better_errors/stack_frame_spec.rb +0 -161
  62. data/spec/better_errors/support/my_source.rb +0 -20
  63. data/spec/better_errors_spec.rb +0 -73
  64. data/spec/spec_helper.rb +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b488ee0f5ae9ab59d99cdf4600dcd8068142f7af
4
- data.tar.gz: 16eb29a92fc99d51ac5bec8bfda47551ee70eb5e
2
+ SHA256:
3
+ metadata.gz: 4526a605f0982bee6fd507b813eca6e7185bad35bd14ecd289a0a269afe4ec5e
4
+ data.tar.gz: 897e7c5a8fd3350b6cba2b1e46feccb872ed519d45d169dbbde9e6ab1c7387ad
5
5
  SHA512:
6
- metadata.gz: 011da282c504e61de751a0ac51084fe71bca604ade85fc6fd432d7fd2cf87d2f13396766d78b1f80d54481b605bc490acf7d5a44d358d2721ce87b3058617078
7
- data.tar.gz: ed553954f0e7471ec4ad323d96e5db470e0c94db4545ecaf97f84c828ac2d4c8a257cfe8f54aa48e1f0f1b8ee3394e33c6649a046572c21f35efb4f6912d14e3
6
+ metadata.gz: 6e9116392957f7941b7217a1e08226587081d55904c6e4722d7af28aba0e47d376f886702e958db5f7d02dfaf1480fe686af154fdf500ff817a67e46c5144a30
7
+ data.tar.gz: ad5453cf355f951ad5db132454934ebe5efbdfc339f4607985d76ddb9f430a06c55e95dbffdf944ce33c63b344d4a0ef632176d4b3da00d4db4f3561c02acf39
data/.coveralls.yml ADDED
@@ -0,0 +1 @@
1
+ service_name: travis-ci
@@ -0,0 +1,130 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ schedule:
7
+ - cron: '0 0 12,26 * *' # roughly every two weeks to run on new Ruby versions
8
+ pull_request:
9
+ branches: [ master ]
10
+ workflow_dispatch:
11
+
12
+ jobs:
13
+ test:
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ ruby:
19
+ - 2.2
20
+ - 2.3
21
+ - 2.4
22
+ - 2.5
23
+ - 2.6
24
+ - 2.7
25
+ # - ruby-head
26
+ # - truffleruby-head
27
+ gemfile:
28
+ # These are located in the gemfiles/ folder
29
+ - rails42
30
+ - rails50
31
+ - rails51
32
+ - rails52
33
+ - rails60
34
+ - rails42_haml
35
+ - rails50_haml
36
+ - rails51_haml
37
+ - rails52_haml
38
+ - rails60_haml
39
+ - rails42_boc
40
+ - rails50_boc
41
+ - rails51_boc
42
+ - rails52_boc
43
+ - rails60_boc
44
+ - rack
45
+ - rack_boc
46
+ # - pry09
47
+ # - pry10
48
+ # - pry11
49
+ exclude:
50
+ - { ruby: 2.2, gemfile: rails60 }
51
+ - { ruby: 2.2, gemfile: rails60_boc }
52
+ - { ruby: 2.2, gemfile: rails60_haml }
53
+ - { ruby: 2.3, gemfile: rails42 }
54
+ - { ruby: 2.3, gemfile: rails42_boc }
55
+ - { ruby: 2.3, gemfile: rails42_haml }
56
+ - { ruby: 2.3, gemfile: rails60 }
57
+ - { ruby: 2.3, gemfile: rails60_boc }
58
+ - { ruby: 2.3, gemfile: rails60_haml }
59
+ - { ruby: 2.4, gemfile: rails42 }
60
+ - { ruby: 2.4, gemfile: rails42_boc }
61
+ - { ruby: 2.4, gemfile: rails42_haml }
62
+ - { ruby: 2.4, gemfile: rails60 }
63
+ - { ruby: 2.4, gemfile: rails60_boc }
64
+ - { ruby: 2.4, gemfile: rails60_haml }
65
+ - { ruby: 2.5, gemfile: rails42 }
66
+ - { ruby: 2.5, gemfile: rails42_boc }
67
+ - { ruby: 2.5, gemfile: rails42_haml }
68
+ - { ruby: 2.6, gemfile: rails42 }
69
+ - { ruby: 2.6, gemfile: rails42_boc }
70
+ - { ruby: 2.6, gemfile: rails42_haml }
71
+ - { ruby: 2.7, gemfile: rails42 }
72
+ - { ruby: 2.7, gemfile: rails42_boc }
73
+ - { ruby: 2.7, gemfile: rails42_haml }
74
+ # - { ruby: ruby-head, gemfile: rails42 }
75
+ # - { ruby: ruby-head, gemfile: rails42_boc }
76
+ # - { ruby: ruby-head, gemfile: rails42_haml }
77
+ - { ruby: truffleruby-head, gemfile: rails42_boc }
78
+ - { ruby: truffleruby-head, gemfile: rails50_boc }
79
+ - { ruby: truffleruby-head, gemfile: rails51_boc }
80
+ - { ruby: truffleruby-head, gemfile: rails52_boc }
81
+ - { ruby: truffleruby-head, gemfile: rails60_boc }
82
+ - { ruby: truffleruby-head, gemfile: rack_boc }
83
+
84
+ steps:
85
+
86
+ - uses: actions/checkout@v2
87
+
88
+ - name: Set up Ruby
89
+ uses: ruby/setup-ruby@v1
90
+ with:
91
+ ruby-version: ${{ matrix.ruby }}
92
+
93
+ - uses: actions/cache@v2
94
+ with:
95
+ path: gemfiles/vendor/bundle
96
+ key: v3-${{ runner.os }}-branch-${{ github.ref }}-ruby-${{ matrix.ruby }}-gemfile-${{ matrix.gemfile }}-${{ hashFiles(format('gemfiles/{0}.gemfile', matrix.gemfile)) }}
97
+ restore-keys: |
98
+ v3-${{ runner.os }}-branch-${{ github.ref }}-ruby-${{ matrix.ruby }}-gemfile-${{ matrix.gemfile }}
99
+ v3-${{ runner.os }}-branch-master-ruby-${{ matrix.ruby }}-gemfile-${{ matrix.gemfile }}
100
+
101
+ - name: Bundle install
102
+ run: |
103
+ bundle config path vendor/bundle
104
+ bundle install --jobs 4 --retry 3
105
+ env:
106
+ BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
107
+
108
+ - name: RSpec
109
+ run: bundle exec rspec -f doc --color
110
+ env:
111
+ BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
112
+
113
+ - name: Report to Coveralls
114
+ uses: coverallsapp/github-action@v1.1.2
115
+ with:
116
+ github-token: ${{ secrets.github_token }}
117
+ flag-name: test-${{ matrix.ruby }}-${{ matrix.gemfile }}
118
+ parallel: true
119
+
120
+
121
+ finish:
122
+ needs: test
123
+ runs-on: ubuntu-latest
124
+ steps:
125
+
126
+ - name: Report completion to Coveralls
127
+ uses: coverallsapp/github-action@v1.1.2
128
+ with:
129
+ github-token: ${{ secrets.github_token }}
130
+ parallel-finished: true
@@ -0,0 +1,64 @@
1
+ name: Release
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ build:
9
+ runs-on: ubuntu-latest
10
+
11
+ steps:
12
+
13
+ - uses: actions/checkout@v2
14
+
15
+ - name: Set up Ruby
16
+ uses: ruby/setup-ruby@v1
17
+ with:
18
+ ruby-version: 2.7
19
+
20
+ - uses: actions/cache@v2
21
+ with:
22
+ path: vendor/bundle
23
+ key: v1-${{ runner.os }}-${{ hashFiles('Gemfile', 'better_errors.gemspec') }}
24
+ restore-keys: |
25
+ v1-${{ runner.os }}
26
+
27
+ - name: Bundle install
28
+ run: |
29
+ bundle config path vendor/bundle
30
+ bundle install --jobs 4 --retry 3
31
+
32
+ - name: Get release version
33
+ id: get_version
34
+ run: |
35
+ version="${github_ref//refs\/tags\/v/}"
36
+ echo "${version}"
37
+ echo "::set-output name=version::${version}"
38
+ env:
39
+ github_ref: ${{ github.ref }}
40
+
41
+ - name: Get Release
42
+ id: get_release
43
+ uses: bruceadams/get-release@v1.2.2
44
+ env:
45
+ GITHUB_TOKEN: ${{ github.token }}
46
+
47
+ - name: Set gem version
48
+ run: |
49
+ bundle exec gem bump better_errors --version ${{ steps.get_version.outputs.version }} --no-commit
50
+
51
+ - name: Build gem
52
+ run: gem build better_errors.gemspec
53
+
54
+ - name: Upload gem to Release
55
+ uses: actions/upload-release-asset@v1
56
+ env:
57
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58
+ with:
59
+ upload_url: ${{ steps.get_release.outputs.upload_url }}
60
+ asset_path: ./better_errors-${{ steps.get_version.outputs.version }}.gem
61
+ asset_name: better_errors-${{ steps.get_version.outputs.version }}.gem
62
+ asset_content_type: application/octet-stream
63
+
64
+ # TODO: if this release is on master, add a commit updating the version in master.
data/.gitignore CHANGED
@@ -1,6 +1,11 @@
1
1
  *.gem
2
- tmp
3
- Gemfile.lock
4
- coverage
5
- .yardoc
6
- doc
2
+ /tmp
3
+ /Gemfile.lock
4
+ /coverage
5
+ /.yardoc
6
+ /doc
7
+ /.bundle
8
+ /vendor/gems
9
+
10
+ /gemfiles/*.gemfile.lock
11
+ /gemfiles/.bundle
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.7.2
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ # Changelog
2
+
3
+ See https://github.com/BetterErrors/better_errors/releases
data/Gemfile CHANGED
@@ -2,10 +2,10 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- gem "rake"
6
- gem "rspec", "2.14.1"
7
- gem "binding_of_caller", platforms: :ruby
8
- gem "pry", "0.9.12"
9
- gem "simplecov"
10
- gem "yard"
11
- gem "kramdown"
5
+ gem 'simplecov', require: false
6
+ gem 'simplecov-lcov', require: false
7
+
8
+ # For managing release version in CI
9
+ gem 'gem-release'
10
+
11
+ # gem "pry-byebug"
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013 Charlie Somerville
1
+ Copyright (c) 2012-2016 Charlie Somerville
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -1,15 +1,24 @@
1
- # Better Errors [![Build Status](https://travis-ci.org/charliesome/better_errors.png)](https://travis-ci.org/charliesome/better_errors) [![Code Climate](https://codeclimate.com/github/charliesome/better_errors.png)](https://codeclimate.com/github/charliesome/better_errors)
1
+ [![Build Status](https://github.com/BetterErrors/better_errors/workflows/CI/badge.svg?event=push&branch=master)](https://github.com/BetterErrors/better_errors/actions?query=branch%3Amaster)
2
+ [![Codacy Badge](https://api.codacy.com/project/badge/Grade/6bc3e7d6118d47e6959b16690b815909)](https://www.codacy.com/app/BetterErrors/better_errors?utm_source=github.com&utm_medium=referral&utm_content=BetterErrors/better_errors&utm_campaign=Badge_Grade)
3
+ [![Test Coverage](https://coveralls.io/repos/github/BetterErrors/better_errors/badge.svg?branch=master)](https://coveralls.io/github/BetterErrors/better_errors?branch=master)
4
+ [![Gem Version](https://img.shields.io/gem/v/better_errors.svg)](https://rubygems.org/gems/better_errors)
5
+
6
+ # Better Errors
2
7
 
3
8
  Better Errors replaces the standard Rails error page with a much better and more useful error page. It is also usable outside of Rails in any Rack app as Rack middleware.
4
9
 
5
- ![image](http://i.imgur.com/zYOXF.png)
10
+ ![screenshot of Better Errors in action](https://i.imgur.com/6zBGAAb.png)
6
11
 
7
12
  ## Features
8
13
 
14
+ For screenshots of these features, [see the wiki](https://github.com/BetterErrors/better_errors/wiki).
15
+
9
16
  * Full stack trace
10
17
  * Source code inspection for all stack frames (with highlighting)
11
18
  * Local and instance variable inspection
12
- * Live REPL on every stack frame
19
+ * Live shell (REPL) on every stack frame
20
+ * Links directly to the source line in your editor
21
+ * Useful information in non-HTML requests
13
22
 
14
23
  ## Installation
15
24
 
@@ -18,61 +27,68 @@ Add this to your Gemfile:
18
27
  ```ruby
19
28
  group :development do
20
29
  gem "better_errors"
30
+ gem "binding_of_caller"
21
31
  end
22
32
  ```
23
33
 
24
- ## Security
34
+ [`binding_of_caller`](https://github.com/banister/binding_of_caller) is optional, but is necessary to use Better Errors' advanced features (REPL, local/instance variable inspection, pretty stack frame names).
25
35
 
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.**
36
+ _Note: If you discover that Better Errors isn't working - particularly after upgrading from version 0.5.0 or less - be sure to set `config.consider_all_requests_local = true` in `config/environments/development.rb`._
27
37
 
28
- You will notice that the only machine that gets the Better Errors page is localhost, which means you get the default error page if you are developing on a remote host (or a virtually remote host, such as a Vagrant box). Obviously, the REPL is not something you want to expose to the public, but there may also be other pieces of sensitive information available in the backtrace.
38
+ ### Optional: Set `EDITOR`
29
39
 
30
- To poke selective holes in this security mechanism, you can add a line like this to your startup (for example, on Rails it would be `config/environments/development.rb`)
40
+ For many reasons outside of Better Errors, you should have the `EDITOR` environment variable set to your preferred
41
+ editor.
42
+ Better Errors, like many other tools, will use that environment variable to show a link that opens your
43
+ editor to the file and line from the console.
31
44
 
32
- ```ruby
33
- BetterErrors::Middleware.allow_ip! ENV['TRUSTED_IP'] if ENV['TRUSTED_IP']
34
- ```
45
+ By default the links will open TextMate-protocol links.
35
46
 
36
- Then run Rails like this:
47
+ To see if your editor is supported or to set up a different editor, see [the wiki](https://github.com/BetterErrors/better_errors/wiki/Link-to-your-editor).
37
48
 
38
- ```shell
39
- TRUSTED_IP=66.68.96.220 rails s
40
- ```
49
+ ### Optional: Set `BETTER_ERRORS_INSIDE_FRAME`
50
+
51
+ If your application is running inside of an iframe, or if you have a Content Security Policy that disallows links
52
+ to other protocols, the editor links will not work.
53
+
54
+ To work around this set `BETTER_ERRORS_INSIDE_FRAME=1` in the environment, and the links will include `target=_blank`,
55
+ allowing the link to open regardless of the policy.
56
+
57
+ _This works because it opens the editor from a new browser tab, escaping from the restrictions of your site._
58
+ _Unfortunately it leaves behind an empty tab each time, so only use this if needed._
59
+
60
+ ## Security
41
61
 
42
- Note that the `allow_ip!` is actually backed by a `Set`, so you can add more than one IP address or subnet.
62
+ **NOTE:** It is *critical* you put better\_errors only in the **development** section of your Gemfile.
63
+ **Do NOT run better_errors in production, or on Internet-facing hosts.**
43
64
 
44
- **Tip:** You can find your apparent IP by hitting the old error page's "Show env dump" and looking at "REMOTE_ADDR".
65
+ You will notice that the only machine that gets the Better Errors page is localhost, which means you get the default error page if you are developing on a remote host (or a virtually remote host, such as a Vagrant box).
66
+ Obviously, the REPL is not something you want to expose to the public, and there may be sensitive information available in the backtrace.
45
67
 
46
- **VirtualBox:** If you are using VirtualBox and are accessing the guest from your host's browser, you will need to use `allow_ip!` to see the error page.
68
+ For more information on how to configure access, see [the wiki](https://github.com/BetterErrors/better_errors/wiki/Allowing-access-to-the-console).
47
69
 
48
70
  ## Usage
49
71
 
50
72
  If you're using Rails, there's nothing else you need to do.
51
73
 
74
+ ### Using without Rails.
75
+
52
76
  If you're not using Rails, you need to insert `BetterErrors::Middleware` into your middleware stack, and optionally set `BetterErrors.application_root` if you'd like Better Errors to abbreviate filenames within your application.
53
77
 
54
- Here's an example using Sinatra:
78
+ For instructions for your specific middleware, [see the wiki](https://github.com/BetterErrors/better_errors/wiki/Non-Rails-frameworks).
55
79
 
56
- ```ruby
57
- require "sinatra"
58
- require "better_errors"
59
-
60
- configure :development do
61
- use BetterErrors::Middleware
62
- BetterErrors.application_root = __dir__
63
- end
80
+ ### Plain text requests
64
81
 
65
- get "/" do
66
- raise "oops"
67
- end
68
- ```
82
+ Better Errors will render a plain text error page when the request is an
83
+ `XMLHttpRequest` or when the `Accept` header does *not* include 'html'.
69
84
 
70
85
  ### Unicorn, Puma, and other multi-worker servers
71
86
 
72
- Better Errors works by leaving a lot of context in server process memory. If
73
- you're using a web server that runs multiple "workers" it's likely that a second
87
+ Better Errors works by leaving a lot of context in server process memory.
88
+ If you're using a web server that runs multiple "workers" it's likely that a second
74
89
  request (as happens when you click on a stack frame) will hit a different
75
- worker. That worker won't have the necessary context in memory, and you'll see
90
+ worker.
91
+ That worker won't have the necessary context in memory, and you'll see
76
92
  a `Session Expired` message.
77
93
 
78
94
  If this is the case for you, consider turning the number of workers to one (1)
@@ -80,10 +96,64 @@ in `development`. Another option would be to use Webrick, Mongrel, Thin,
80
96
  or another single-process server as your `rails server`, when you are trying
81
97
  to troubleshoot an issue in development.
82
98
 
99
+ ### Changing the link to your editor
100
+
101
+ Better Errors includes a link to your editor for the file and line of code that is being shown.
102
+ By default, it uses your environment to determine which editor should be opened.
103
+ See [the wiki for instructions on configuring the editor](https://github.com/BetterErrors/better_errors/wiki/Link-to-your-editor).
104
+
105
+
106
+ ## Set maximum variable size for inspector.
107
+
108
+ ```ruby
109
+ # e.g. in config/initializers/better_errors.rb
110
+ # This will stop BetterErrors from trying to render larger objects, which can cause
111
+ # slow loading times and browser performance problems. Stated size is in characters and refers
112
+ # to the length of #inspect's payload for the given object. Please be aware that HTML escaping
113
+ # modifies the size of this payload so setting this limit too precisely is not recommended.
114
+ # default value: 100_000
115
+ BetterErrors.maximum_variable_inspect_size = 100_000
116
+ ```
117
+
118
+ ## Ignore inspection of variables with certain classes.
119
+
120
+ ```ruby
121
+ # e.g. in config/initializers/better_errors.rb
122
+ # This will stop BetterErrors from trying to inspect objects of these classes, which can cause
123
+ # slow loading times and unneccessary database queries. Does not check inheritance chain, use
124
+ # strings not contants.
125
+ # default value: ['ActionDispatch::Request', 'ActionDispatch::Response']
126
+ BetterErrors.ignored_classes = ['ActionDispatch::Request', 'ActionDispatch::Response']
127
+ ```
128
+
83
129
  ## Get in touch!
84
130
 
85
131
  If you're using better_errors, I'd love to hear from you. Drop me a line and tell me what you think!
86
132
 
133
+ ## Development
134
+
135
+ After checking out the repo, run `bundle install` to install the basic dependencies.
136
+
137
+ You can run the tests with the simplest set of dependencies using:
138
+
139
+ ```rb
140
+ bundle exec rspec
141
+ ```
142
+
143
+ To run specs for each of the dependency combinations, run:
144
+
145
+ ```rb
146
+ bundle exec rake test:all
147
+ ```
148
+
149
+ You can run specs for a specific dependency combination using:
150
+
151
+ ```rb
152
+ BUNDLE_GEMFILE=gemfiles/pry09.gemfile bundle exec rspec
153
+ ```
154
+
155
+ On CI, the specs are run against each gemfile on each supported version of Ruby.
156
+
87
157
  ## Contributing
88
158
 
89
159
  1. Fork it
@@ -1,4 +1,3 @@
1
- # -*- encoding: utf-8 -*-
2
1
  lib = File.expand_path('../lib', __FILE__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
  require 'better_errors/version'
@@ -10,20 +9,39 @@ Gem::Specification.new do |s|
10
9
  s.email = ["charlie@charliesomerville.com"]
11
10
  s.description = %q{Provides a better error page for Rails and other Rack apps. Includes source code inspection, a live REPL and local/instance variable inspection for all stack frames.}
12
11
  s.summary = %q{Better error page for Rails and other Rack apps}
13
- s.homepage = "https://github.com/charliesome/better_errors"
12
+ s.homepage = "https://github.com/BetterErrors/better_errors"
14
13
  s.license = "MIT"
15
14
 
16
- s.files = `git ls-files`.split($/)
17
- s.test_files = s.files.grep(%r{^(test|spec|features)/})
15
+ s.files = `git ls-files -z`.split("\x0").reject do |f|
16
+ f.match(%r{^((test|spec|features|feature-screenshots)/|Rakefile)})
17
+ end
18
+
18
19
  s.require_paths = ["lib"]
19
- s.extensions = ["ext/mkrf_conf.rb"]
20
20
 
21
- s.required_ruby_version = ">= 1.9.2"
22
-
23
- s.add_dependency "erubis", ">= 2.6.6"
21
+ s.required_ruby_version = ">= 2.0.0"
22
+
23
+ s.add_development_dependency "rake", "~> 10.0"
24
+ s.add_development_dependency "rspec", "~> 3.5"
25
+ s.add_development_dependency "rspec-html-matchers"
26
+ s.add_development_dependency "rspec-its"
27
+ s.add_development_dependency "yard"
28
+ # kramdown 2.1 requires Ruby 2.3+
29
+ s.add_development_dependency "kramdown", (RUBY_VERSION < '2.3' ? '< 2.0.0' : '> 2.0.0')
30
+ # simplecov and coveralls must not be included here. See the Gemfiles instead.
31
+
32
+ s.add_dependency "erubi", ">= 1.0.0"
24
33
  s.add_dependency "coderay", ">= 1.0.0"
34
+ s.add_dependency "rack", ">= 0.9.0"
25
35
 
26
36
  # optional dependencies:
27
37
  # s.add_dependency "binding_of_caller"
28
38
  # s.add_dependency "pry"
39
+
40
+ if s.respond_to?(:metadata)
41
+ s.metadata['changelog_uri'] = 'https://github.com/BetterErrors/better_errors/releases'
42
+ s.metadata['source_code_uri'] = 'https://github.com/BetterErrors/better_errors'
43
+ s.metadata['bug_tracker_uri'] = 'https://github.com/BetterErrors/better_errors/issues'
44
+ else
45
+ puts "Your RubyGems does not support metadata. Update if you'd like to make a release."
46
+ end
29
47
  end
@@ -0,0 +1,10 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem 'rack', RUBY_VERSION < '2.2.2' ? '~> 1.6' : '~> 2.0'
4
+ gem "binding_of_caller"
5
+ gem "pry", "~> 0.10.0"
6
+
7
+ gem 'simplecov', require: false
8
+ gem 'simplecov-lcov', require: false
9
+
10
+ gemspec path: "../"
@@ -0,0 +1,9 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem 'rack', RUBY_VERSION < '2.2.2' ? '~> 1.6' : '~> 2.0'
4
+ gem "pry", "~> 0.11.0pre"
5
+
6
+ gem 'simplecov', require: false
7
+ gem 'simplecov-lcov', require: false
8
+
9
+ gemspec path: "../"
@@ -0,0 +1,9 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem 'rack', RUBY_VERSION < '2.2.2' ? '~> 1.6' : '~> 2.0'
4
+ gem "pry", "~> 0.9.12"
5
+
6
+ gem 'simplecov', require: false
7
+ gem 'simplecov-lcov', require: false
8
+
9
+ gemspec path: "../"
@@ -0,0 +1,8 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem 'rack', RUBY_VERSION < '2.2.2' ? '~> 1.6' : '~> 2.0'
4
+
5
+ gem 'simplecov', require: false
6
+ gem 'simplecov-lcov', require: false
7
+
8
+ gemspec path: "../"
@@ -0,0 +1,9 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem 'rack', RUBY_VERSION < '2.2.2' ? '~> 1.6' : '~> 2.0'
4
+ gem "binding_of_caller"
5
+
6
+ gem 'simplecov', require: false
7
+ gem 'simplecov-lcov', require: false
8
+
9
+ gemspec path: "../"
@@ -0,0 +1,10 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rails", "~> 4.2.0"
4
+ gem 'nokogiri', RUBY_VERSION < '2.1' ? '~> 1.6.0' : '>= 1.7'
5
+ gem 'i18n', '< 1.5.2' if RUBY_VERSION < '2.3'
6
+
7
+ gem 'simplecov', require: false
8
+ gem 'simplecov-lcov', require: false
9
+
10
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rails", "~> 4.2.0"
4
+ gem 'nokogiri', RUBY_VERSION < '2.1' ? '~> 1.6.0' : '>= 1.7'
5
+ gem 'i18n', '< 1.5.2' if RUBY_VERSION < '2.3'
6
+ gem "binding_of_caller"
7
+
8
+ gem 'simplecov', require: false
9
+ gem 'simplecov-lcov', require: false
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rails", "~> 4.2.0"
4
+ gem 'nokogiri', RUBY_VERSION < '2.1' ? '~> 1.6.0' : '>= 1.7'
5
+ gem 'i18n', '< 1.5.2' if RUBY_VERSION < '2.3'
6
+ gem "haml"
7
+
8
+ gem 'simplecov', require: false
9
+ gem 'simplecov-lcov', require: false
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,9 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rails", "~> 5.0.0"
4
+ gem 'i18n', '< 1.5.2' if RUBY_VERSION < '2.3'
5
+
6
+ gem 'simplecov', require: false
7
+ gem 'simplecov-lcov', require: false
8
+
9
+ gemspec path: "../"
@@ -0,0 +1,10 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rails", "~> 5.0.0"
4
+ gem 'i18n', '< 1.5.2' if RUBY_VERSION < '2.3'
5
+ gem "binding_of_caller"
6
+
7
+ gem 'simplecov', require: false
8
+ gem 'simplecov-lcov', require: false
9
+
10
+ gemspec path: "../"
@@ -0,0 +1,10 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rails", "~> 5.0.0"
4
+ gem 'i18n', '< 1.5.2' if RUBY_VERSION < '2.3'
5
+ gem "haml"
6
+
7
+ gem 'simplecov', require: false
8
+ gem 'simplecov-lcov', require: false
9
+
10
+ gemspec path: "../"
@@ -0,0 +1,9 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rails", "~> 5.1.0"
4
+ gem 'i18n', '< 1.5.2', require: false if RUBY_VERSION < '2.3'
5
+
6
+ gem 'simplecov', require: false
7
+ gem 'simplecov-lcov', require: false
8
+
9
+ gemspec path: "../"
@@ -0,0 +1,10 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rails", "~> 5.1.0"
4
+ gem 'i18n', '< 1.5.2' if RUBY_VERSION < '2.3'
5
+ gem "binding_of_caller"
6
+
7
+ gem 'simplecov', require: false
8
+ gem 'simplecov-lcov', require: false
9
+
10
+ gemspec path: "../"