better_errors 2.8.2 → 2.10.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +142 -0
- data/.github/workflows/release.yml +68 -0
- data/.gitignore +4 -0
- data/.ruby-version +1 -0
- data/Gemfile +6 -1
- data/README.md +2 -2
- data/better_errors.gemspec +5 -4
- data/gemfiles/pry010.gemfile +2 -1
- data/gemfiles/pry011.gemfile +2 -1
- data/gemfiles/pry09.gemfile +2 -1
- data/gemfiles/rack.gemfile +2 -1
- data/gemfiles/rack_boc.gemfile +2 -1
- data/gemfiles/rails42.gemfile +2 -1
- data/gemfiles/rails42_boc.gemfile +2 -1
- data/gemfiles/rails42_haml.gemfile +2 -1
- data/gemfiles/rails50.gemfile +2 -1
- data/gemfiles/rails50_boc.gemfile +2 -1
- data/gemfiles/rails50_haml.gemfile +2 -1
- data/gemfiles/rails51.gemfile +2 -1
- data/gemfiles/rails51_boc.gemfile +2 -1
- data/gemfiles/rails51_haml.gemfile +2 -1
- data/gemfiles/rails52.gemfile +2 -1
- data/gemfiles/rails52_boc.gemfile +2 -1
- data/gemfiles/rails52_haml.gemfile +2 -1
- data/gemfiles/rails60.gemfile +2 -1
- data/gemfiles/rails60_boc.gemfile +2 -1
- data/gemfiles/rails60_haml.gemfile +2 -1
- data/gemfiles/rails61.gemfile +8 -0
- data/gemfiles/rails61_boc.gemfile +9 -0
- data/gemfiles/rails61_haml.gemfile +9 -0
- data/lib/better_errors.rb +15 -35
- data/lib/better_errors/code_formatter.rb +16 -27
- data/lib/better_errors/code_formatter/html.rb +15 -1
- data/lib/better_errors/editor.rb +103 -0
- data/lib/better_errors/error_page.rb +33 -15
- data/lib/better_errors/error_page_style.rb +30 -0
- data/lib/better_errors/exception_hint.rb +29 -0
- data/lib/better_errors/middleware.rb +20 -4
- data/lib/better_errors/raised_exception.rb +8 -1
- data/lib/better_errors/templates/main.erb +80 -717
- data/lib/better_errors/templates/text.erb +6 -3
- data/lib/better_errors/templates/variable_info.erb +18 -15
- data/lib/better_errors/version.rb +2 -1
- metadata +30 -7
- data/.travis.yml +0 -111
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0902382bac90f4d54634a19663ed03b7aa6d64edd17002f3329c895e2b2784d
|
4
|
+
data.tar.gz: 6228791b815616739067a11405f18b041cf6d21c19013bcbaaf34a1b1bcdfa85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc552c327ab6230dae1fea0100c5fe8a20f9bfc6e63b245ac2eb221cf17d01531ec3ae46ea0b1545881476739d725a0723eacf9448c8a368fc9b7f4eedd8e24f
|
7
|
+
data.tar.gz: ce04e4dd447ff7e789f19d8a0d1cefa8b63e2e00cf3f81321877da3dd343df8a6cb5bc17a09fe21bfaba093900dc2ae41520941ad323d3b96a859c2a0cc023e4
|
@@ -0,0 +1,142 @@
|
|
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
|
+
- rails61
|
35
|
+
- rails42_haml
|
36
|
+
- rails50_haml
|
37
|
+
- rails51_haml
|
38
|
+
- rails52_haml
|
39
|
+
- rails60_haml
|
40
|
+
- rails61_haml
|
41
|
+
- rails42_boc
|
42
|
+
- rails50_boc
|
43
|
+
- rails51_boc
|
44
|
+
- rails52_boc
|
45
|
+
- rails60_boc
|
46
|
+
- rails61_boc
|
47
|
+
- rack
|
48
|
+
- rack_boc
|
49
|
+
# - pry09
|
50
|
+
# - pry10
|
51
|
+
# - pry11
|
52
|
+
exclude:
|
53
|
+
- { ruby: 2.2, gemfile: rails60 }
|
54
|
+
- { ruby: 2.2, gemfile: rails60_boc }
|
55
|
+
- { ruby: 2.2, gemfile: rails60_haml }
|
56
|
+
- { ruby: 2.2, gemfile: rails61 }
|
57
|
+
- { ruby: 2.2, gemfile: rails61_boc }
|
58
|
+
- { ruby: 2.2, gemfile: rails61_haml }
|
59
|
+
- { ruby: 2.3, gemfile: rails42 }
|
60
|
+
- { ruby: 2.3, gemfile: rails42_boc }
|
61
|
+
- { ruby: 2.3, gemfile: rails42_haml }
|
62
|
+
- { ruby: 2.3, gemfile: rails60 }
|
63
|
+
- { ruby: 2.3, gemfile: rails60_boc }
|
64
|
+
- { ruby: 2.3, gemfile: rails60_haml }
|
65
|
+
- { ruby: 2.3, gemfile: rails61 }
|
66
|
+
- { ruby: 2.3, gemfile: rails61_boc }
|
67
|
+
- { ruby: 2.3, gemfile: rails61_haml }
|
68
|
+
- { ruby: 2.4, gemfile: rails42 }
|
69
|
+
- { ruby: 2.4, gemfile: rails42_boc }
|
70
|
+
- { ruby: 2.4, gemfile: rails42_haml }
|
71
|
+
- { ruby: 2.4, gemfile: rails60 }
|
72
|
+
- { ruby: 2.4, gemfile: rails60_boc }
|
73
|
+
- { ruby: 2.4, gemfile: rails60_haml }
|
74
|
+
- { ruby: 2.4, gemfile: rails61 }
|
75
|
+
- { ruby: 2.4, gemfile: rails61_boc }
|
76
|
+
- { ruby: 2.4, gemfile: rails61_haml }
|
77
|
+
- { ruby: 2.5, gemfile: rails42 }
|
78
|
+
- { ruby: 2.5, gemfile: rails42_boc }
|
79
|
+
- { ruby: 2.5, gemfile: rails42_haml }
|
80
|
+
- { ruby: 2.6, gemfile: rails42 }
|
81
|
+
- { ruby: 2.6, gemfile: rails42_boc }
|
82
|
+
- { ruby: 2.6, gemfile: rails42_haml }
|
83
|
+
- { ruby: 2.7, gemfile: rails42 }
|
84
|
+
- { ruby: 2.7, gemfile: rails42_boc }
|
85
|
+
- { ruby: 2.7, gemfile: rails42_haml }
|
86
|
+
# - { ruby: ruby-head, gemfile: rails42 }
|
87
|
+
# - { ruby: ruby-head, gemfile: rails42_boc }
|
88
|
+
# - { ruby: ruby-head, gemfile: rails42_haml }
|
89
|
+
- { ruby: truffleruby-head, gemfile: rails42_boc }
|
90
|
+
- { ruby: truffleruby-head, gemfile: rails50_boc }
|
91
|
+
- { ruby: truffleruby-head, gemfile: rails51_boc }
|
92
|
+
- { ruby: truffleruby-head, gemfile: rails52_boc }
|
93
|
+
- { ruby: truffleruby-head, gemfile: rails60_boc }
|
94
|
+
- { ruby: truffleruby-head, gemfile: rack_boc }
|
95
|
+
|
96
|
+
steps:
|
97
|
+
|
98
|
+
- uses: actions/checkout@v2
|
99
|
+
|
100
|
+
- name: Set up Ruby
|
101
|
+
uses: ruby/setup-ruby@v1
|
102
|
+
with:
|
103
|
+
ruby-version: ${{ matrix.ruby }}
|
104
|
+
|
105
|
+
- uses: actions/cache@v2
|
106
|
+
with:
|
107
|
+
path: gemfiles/vendor/bundle
|
108
|
+
key: v3-${{ runner.os }}-branch-${{ github.ref }}-ruby-${{ matrix.ruby }}-gemfile-${{ matrix.gemfile }}-${{ hashFiles(format('gemfiles/{0}.gemfile', matrix.gemfile)) }}
|
109
|
+
restore-keys: |
|
110
|
+
v3-${{ runner.os }}-branch-${{ github.ref }}-ruby-${{ matrix.ruby }}-gemfile-${{ matrix.gemfile }}
|
111
|
+
v3-${{ runner.os }}-branch-master-ruby-${{ matrix.ruby }}-gemfile-${{ matrix.gemfile }}
|
112
|
+
|
113
|
+
- name: Bundle install
|
114
|
+
run: |
|
115
|
+
bundle config path vendor/bundle
|
116
|
+
bundle install --jobs 4 --retry 3
|
117
|
+
env:
|
118
|
+
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
|
119
|
+
|
120
|
+
- name: RSpec
|
121
|
+
run: bundle exec rspec -f doc --color
|
122
|
+
env:
|
123
|
+
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
|
124
|
+
|
125
|
+
- name: Report to Coveralls
|
126
|
+
uses: coverallsapp/github-action@v1.1.2
|
127
|
+
with:
|
128
|
+
github-token: ${{ secrets.github_token }}
|
129
|
+
flag-name: test-${{ matrix.ruby }}-${{ matrix.gemfile }}
|
130
|
+
parallel: true
|
131
|
+
|
132
|
+
|
133
|
+
finish:
|
134
|
+
needs: test
|
135
|
+
runs-on: ubuntu-latest
|
136
|
+
steps:
|
137
|
+
|
138
|
+
- name: Report completion to Coveralls
|
139
|
+
uses: coverallsapp/github-action@v1.1.2
|
140
|
+
with:
|
141
|
+
github-token: ${{ secrets.github_token }}
|
142
|
+
parallel-finished: true
|
@@ -0,0 +1,68 @@
|
|
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: Compile CSS
|
52
|
+
run: |
|
53
|
+
bundle exec rake style:build
|
54
|
+
|
55
|
+
- name: Build gem
|
56
|
+
run: gem build better_errors.gemspec
|
57
|
+
|
58
|
+
- name: Add gem to GitHub Release
|
59
|
+
uses: actions/upload-release-asset@v1
|
60
|
+
env:
|
61
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
62
|
+
with:
|
63
|
+
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
64
|
+
asset_path: ./better_errors-${{ steps.get_version.outputs.version }}.gem
|
65
|
+
asset_name: better_errors-${{ steps.get_version.outputs.version }}.gem
|
66
|
+
asset_content_type: application/octet-stream
|
67
|
+
|
68
|
+
# TODO: if this release is on master, add a commit updating the version in master.
|
data/.gitignore
CHANGED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.7.2
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
[![Build Status](https://
|
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
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
|
-
[![Coverage](https://coveralls.io/repos/github/BetterErrors/better_errors/badge.svg?branch=master)](https://coveralls.io/github/BetterErrors/better_errors?branch=master)
|
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
4
|
[![Gem Version](https://img.shields.io/gem/v/better_errors.svg)](https://rubygems.org/gems/better_errors)
|
5
5
|
|
6
6
|
# Better Errors
|
data/better_errors.gemspec
CHANGED
@@ -12,9 +12,9 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.homepage = "https://github.com/BetterErrors/better_errors"
|
13
13
|
s.license = "MIT"
|
14
14
|
|
15
|
-
s.files = `git ls-files -z`.split("\x0").reject
|
16
|
-
f.match(%r{^((test|spec|features|feature-screenshots)/|Rakefile)})
|
17
|
-
|
15
|
+
s.files = `git ls-files -z`.split("\x0").reject { |f|
|
16
|
+
f.match(%r{^((test|spec|features|feature-screenshots)/|Rakefile)|\.scss$})
|
17
|
+
} + %w[lib/better_errors/templates/main.css]
|
18
18
|
|
19
19
|
s.require_paths = ["lib"]
|
20
20
|
|
@@ -25,12 +25,13 @@ Gem::Specification.new do |s|
|
|
25
25
|
s.add_development_dependency "rspec-html-matchers"
|
26
26
|
s.add_development_dependency "rspec-its"
|
27
27
|
s.add_development_dependency "yard"
|
28
|
+
s.add_development_dependency "sassc"
|
28
29
|
# kramdown 2.1 requires Ruby 2.3+
|
29
30
|
s.add_development_dependency "kramdown", (RUBY_VERSION < '2.3' ? '< 2.0.0' : '> 2.0.0')
|
30
31
|
# simplecov and coveralls must not be included here. See the Gemfiles instead.
|
31
32
|
|
32
33
|
s.add_dependency "erubi", ">= 1.0.0"
|
33
|
-
s.add_dependency "
|
34
|
+
s.add_dependency "rouge", ">= 1.0.0"
|
34
35
|
s.add_dependency "rack", ">= 0.9.0"
|
35
36
|
|
36
37
|
# optional dependencies:
|
data/gemfiles/pry010.gemfile
CHANGED
data/gemfiles/pry011.gemfile
CHANGED
data/gemfiles/pry09.gemfile
CHANGED
data/gemfiles/rack.gemfile
CHANGED
data/gemfiles/rack_boc.gemfile
CHANGED
data/gemfiles/rails42.gemfile
CHANGED
@@ -4,6 +4,7 @@ gem "rails", "~> 4.2.0"
|
|
4
4
|
gem 'nokogiri', RUBY_VERSION < '2.1' ? '~> 1.6.0' : '>= 1.7'
|
5
5
|
gem 'i18n', '< 1.5.2' if RUBY_VERSION < '2.3'
|
6
6
|
|
7
|
-
gem '
|
7
|
+
gem 'simplecov', require: false
|
8
|
+
gem 'simplecov-lcov', require: false
|
8
9
|
|
9
10
|
gemspec path: "../"
|
@@ -5,6 +5,7 @@ gem 'nokogiri', RUBY_VERSION < '2.1' ? '~> 1.6.0' : '>= 1.7'
|
|
5
5
|
gem 'i18n', '< 1.5.2' if RUBY_VERSION < '2.3'
|
6
6
|
gem "binding_of_caller"
|
7
7
|
|
8
|
-
gem '
|
8
|
+
gem 'simplecov', require: false
|
9
|
+
gem 'simplecov-lcov', require: false
|
9
10
|
|
10
11
|
gemspec path: "../"
|
data/gemfiles/rails50.gemfile
CHANGED
data/gemfiles/rails51.gemfile
CHANGED
data/gemfiles/rails52.gemfile
CHANGED