power_trace 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +3 -18
- data/Gemfile +5 -0
- data/Gemfile.lock +124 -1
- data/README.md +70 -19
- data/examples/rails-6/.browserslistrc +1 -0
- data/examples/rails-6/.gitignore +41 -0
- data/examples/rails-6/.ruby-version +1 -0
- data/examples/rails-6/Gemfile +55 -0
- data/examples/rails-6/Gemfile.lock +233 -0
- data/examples/rails-6/README.md +24 -0
- data/examples/rails-6/Rakefile +6 -0
- data/examples/rails-6/app/assets/config/manifest.js +2 -0
- data/examples/rails-6/app/assets/images/.keep +0 -0
- data/examples/rails-6/app/assets/stylesheets/application.css +15 -0
- data/examples/rails-6/app/assets/stylesheets/posts.scss +3 -0
- data/examples/rails-6/app/assets/stylesheets/scaffolds.scss +65 -0
- data/examples/rails-6/app/channels/application_cable/channel.rb +4 -0
- data/examples/rails-6/app/channels/application_cable/connection.rb +4 -0
- data/examples/rails-6/app/controllers/application_controller.rb +2 -0
- data/examples/rails-6/app/controllers/concerns/.keep +0 -0
- data/examples/rails-6/app/controllers/posts_controller.rb +75 -0
- data/examples/rails-6/app/helpers/application_helper.rb +2 -0
- data/examples/rails-6/app/helpers/posts_helper.rb +2 -0
- data/examples/rails-6/app/javascript/channels/consumer.js +6 -0
- data/examples/rails-6/app/javascript/channels/index.js +5 -0
- data/examples/rails-6/app/javascript/packs/application.js +17 -0
- data/examples/rails-6/app/jobs/application_job.rb +7 -0
- data/examples/rails-6/app/mailers/application_mailer.rb +4 -0
- data/examples/rails-6/app/models/application_record.rb +3 -0
- data/examples/rails-6/app/models/concerns/.keep +0 -0
- data/examples/rails-6/app/models/post.rb +2 -0
- data/examples/rails-6/app/views/layouts/application.html.erb +15 -0
- data/examples/rails-6/app/views/layouts/mailer.html.erb +13 -0
- data/examples/rails-6/app/views/layouts/mailer.text.erb +1 -0
- data/examples/rails-6/app/views/posts/_form.html.erb +27 -0
- data/examples/rails-6/app/views/posts/_post.json.jbuilder +2 -0
- data/examples/rails-6/app/views/posts/edit.html.erb +6 -0
- data/examples/rails-6/app/views/posts/index.html.erb +29 -0
- data/examples/rails-6/app/views/posts/index.json.jbuilder +1 -0
- data/examples/rails-6/app/views/posts/new.html.erb +5 -0
- data/examples/rails-6/app/views/posts/show.html.erb +14 -0
- data/examples/rails-6/app/views/posts/show.json.jbuilder +1 -0
- data/examples/rails-6/babel.config.js +72 -0
- data/examples/rails-6/bin/bundle +114 -0
- data/examples/rails-6/bin/rails +9 -0
- data/examples/rails-6/bin/rake +9 -0
- data/examples/rails-6/bin/setup +36 -0
- data/examples/rails-6/bin/webpack +18 -0
- data/examples/rails-6/bin/webpack-dev-server +18 -0
- data/examples/rails-6/bin/yarn +11 -0
- data/examples/rails-6/config.ru +5 -0
- data/examples/rails-6/config/application.rb +19 -0
- data/examples/rails-6/config/boot.rb +4 -0
- data/examples/rails-6/config/cable.yml +10 -0
- data/examples/rails-6/config/credentials.yml.enc +1 -0
- data/examples/rails-6/config/database.yml +25 -0
- data/examples/rails-6/config/environment.rb +5 -0
- data/examples/rails-6/config/environments/development.rb +62 -0
- data/examples/rails-6/config/environments/production.rb +112 -0
- data/examples/rails-6/config/environments/test.rb +49 -0
- data/examples/rails-6/config/initializers/application_controller_renderer.rb +8 -0
- data/examples/rails-6/config/initializers/assets.rb +14 -0
- data/examples/rails-6/config/initializers/backtrace_silencers.rb +7 -0
- data/examples/rails-6/config/initializers/content_security_policy.rb +30 -0
- data/examples/rails-6/config/initializers/cookies_serializer.rb +5 -0
- data/examples/rails-6/config/initializers/filter_parameter_logging.rb +4 -0
- data/examples/rails-6/config/initializers/inflections.rb +16 -0
- data/examples/rails-6/config/initializers/mime_types.rb +4 -0
- data/examples/rails-6/config/initializers/power_trace.rb +3 -0
- data/examples/rails-6/config/initializers/wrap_parameters.rb +14 -0
- data/examples/rails-6/config/locales/en.yml +33 -0
- data/examples/rails-6/config/puma.rb +38 -0
- data/examples/rails-6/config/routes.rb +5 -0
- data/examples/rails-6/config/storage.yml +34 -0
- data/examples/rails-6/config/webpack/development.js +5 -0
- data/examples/rails-6/config/webpack/environment.js +3 -0
- data/examples/rails-6/config/webpack/production.js +5 -0
- data/examples/rails-6/config/webpack/test.js +5 -0
- data/examples/rails-6/config/webpacker.yml +96 -0
- data/examples/rails-6/db/migrate/20200829063653_create_posts.rb +10 -0
- data/examples/rails-6/db/seeds.rb +7 -0
- data/examples/rails-6/lib/assets/.keep +0 -0
- data/examples/rails-6/lib/tasks/.keep +0 -0
- data/examples/rails-6/log/.keep +0 -0
- data/examples/rails-6/package.json +15 -0
- data/examples/rails-6/postcss.config.js +12 -0
- data/examples/rails-6/public/404.html +67 -0
- data/examples/rails-6/public/422.html +67 -0
- data/examples/rails-6/public/500.html +66 -0
- data/examples/rails-6/public/apple-touch-icon-precomposed.png +0 -0
- data/examples/rails-6/public/apple-touch-icon.png +0 -0
- data/examples/rails-6/public/favicon.ico +0 -0
- data/examples/rails-6/public/robots.txt +1 -0
- data/examples/rails-6/storage/.keep +0 -0
- data/examples/rails-6/test/application_system_test_case.rb +5 -0
- data/examples/rails-6/test/channels/application_cable/connection_test.rb +11 -0
- data/examples/rails-6/test/controllers/.keep +0 -0
- data/examples/rails-6/test/controllers/posts_controller_test.rb +48 -0
- data/examples/rails-6/test/fixtures/.keep +0 -0
- data/examples/rails-6/test/fixtures/files/.keep +0 -0
- data/examples/rails-6/test/fixtures/posts.yml +9 -0
- data/examples/rails-6/test/helpers/.keep +0 -0
- data/examples/rails-6/test/integration/.keep +0 -0
- data/examples/rails-6/test/mailers/.keep +0 -0
- data/examples/rails-6/test/models/.keep +0 -0
- data/examples/rails-6/test/models/post_test.rb +7 -0
- data/examples/rails-6/test/system/.keep +0 -0
- data/examples/rails-6/test/system/posts_test.rb +45 -0
- data/examples/rails-6/test/test_helper.rb +13 -0
- data/examples/rails-6/tmp/.keep +0 -0
- data/examples/rails-6/tmp/pids/.keep +0 -0
- data/examples/rails-6/vendor/.keep +0 -0
- data/examples/rails-6/yarn.lock +7593 -0
- data/images/normal_minitest_error.png +0 -0
- data/images/normal_rails_error.png +0 -0
- data/images/power_minitest_error.png +0 -0
- data/images/power_rails_error.png +0 -0
- data/lib/power_trace.rb +24 -7
- data/lib/power_trace/entry.rb +75 -10
- data/lib/power_trace/exception_patch.rb +1 -1
- data/lib/power_trace/integrations/minitest.rb +14 -0
- data/lib/power_trace/integrations/rails.rb +2 -0
- data/lib/power_trace/integrations/rspec.rb +11 -0
- data/lib/power_trace/rails/action_dispatch/debug_exceptions.rb +28 -0
- data/lib/power_trace/rails/action_dispatch/exception_wrapper.rb +28 -0
- data/lib/power_trace/version.rb +1 -1
- data/power_trace.gemspec +1 -0
- metadata +134 -3
- data/lib/power_trace/rspec_patch.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 221015482c85c364e812989ddc14e1e44e9c0a4d5aca825d3f47aa5420e9c35f
|
4
|
+
data.tar.gz: 97d01a9f67afb92dd66ec8ef86fa30431b11aa185c73ff0d2f5c8e11a6713e02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8439e74788c79479e6cd7e50769544b277bf91fb9472943e8c5a5c6c9efa6b530acad6899b17731e0a57b2d21ac4073e2d426868a9f9dab49b145b207b154aa
|
7
|
+
data.tar.gz: '0979bc07bcf3c10efcee0fb0398094b3c7b19a49e2cc93ef59302f81d1da1d35ffbc31e7c4f43c2cd909d5b64a436a3436653d0ca91f401d8c782e8e7c78c445'
|
data/.github/workflows/ruby.yml
CHANGED
@@ -14,26 +14,11 @@ jobs:
|
|
14
14
|
- uses: actions/checkout@v1
|
15
15
|
|
16
16
|
- name: Set up Ruby ${{ matrix.ruby_version }}
|
17
|
-
uses:
|
17
|
+
uses: ruby/setup-ruby@v1
|
18
18
|
with:
|
19
19
|
ruby-version: ${{ matrix.ruby_version }}
|
20
20
|
|
21
|
-
- name: Setup
|
21
|
+
- name: Setup & Run
|
22
22
|
run: |
|
23
|
-
gem install bundler
|
24
23
|
bundle install --jobs 4 --retry 3
|
25
|
-
|
26
|
-
- name: Run test
|
27
|
-
run: bundle exec rake
|
28
|
-
|
29
|
-
- name: Publish Test Coverage
|
30
|
-
uses: paambaati/codeclimate-action@v2.6.0
|
31
|
-
env:
|
32
|
-
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
|
33
|
-
if: ${{ env.CC_TEST_REPORTER_ID != '' }}
|
34
|
-
with:
|
35
|
-
# the coverage result should already be generated by the previous step
|
36
|
-
# so we don't need to provide and command in the step
|
37
|
-
# this is just a placeholder to avoid it run the default `yarn coverage` command
|
38
|
-
coverageCommand: ruby -v
|
39
|
-
debug: true
|
24
|
+
bundle exec rake
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,13 +1,62 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
power_trace (0.
|
4
|
+
power_trace (0.3.0)
|
5
5
|
activesupport
|
6
6
|
binding_of_caller (~> 0.8.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
+
actioncable (6.0.3.2)
|
12
|
+
actionpack (= 6.0.3.2)
|
13
|
+
nio4r (~> 2.0)
|
14
|
+
websocket-driver (>= 0.6.1)
|
15
|
+
actionmailbox (6.0.3.2)
|
16
|
+
actionpack (= 6.0.3.2)
|
17
|
+
activejob (= 6.0.3.2)
|
18
|
+
activerecord (= 6.0.3.2)
|
19
|
+
activestorage (= 6.0.3.2)
|
20
|
+
activesupport (= 6.0.3.2)
|
21
|
+
mail (>= 2.7.1)
|
22
|
+
actionmailer (6.0.3.2)
|
23
|
+
actionpack (= 6.0.3.2)
|
24
|
+
actionview (= 6.0.3.2)
|
25
|
+
activejob (= 6.0.3.2)
|
26
|
+
mail (~> 2.5, >= 2.5.4)
|
27
|
+
rails-dom-testing (~> 2.0)
|
28
|
+
actionpack (6.0.3.2)
|
29
|
+
actionview (= 6.0.3.2)
|
30
|
+
activesupport (= 6.0.3.2)
|
31
|
+
rack (~> 2.0, >= 2.0.8)
|
32
|
+
rack-test (>= 0.6.3)
|
33
|
+
rails-dom-testing (~> 2.0)
|
34
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
35
|
+
actiontext (6.0.3.2)
|
36
|
+
actionpack (= 6.0.3.2)
|
37
|
+
activerecord (= 6.0.3.2)
|
38
|
+
activestorage (= 6.0.3.2)
|
39
|
+
activesupport (= 6.0.3.2)
|
40
|
+
nokogiri (>= 1.8.5)
|
41
|
+
actionview (6.0.3.2)
|
42
|
+
activesupport (= 6.0.3.2)
|
43
|
+
builder (~> 3.1)
|
44
|
+
erubi (~> 1.4)
|
45
|
+
rails-dom-testing (~> 2.0)
|
46
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
47
|
+
activejob (6.0.3.2)
|
48
|
+
activesupport (= 6.0.3.2)
|
49
|
+
globalid (>= 0.3.6)
|
50
|
+
activemodel (6.0.3.2)
|
51
|
+
activesupport (= 6.0.3.2)
|
52
|
+
activerecord (6.0.3.2)
|
53
|
+
activemodel (= 6.0.3.2)
|
54
|
+
activesupport (= 6.0.3.2)
|
55
|
+
activestorage (6.0.3.2)
|
56
|
+
actionpack (= 6.0.3.2)
|
57
|
+
activejob (= 6.0.3.2)
|
58
|
+
activerecord (= 6.0.3.2)
|
59
|
+
marcel (~> 0.3.1)
|
11
60
|
activesupport (6.0.3.2)
|
12
61
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
13
62
|
i18n (>= 0.7, < 2)
|
@@ -16,17 +65,69 @@ GEM
|
|
16
65
|
zeitwerk (~> 2.2, >= 2.2.2)
|
17
66
|
binding_of_caller (0.8.0)
|
18
67
|
debug_inspector (>= 0.0.1)
|
68
|
+
builder (3.2.4)
|
69
|
+
codecov (0.2.8)
|
70
|
+
json
|
71
|
+
simplecov
|
19
72
|
coderay (1.1.3)
|
20
73
|
concurrent-ruby (1.1.6)
|
74
|
+
crass (1.0.6)
|
21
75
|
debug_inspector (0.0.3)
|
22
76
|
diff-lcs (1.3)
|
77
|
+
docile (1.3.2)
|
78
|
+
erubi (1.9.0)
|
79
|
+
globalid (0.4.2)
|
80
|
+
activesupport (>= 4.2.0)
|
23
81
|
i18n (1.8.3)
|
24
82
|
concurrent-ruby (~> 1.0)
|
83
|
+
json (2.3.1)
|
84
|
+
loofah (2.7.0)
|
85
|
+
crass (~> 1.0.2)
|
86
|
+
nokogiri (>= 1.5.9)
|
87
|
+
mail (2.7.1)
|
88
|
+
mini_mime (>= 0.1.1)
|
89
|
+
marcel (0.3.3)
|
90
|
+
mimemagic (~> 0.3.2)
|
25
91
|
method_source (1.0.0)
|
92
|
+
mimemagic (0.3.5)
|
93
|
+
mini_mime (1.0.2)
|
94
|
+
mini_portile2 (2.4.0)
|
26
95
|
minitest (5.14.1)
|
96
|
+
nio4r (2.5.2)
|
97
|
+
nokogiri (1.10.10)
|
98
|
+
mini_portile2 (~> 2.4.0)
|
27
99
|
pry (0.13.1)
|
28
100
|
coderay (~> 1.1)
|
29
101
|
method_source (~> 1.0)
|
102
|
+
rack (2.2.3)
|
103
|
+
rack-test (1.1.0)
|
104
|
+
rack (>= 1.0, < 3)
|
105
|
+
rails (6.0.3.2)
|
106
|
+
actioncable (= 6.0.3.2)
|
107
|
+
actionmailbox (= 6.0.3.2)
|
108
|
+
actionmailer (= 6.0.3.2)
|
109
|
+
actionpack (= 6.0.3.2)
|
110
|
+
actiontext (= 6.0.3.2)
|
111
|
+
actionview (= 6.0.3.2)
|
112
|
+
activejob (= 6.0.3.2)
|
113
|
+
activemodel (= 6.0.3.2)
|
114
|
+
activerecord (= 6.0.3.2)
|
115
|
+
activestorage (= 6.0.3.2)
|
116
|
+
activesupport (= 6.0.3.2)
|
117
|
+
bundler (>= 1.3.0)
|
118
|
+
railties (= 6.0.3.2)
|
119
|
+
sprockets-rails (>= 2.0.0)
|
120
|
+
rails-dom-testing (2.0.3)
|
121
|
+
activesupport (>= 4.2.0)
|
122
|
+
nokogiri (>= 1.6)
|
123
|
+
rails-html-sanitizer (1.3.0)
|
124
|
+
loofah (~> 2.3)
|
125
|
+
railties (6.0.3.2)
|
126
|
+
actionpack (= 6.0.3.2)
|
127
|
+
activesupport (= 6.0.3.2)
|
128
|
+
method_source
|
129
|
+
rake (>= 0.8.7)
|
130
|
+
thor (>= 0.20.3, < 2.0)
|
30
131
|
rake (12.3.3)
|
31
132
|
rspec (3.9.0)
|
32
133
|
rspec-core (~> 3.9.0)
|
@@ -41,19 +142,41 @@ GEM
|
|
41
142
|
diff-lcs (>= 1.2.0, < 2.0)
|
42
143
|
rspec-support (~> 3.9.0)
|
43
144
|
rspec-support (3.9.2)
|
145
|
+
simplecov (0.19.0)
|
146
|
+
docile (~> 1.1)
|
147
|
+
simplecov-html (~> 0.11)
|
148
|
+
simplecov-html (0.12.2)
|
149
|
+
sprockets (4.0.2)
|
150
|
+
concurrent-ruby (~> 1.0)
|
151
|
+
rack (> 1, < 3)
|
152
|
+
sprockets-rails (3.2.1)
|
153
|
+
actionpack (>= 4.0)
|
154
|
+
activesupport (>= 4.0)
|
155
|
+
sprockets (>= 3.0.0)
|
156
|
+
sqlite3 (1.4.2)
|
157
|
+
thor (1.0.1)
|
44
158
|
thread_safe (0.3.6)
|
45
159
|
tzinfo (1.2.7)
|
46
160
|
thread_safe (~> 0.1)
|
161
|
+
websocket-driver (0.7.3)
|
162
|
+
websocket-extensions (>= 0.1.0)
|
163
|
+
websocket-extensions (0.1.5)
|
47
164
|
zeitwerk (2.4.0)
|
48
165
|
|
49
166
|
PLATFORMS
|
50
167
|
ruby
|
51
168
|
|
52
169
|
DEPENDENCIES
|
170
|
+
activerecord
|
171
|
+
codecov
|
172
|
+
minitest
|
53
173
|
power_trace!
|
54
174
|
pry
|
175
|
+
rails
|
55
176
|
rake (~> 12.0)
|
56
177
|
rspec (~> 3.0)
|
178
|
+
simplecov
|
179
|
+
sqlite3
|
57
180
|
|
58
181
|
BUNDLED WITH
|
59
182
|
2.1.4
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# power_trace
|
2
2
|
|
3
|
-
![Ruby](https://github.com/st0012/power_trace/workflows/Ruby/badge.svg) [![Gem Version](https://badge.fury.io/rb/power_trace.svg)](https://badge.fury.io/rb/power_trace)
|
3
|
+
![Ruby](https://github.com/st0012/power_trace/workflows/Ruby/badge.svg) [![Gem Version](https://badge.fury.io/rb/power_trace.svg)](https://badge.fury.io/rb/power_trace) [![codecov](https://codecov.io/gh/st0012/power_trace/branch/master/graph/badge.svg)](https://codecov.io/gh/st0012/power_trace)
|
4
4
|
|
5
5
|
Backtrace (Stack traces) are essential information for debugging our applications. However, they only tell us what the program did, but don't tell us what it had (the arguments, local variables...etc.). So it's very often that we'd need to visit each call site, rerun the program, and try to print out the variables. To me, It's like the Google map's navigation only tells us the name of the roads, but not showing us the map along with them.
|
6
6
|
|
@@ -30,6 +30,74 @@ $ gem install power_trace
|
|
30
30
|
|
31
31
|
## Usage
|
32
32
|
|
33
|
+
### Use It With Rails
|
34
|
+
|
35
|
+
You can add more context to Rails' exception reporting with:
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
# config/initializers/power_trace.rb
|
39
|
+
|
40
|
+
if defined?(PowerTrace)
|
41
|
+
PowerTrace.integrations = :rails
|
42
|
+
end
|
43
|
+
```
|
44
|
+
|
45
|
+
Result:
|
46
|
+
|
47
|
+
**Before**
|
48
|
+
![normal rails error message](https://github.com/st0012/power_trace/blob/master/images/normal_rails_error.png)
|
49
|
+
|
50
|
+
**After**
|
51
|
+
![rails error message with config set to true](https://github.com/st0012/power_trace/blob/master/images/power_rails_error.png)
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
### Use It With RSpec
|
56
|
+
|
57
|
+
You can prettify RSpec's error messages with `power_trace` by adding:
|
58
|
+
|
59
|
+
```ruby
|
60
|
+
# spec/spec_helper.rb
|
61
|
+
|
62
|
+
require "power_trace"
|
63
|
+
PowerTrace.integrations = :rspec
|
64
|
+
```
|
65
|
+
|
66
|
+
Result:
|
67
|
+
|
68
|
+
**Before**
|
69
|
+
![normal rspec error message](https://github.com/st0012/power_trace/blob/master/images/normal_rspec_error.png)
|
70
|
+
|
71
|
+
**After**
|
72
|
+
![rspec error message with config set to true](https://github.com/st0012/power_trace/blob/master/images/power_trace_rspec_error.png)
|
73
|
+
|
74
|
+
### Use It With Minitest
|
75
|
+
|
76
|
+
You can also prettify Minitest's error messages with `power_trace` with:
|
77
|
+
|
78
|
+
```ruby
|
79
|
+
# test/test_helper.rb
|
80
|
+
|
81
|
+
require "power_trace"
|
82
|
+
PowerTrace.integrations = :minitest
|
83
|
+
```
|
84
|
+
|
85
|
+
Result:
|
86
|
+
|
87
|
+
**Before**
|
88
|
+
![normal minitest error message](https://github.com/st0012/power_trace/blob/master/images/normal_minitest_error.png)
|
89
|
+
|
90
|
+
**After**
|
91
|
+
![minitest error message with config set to true](https://github.com/st0012/power_trace/blob/master/images/power_minitest_error.png)
|
92
|
+
|
93
|
+
### Use It With Multiple Integrations
|
94
|
+
|
95
|
+
It's also possible to use it with multiple integrations (e.g. `rspec` + `rails`):
|
96
|
+
|
97
|
+
```ruby
|
98
|
+
PowerTrace.integrations = [:rspec, :rails]
|
99
|
+
```
|
100
|
+
|
33
101
|
### Call `power_trace` directly
|
34
102
|
|
35
103
|
If you call `power_trace` directly, it'll return a `PowerTrace::Stack` instance that contains all the processed traces. You can then use it in 3 different ways:
|
@@ -108,29 +176,12 @@ If you think the above feature is too aggressive. You can access an exception ob
|
|
108
176
|
begin
|
109
177
|
perform_a_call
|
110
178
|
rescue => e
|
111
|
-
e.
|
179
|
+
e.stored_power_trace # <= like this
|
112
180
|
end
|
113
181
|
```
|
114
182
|
|
115
183
|
This feature doesn't require any flag to enable, as the information is added as an extra field and doesn't override anything.
|
116
184
|
|
117
|
-
### Use It With RSpec
|
118
|
-
|
119
|
-
You can also prettify RSpec's error messages with `power_trace`, just use the below config:
|
120
|
-
|
121
|
-
```ruby
|
122
|
-
PowerTrace.power_rspec_trace = true
|
123
|
-
```
|
124
|
-
|
125
|
-
Result:
|
126
|
-
|
127
|
-
**Before**
|
128
|
-
![normal rspec error message](https://github.com/st0012/power_trace/blob/master/images/normal_rspec_error.png)
|
129
|
-
|
130
|
-
**After**
|
131
|
-
![rspec error message with config set to true](https://github.com/st0012/power_trace/blob/master/images/power_trace_rspec_error.png)
|
132
|
-
|
133
|
-
|
134
185
|
## Inspirations & Helpful Tools
|
135
186
|
|
136
187
|
- [pretty_backtrace](https://github.com/ko1/pretty_backtrace)
|
@@ -0,0 +1 @@
|
|
1
|
+
defaults
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
|
2
|
+
#
|
3
|
+
# If you find yourself ignoring temporary files generated by your text editor
|
4
|
+
# or operating system, you probably want to add a global ignore instead:
|
5
|
+
# git config --global core.excludesfile '~/.gitignore_global'
|
6
|
+
|
7
|
+
# Ignore bundler config.
|
8
|
+
/.bundle
|
9
|
+
|
10
|
+
# Ignore the default SQLite database.
|
11
|
+
/db/*.sqlite3
|
12
|
+
/db/*.sqlite3-journal
|
13
|
+
/db/*.sqlite3-*
|
14
|
+
|
15
|
+
# Ignore all logfiles and tempfiles.
|
16
|
+
/log/*
|
17
|
+
/tmp/*
|
18
|
+
!/log/.keep
|
19
|
+
!/tmp/.keep
|
20
|
+
|
21
|
+
# Ignore pidfiles, but keep the directory.
|
22
|
+
/tmp/pids/*
|
23
|
+
!/tmp/pids/
|
24
|
+
!/tmp/pids/.keep
|
25
|
+
|
26
|
+
# Ignore uploaded files in development.
|
27
|
+
/storage/*
|
28
|
+
!/storage/.keep
|
29
|
+
|
30
|
+
/public/assets
|
31
|
+
.byebug_history
|
32
|
+
|
33
|
+
# Ignore master key for decrypting credentials and more.
|
34
|
+
/config/master.key
|
35
|
+
|
36
|
+
/public/packs
|
37
|
+
/public/packs-test
|
38
|
+
/node_modules
|
39
|
+
/yarn-error.log
|
40
|
+
yarn-debug.log*
|
41
|
+
.yarn-integrity
|
@@ -0,0 +1 @@
|
|
1
|
+
2.7.1
|
@@ -0,0 +1,55 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
3
|
+
|
4
|
+
ruby '2.7.1'
|
5
|
+
|
6
|
+
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
|
7
|
+
gem 'rails', '~> 6.0.3', '>= 6.0.3.2'
|
8
|
+
# Use sqlite3 as the database for Active Record
|
9
|
+
gem 'sqlite3', '~> 1.4'
|
10
|
+
# Use Puma as the app server
|
11
|
+
gem 'puma', '~> 4.1'
|
12
|
+
# Use SCSS for stylesheets
|
13
|
+
gem 'sass-rails', '>= 6'
|
14
|
+
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
|
15
|
+
gem 'webpacker', '~> 4.0'
|
16
|
+
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
|
17
|
+
gem 'turbolinks', '~> 5'
|
18
|
+
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
|
19
|
+
gem 'jbuilder', '~> 2.7'
|
20
|
+
# Use Redis adapter to run Action Cable in production
|
21
|
+
# gem 'redis', '~> 4.0'
|
22
|
+
# Use Active Model has_secure_password
|
23
|
+
# gem 'bcrypt', '~> 3.1.7'
|
24
|
+
|
25
|
+
# Use Active Storage variant
|
26
|
+
# gem 'image_processing', '~> 1.2'
|
27
|
+
|
28
|
+
gem 'pry'
|
29
|
+
|
30
|
+
# Reduces boot times through caching; required in config/boot.rb
|
31
|
+
gem 'bootsnap', '>= 1.4.2', require: false
|
32
|
+
|
33
|
+
gem 'power_trace', path: '../../'
|
34
|
+
|
35
|
+
group :development, :test do
|
36
|
+
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
|
37
|
+
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
|
38
|
+
end
|
39
|
+
|
40
|
+
group :development do
|
41
|
+
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
|
42
|
+
gem 'web-console', '>= 3.3.0'
|
43
|
+
gem 'listen', '~> 3.2'
|
44
|
+
end
|
45
|
+
|
46
|
+
group :test do
|
47
|
+
# Adds support for Capybara system testing and selenium driver
|
48
|
+
gem 'capybara', '>= 2.15'
|
49
|
+
gem 'selenium-webdriver'
|
50
|
+
# Easy installation and use of web drivers to run system tests with browsers
|
51
|
+
gem 'webdrivers'
|
52
|
+
end
|
53
|
+
|
54
|
+
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
55
|
+
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|
@@ -0,0 +1,233 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../..
|
3
|
+
specs:
|
4
|
+
power_trace (0.2.2)
|
5
|
+
activesupport
|
6
|
+
binding_of_caller (~> 0.8.0)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
actioncable (6.0.3.2)
|
12
|
+
actionpack (= 6.0.3.2)
|
13
|
+
nio4r (~> 2.0)
|
14
|
+
websocket-driver (>= 0.6.1)
|
15
|
+
actionmailbox (6.0.3.2)
|
16
|
+
actionpack (= 6.0.3.2)
|
17
|
+
activejob (= 6.0.3.2)
|
18
|
+
activerecord (= 6.0.3.2)
|
19
|
+
activestorage (= 6.0.3.2)
|
20
|
+
activesupport (= 6.0.3.2)
|
21
|
+
mail (>= 2.7.1)
|
22
|
+
actionmailer (6.0.3.2)
|
23
|
+
actionpack (= 6.0.3.2)
|
24
|
+
actionview (= 6.0.3.2)
|
25
|
+
activejob (= 6.0.3.2)
|
26
|
+
mail (~> 2.5, >= 2.5.4)
|
27
|
+
rails-dom-testing (~> 2.0)
|
28
|
+
actionpack (6.0.3.2)
|
29
|
+
actionview (= 6.0.3.2)
|
30
|
+
activesupport (= 6.0.3.2)
|
31
|
+
rack (~> 2.0, >= 2.0.8)
|
32
|
+
rack-test (>= 0.6.3)
|
33
|
+
rails-dom-testing (~> 2.0)
|
34
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
35
|
+
actiontext (6.0.3.2)
|
36
|
+
actionpack (= 6.0.3.2)
|
37
|
+
activerecord (= 6.0.3.2)
|
38
|
+
activestorage (= 6.0.3.2)
|
39
|
+
activesupport (= 6.0.3.2)
|
40
|
+
nokogiri (>= 1.8.5)
|
41
|
+
actionview (6.0.3.2)
|
42
|
+
activesupport (= 6.0.3.2)
|
43
|
+
builder (~> 3.1)
|
44
|
+
erubi (~> 1.4)
|
45
|
+
rails-dom-testing (~> 2.0)
|
46
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
47
|
+
activejob (6.0.3.2)
|
48
|
+
activesupport (= 6.0.3.2)
|
49
|
+
globalid (>= 0.3.6)
|
50
|
+
activemodel (6.0.3.2)
|
51
|
+
activesupport (= 6.0.3.2)
|
52
|
+
activerecord (6.0.3.2)
|
53
|
+
activemodel (= 6.0.3.2)
|
54
|
+
activesupport (= 6.0.3.2)
|
55
|
+
activestorage (6.0.3.2)
|
56
|
+
actionpack (= 6.0.3.2)
|
57
|
+
activejob (= 6.0.3.2)
|
58
|
+
activerecord (= 6.0.3.2)
|
59
|
+
marcel (~> 0.3.1)
|
60
|
+
activesupport (6.0.3.2)
|
61
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
62
|
+
i18n (>= 0.7, < 2)
|
63
|
+
minitest (~> 5.1)
|
64
|
+
tzinfo (~> 1.1)
|
65
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
66
|
+
addressable (2.7.0)
|
67
|
+
public_suffix (>= 2.0.2, < 5.0)
|
68
|
+
bindex (0.8.1)
|
69
|
+
binding_of_caller (0.8.0)
|
70
|
+
debug_inspector (>= 0.0.1)
|
71
|
+
bootsnap (1.4.8)
|
72
|
+
msgpack (~> 1.0)
|
73
|
+
builder (3.2.4)
|
74
|
+
byebug (11.1.3)
|
75
|
+
capybara (3.33.0)
|
76
|
+
addressable
|
77
|
+
mini_mime (>= 0.1.3)
|
78
|
+
nokogiri (~> 1.8)
|
79
|
+
rack (>= 1.6.0)
|
80
|
+
rack-test (>= 0.6.3)
|
81
|
+
regexp_parser (~> 1.5)
|
82
|
+
xpath (~> 3.2)
|
83
|
+
childprocess (3.0.0)
|
84
|
+
coderay (1.1.3)
|
85
|
+
concurrent-ruby (1.1.7)
|
86
|
+
crass (1.0.6)
|
87
|
+
debug_inspector (0.0.3)
|
88
|
+
erubi (1.9.0)
|
89
|
+
ffi (1.13.1)
|
90
|
+
globalid (0.4.2)
|
91
|
+
activesupport (>= 4.2.0)
|
92
|
+
i18n (1.8.5)
|
93
|
+
concurrent-ruby (~> 1.0)
|
94
|
+
jbuilder (2.10.0)
|
95
|
+
activesupport (>= 5.0.0)
|
96
|
+
listen (3.2.1)
|
97
|
+
rb-fsevent (~> 0.10, >= 0.10.3)
|
98
|
+
rb-inotify (~> 0.9, >= 0.9.10)
|
99
|
+
loofah (2.7.0)
|
100
|
+
crass (~> 1.0.2)
|
101
|
+
nokogiri (>= 1.5.9)
|
102
|
+
mail (2.7.1)
|
103
|
+
mini_mime (>= 0.1.1)
|
104
|
+
marcel (0.3.3)
|
105
|
+
mimemagic (~> 0.3.2)
|
106
|
+
method_source (1.0.0)
|
107
|
+
mimemagic (0.3.5)
|
108
|
+
mini_mime (1.0.2)
|
109
|
+
mini_portile2 (2.4.0)
|
110
|
+
minitest (5.14.1)
|
111
|
+
msgpack (1.3.3)
|
112
|
+
nio4r (2.5.2)
|
113
|
+
nokogiri (1.10.10)
|
114
|
+
mini_portile2 (~> 2.4.0)
|
115
|
+
pry (0.13.1)
|
116
|
+
coderay (~> 1.1)
|
117
|
+
method_source (~> 1.0)
|
118
|
+
public_suffix (4.0.5)
|
119
|
+
puma (4.3.5)
|
120
|
+
nio4r (~> 2.0)
|
121
|
+
rack (2.2.3)
|
122
|
+
rack-proxy (0.6.5)
|
123
|
+
rack
|
124
|
+
rack-test (1.1.0)
|
125
|
+
rack (>= 1.0, < 3)
|
126
|
+
rails (6.0.3.2)
|
127
|
+
actioncable (= 6.0.3.2)
|
128
|
+
actionmailbox (= 6.0.3.2)
|
129
|
+
actionmailer (= 6.0.3.2)
|
130
|
+
actionpack (= 6.0.3.2)
|
131
|
+
actiontext (= 6.0.3.2)
|
132
|
+
actionview (= 6.0.3.2)
|
133
|
+
activejob (= 6.0.3.2)
|
134
|
+
activemodel (= 6.0.3.2)
|
135
|
+
activerecord (= 6.0.3.2)
|
136
|
+
activestorage (= 6.0.3.2)
|
137
|
+
activesupport (= 6.0.3.2)
|
138
|
+
bundler (>= 1.3.0)
|
139
|
+
railties (= 6.0.3.2)
|
140
|
+
sprockets-rails (>= 2.0.0)
|
141
|
+
rails-dom-testing (2.0.3)
|
142
|
+
activesupport (>= 4.2.0)
|
143
|
+
nokogiri (>= 1.6)
|
144
|
+
rails-html-sanitizer (1.3.0)
|
145
|
+
loofah (~> 2.3)
|
146
|
+
railties (6.0.3.2)
|
147
|
+
actionpack (= 6.0.3.2)
|
148
|
+
activesupport (= 6.0.3.2)
|
149
|
+
method_source
|
150
|
+
rake (>= 0.8.7)
|
151
|
+
thor (>= 0.20.3, < 2.0)
|
152
|
+
rake (13.0.1)
|
153
|
+
rb-fsevent (0.10.4)
|
154
|
+
rb-inotify (0.10.1)
|
155
|
+
ffi (~> 1.0)
|
156
|
+
regexp_parser (1.7.1)
|
157
|
+
rubyzip (2.3.0)
|
158
|
+
sass-rails (6.0.0)
|
159
|
+
sassc-rails (~> 2.1, >= 2.1.1)
|
160
|
+
sassc (2.4.0)
|
161
|
+
ffi (~> 1.9)
|
162
|
+
sassc-rails (2.1.2)
|
163
|
+
railties (>= 4.0.0)
|
164
|
+
sassc (>= 2.0)
|
165
|
+
sprockets (> 3.0)
|
166
|
+
sprockets-rails
|
167
|
+
tilt
|
168
|
+
selenium-webdriver (3.142.7)
|
169
|
+
childprocess (>= 0.5, < 4.0)
|
170
|
+
rubyzip (>= 1.2.2)
|
171
|
+
sprockets (4.0.2)
|
172
|
+
concurrent-ruby (~> 1.0)
|
173
|
+
rack (> 1, < 3)
|
174
|
+
sprockets-rails (3.2.1)
|
175
|
+
actionpack (>= 4.0)
|
176
|
+
activesupport (>= 4.0)
|
177
|
+
sprockets (>= 3.0.0)
|
178
|
+
sqlite3 (1.4.2)
|
179
|
+
thor (1.0.1)
|
180
|
+
thread_safe (0.3.6)
|
181
|
+
tilt (2.0.10)
|
182
|
+
turbolinks (5.2.1)
|
183
|
+
turbolinks-source (~> 5.2)
|
184
|
+
turbolinks-source (5.2.0)
|
185
|
+
tzinfo (1.2.7)
|
186
|
+
thread_safe (~> 0.1)
|
187
|
+
web-console (4.0.4)
|
188
|
+
actionview (>= 6.0.0)
|
189
|
+
activemodel (>= 6.0.0)
|
190
|
+
bindex (>= 0.4.0)
|
191
|
+
railties (>= 6.0.0)
|
192
|
+
webdrivers (4.4.1)
|
193
|
+
nokogiri (~> 1.6)
|
194
|
+
rubyzip (>= 1.3.0)
|
195
|
+
selenium-webdriver (>= 3.0, < 4.0)
|
196
|
+
webpacker (4.3.0)
|
197
|
+
activesupport (>= 4.2)
|
198
|
+
rack-proxy (>= 0.6.1)
|
199
|
+
railties (>= 4.2)
|
200
|
+
websocket-driver (0.7.3)
|
201
|
+
websocket-extensions (>= 0.1.0)
|
202
|
+
websocket-extensions (0.1.5)
|
203
|
+
xpath (3.2.0)
|
204
|
+
nokogiri (~> 1.8)
|
205
|
+
zeitwerk (2.4.0)
|
206
|
+
|
207
|
+
PLATFORMS
|
208
|
+
ruby
|
209
|
+
|
210
|
+
DEPENDENCIES
|
211
|
+
bootsnap (>= 1.4.2)
|
212
|
+
byebug
|
213
|
+
capybara (>= 2.15)
|
214
|
+
jbuilder (~> 2.7)
|
215
|
+
listen (~> 3.2)
|
216
|
+
power_trace!
|
217
|
+
pry
|
218
|
+
puma (~> 4.1)
|
219
|
+
rails (~> 6.0.3, >= 6.0.3.2)
|
220
|
+
sass-rails (>= 6)
|
221
|
+
selenium-webdriver
|
222
|
+
sqlite3 (~> 1.4)
|
223
|
+
turbolinks (~> 5)
|
224
|
+
tzinfo-data
|
225
|
+
web-console (>= 3.3.0)
|
226
|
+
webdrivers
|
227
|
+
webpacker (~> 4.0)
|
228
|
+
|
229
|
+
RUBY VERSION
|
230
|
+
ruby 2.7.1p83
|
231
|
+
|
232
|
+
BUNDLED WITH
|
233
|
+
2.1.4
|