whoopsie 0.0.2

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 (58) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +144 -0
  4. data/Rakefile +29 -0
  5. data/app/assets/javascripts/whoopsie.js +2 -0
  6. data/app/assets/javascripts/whoopsie/tracekit-config.js +49 -0
  7. data/app/assets/javascripts/whoopsie/tracekit.js +1166 -0
  8. data/app/controllers/whoopsie/application_controller.rb +4 -0
  9. data/app/controllers/whoopsie/errors_controller.rb +50 -0
  10. data/app/helpers/whoopsie/whoopsie_helper.rb +18 -0
  11. data/config/routes.rb +5 -0
  12. data/lib/whoopsie.rb +20 -0
  13. data/lib/whoopsie/engine.rb +9 -0
  14. data/lib/whoopsie/railtie.rb +39 -0
  15. data/lib/whoopsie/version.rb +3 -0
  16. data/spec/controllers/whoopsie/errors_controller_spec.rb +71 -0
  17. data/spec/dummy/README.rdoc +28 -0
  18. data/spec/dummy/Rakefile +6 -0
  19. data/spec/dummy/app/assets/javascripts/application.js +3 -0
  20. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  21. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  22. data/spec/dummy/app/controllers/welcome_controller.rb +4 -0
  23. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  24. data/spec/dummy/app/views/layouts/application.html.erb +17 -0
  25. data/spec/dummy/app/views/welcome/show.html.erb +3 -0
  26. data/spec/dummy/bin/bundle +3 -0
  27. data/spec/dummy/bin/rails +4 -0
  28. data/spec/dummy/bin/rake +4 -0
  29. data/spec/dummy/bin/setup +29 -0
  30. data/spec/dummy/config.ru +4 -0
  31. data/spec/dummy/config/application.rb +38 -0
  32. data/spec/dummy/config/boot.rb +5 -0
  33. data/spec/dummy/config/database.yml +22 -0
  34. data/spec/dummy/config/environment.rb +5 -0
  35. data/spec/dummy/config/environments/development.rb +38 -0
  36. data/spec/dummy/config/environments/production.rb +76 -0
  37. data/spec/dummy/config/environments/test.rb +42 -0
  38. data/spec/dummy/config/initializers/assets.rb +11 -0
  39. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  40. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  41. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  42. data/spec/dummy/config/initializers/inflections.rb +16 -0
  43. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  44. data/spec/dummy/config/initializers/session_store.rb +3 -0
  45. data/spec/dummy/config/initializers/wrap_parameters.rb +9 -0
  46. data/spec/dummy/config/locales/en.yml +23 -0
  47. data/spec/dummy/config/routes.rb +3 -0
  48. data/spec/dummy/config/secrets.yml +22 -0
  49. data/spec/dummy/db/test.sqlite3 +0 -0
  50. data/spec/dummy/public/404.html +67 -0
  51. data/spec/dummy/public/422.html +67 -0
  52. data/spec/dummy/public/500.html +66 -0
  53. data/spec/dummy/public/favicon.ico +0 -0
  54. data/spec/examples.txt +11 -0
  55. data/spec/lib/whoopsie_spec.rb +41 -0
  56. data/spec/rails_helper.rb +57 -0
  57. data/spec/spec_helper.rb +92 -0
  58. metadata +262 -0
File without changes
@@ -0,0 +1,11 @@
1
+ example_id | status | run_time |
2
+ ---------------------------------------------------------------- | ------ | --------------- |
3
+ ./spec/controllers/whoopsie/errors_controller_spec.rb[1:1:1] | passed | 0.01333 seconds |
4
+ ./spec/controllers/whoopsie/errors_controller_spec.rb[1:2:1] | passed | 0.00326 seconds |
5
+ ./spec/controllers/whoopsie/errors_controller_spec.rb[1:3:1:1:1] | passed | 0.19626 seconds |
6
+ ./spec/controllers/whoopsie/errors_controller_spec.rb[1:3:1:1:2] | passed | 0.00867 seconds |
7
+ ./spec/controllers/whoopsie/errors_controller_spec.rb[1:3:1:2:1] | passed | 0.00177 seconds |
8
+ ./spec/controllers/whoopsie/errors_controller_spec.rb[1:3:2:1] | passed | 0.00187 seconds |
9
+ ./spec/lib/whoopsie_spec.rb[1:1:1] | passed | 0.00069 seconds |
10
+ ./spec/lib/whoopsie_spec.rb[1:1:2:1] | passed | 0.01398 seconds |
11
+ ./spec/lib/whoopsie_spec.rb[1:1:3:1] | passed | 0.00095 seconds |
@@ -0,0 +1,41 @@
1
+ require 'rails_helper'
2
+
3
+ RSpec.describe Whoopsie, type: :module do
4
+ context '#report_and_swallow' do
5
+ it "calls 'handle_exception' for raised exceptions" do
6
+ expect(Whoopsie).to receive(:handle_exception)
7
+ Whoopsie.report_and_swallow do
8
+ X = 10 / 0
9
+ end
10
+ end
11
+
12
+ context 'when Whoopsie is enabled' do
13
+ before do
14
+ Rails.application.config.whoopsie.enable = true
15
+ end
16
+
17
+ it 'swallows the exception' do
18
+ expect do
19
+ Whoopsie.report_and_swallow do
20
+ X = 10 / 0
21
+ end
22
+ end.to_not raise_error
23
+ end
24
+ end
25
+
26
+ context 'when Whoopsie is disabled' do
27
+ before do
28
+ Rails.application.config.whoopsie.enable = false
29
+ end
30
+
31
+ it 'raises the exception' do
32
+ expect do
33
+ Whoopsie.report_and_swallow do
34
+ X = 10 / 0
35
+ end
36
+ end.to raise_error(ZeroDivisionError)
37
+ end
38
+ end
39
+
40
+ end
41
+ end
@@ -0,0 +1,57 @@
1
+ # This file is copied to spec/ when you run 'rails generate rspec:install'
2
+ ENV['RAILS_ENV'] ||= 'test'
3
+ require File.expand_path('../dummy/config/environment.rb', __FILE__)
4
+ # Prevent database truncation if the environment is production
5
+ abort('The Rails environment is running in production mode!') if Rails.env.production?
6
+ require 'spec_helper'
7
+ require 'rspec/rails'
8
+ # Add additional requires below this line. Rails is not loaded until this point!
9
+
10
+ # Requires supporting ruby files with custom matchers and macros, etc, in
11
+ # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
12
+ # run as spec files by default. This means that files in spec/support that end
13
+ # in _spec.rb will both be required and run as specs, causing the specs to be
14
+ # run twice. It is recommended that you do not name files matching this glob to
15
+ # end with _spec.rb. You can configure this pattern with the --pattern
16
+ # option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
17
+ #
18
+ # The following line is provided for convenience purposes. It has the downside
19
+ # of increasing the boot-up time by auto-requiring all files in the support
20
+ # directory. Alternatively, in the individual `*_spec.rb` files, manually
21
+ # require only the support files necessary.
22
+ #
23
+ # Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
24
+
25
+ # Checks for pending migration and applies them before tests are run.
26
+ # If you are not using ActiveRecord, you can remove this line.
27
+ ActiveRecord::Migration.maintain_test_schema!
28
+
29
+ RSpec.configure do |config|
30
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
31
+ config.fixture_path = "#{::Rails.root}/spec/fixtures"
32
+
33
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
34
+ # examples within a transaction, remove the following line or assign false
35
+ # instead of true.
36
+ config.use_transactional_fixtures = true
37
+
38
+ # RSpec Rails can automatically mix in different behaviours to your tests
39
+ # based on their file location, for example enabling you to call `get` and
40
+ # `post` in specs under `spec/controllers`.
41
+ #
42
+ # You can disable this behaviour by removing the line below, and instead
43
+ # explicitly tag your specs with their type, e.g.:
44
+ #
45
+ # RSpec.describe UsersController, :type => :controller do
46
+ # # ...
47
+ # end
48
+ #
49
+ # The different available types are documented in the features, such as in
50
+ # https://relishapp.com/rspec/rspec-rails/docs
51
+ config.infer_spec_type_from_file_location!
52
+
53
+ # Filter lines from Rails gems in backtraces.
54
+ config.filter_rails_from_backtrace!
55
+ # arbitrary gems may also be filtered via:
56
+ # config.filter_gems_from_backtrace("gem name")
57
+ end
@@ -0,0 +1,92 @@
1
+ if ENV['COVERAGE']
2
+ require 'simplecov'
3
+
4
+ SimpleCov.start do
5
+ add_filter '/bin'
6
+ add_filter '/stubs'
7
+ add_filter '/tmp'
8
+ add_filter '/vendor'
9
+ add_filter '/spec'
10
+
11
+ add_group 'Modules', 'module'
12
+ add_group 'Libraries', 'lib'
13
+ end
14
+ end
15
+
16
+ require 'pry-nav'
17
+ require 'whoopsie'
18
+
19
+ RSpec.configure do |config|
20
+ # rspec-expectations config goes here. You can use an alternate
21
+ # assertion/expectation library such as wrong or the stdlib/minitest
22
+ # assertions if you prefer.
23
+ config.expect_with :rspec do |expectations|
24
+ # This option will default to `true` in RSpec 4. It makes the `description`
25
+ # and `failure_message` of custom matchers include text for helper methods
26
+ # defined using `chain`, e.g.:
27
+ # be_bigger_than(2).and_smaller_than(4).description
28
+ # # => "be bigger than 2 and smaller than 4"
29
+ # ...rather than:
30
+ # # => "be bigger than 2"
31
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
32
+ end
33
+
34
+ # rspec-mocks config goes here. You can use an alternate test double
35
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
36
+ config.mock_with :rspec do |mocks|
37
+ # Prevents you from mocking or stubbing a method that does not exist on
38
+ # a real object. This is generally recommended, and will default to
39
+ # `true` in RSpec 4.
40
+ mocks.verify_partial_doubles = true
41
+ end
42
+
43
+ # These two settings work together to allow you to limit a spec run
44
+ # to individual examples or groups you care about by tagging them with
45
+ # `:focus` metadata. When nothing is tagged with `:focus`, all examples
46
+ # get run.
47
+ config.filter_run :focus
48
+ config.run_all_when_everything_filtered = true
49
+
50
+ # Allows RSpec to persist some state between runs in order to support
51
+ # the `--only-failures` and `--next-failure` CLI options. We recommend
52
+ # you configure your source control system to ignore this file.
53
+ config.example_status_persistence_file_path = 'spec/examples.txt'
54
+
55
+ # Limits the available syntax to the non-monkey patched syntax that is
56
+ # recommended. For more details, see:
57
+ # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
58
+ # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
59
+ # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
60
+ config.disable_monkey_patching!
61
+
62
+ # This setting enables warnings. It's recommended, but in some cases may
63
+ # be too noisy due to issues in dependencies.
64
+ config.warnings = true
65
+
66
+ # Many RSpec users commonly either run the entire suite or an individual
67
+ # file, and it's useful to allow more verbose output when running an
68
+ # individual spec file.
69
+ if config.files_to_run.one?
70
+ # Use the documentation formatter for detailed output,
71
+ # unless a formatter has already been configured
72
+ # (e.g. via a command-line flag).
73
+ config.default_formatter = 'doc'
74
+ end
75
+
76
+ # Print the 10 slowest examples and example groups at the
77
+ # end of the spec run, to help surface which specs are running
78
+ # particularly slow.
79
+ config.profile_examples = 3
80
+
81
+ # Run specs in random order to surface order dependencies. If you find an
82
+ # order dependency and want to debug it, you can fix the order by providing
83
+ # the seed, which is printed after each run.
84
+ # --seed 1234
85
+ config.order = :random
86
+
87
+ # Seed global randomization in this process using the `--seed` CLI option.
88
+ # Setting this allows you to use `--seed` to deterministically reproduce
89
+ # test failures related to randomization by passing the same `--seed` value
90
+ # as the one that triggered the failure.
91
+ Kernel.srand config.seed
92
+ end
metadata ADDED
@@ -0,0 +1,262 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: whoopsie
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Wojtek Kruszewski
8
+ - Chris Blackburn
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2016-06-15 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: 4.2.3
21
+ - - "<="
22
+ - !ruby/object:Gem::Version
23
+ version: 5.0.0
24
+ type: :runtime
25
+ prerelease: false
26
+ version_requirements: !ruby/object:Gem::Requirement
27
+ requirements:
28
+ - - ">="
29
+ - !ruby/object:Gem::Version
30
+ version: 4.2.3
31
+ - - "<="
32
+ - !ruby/object:Gem::Version
33
+ version: 5.0.0
34
+ - !ruby/object:Gem::Dependency
35
+ name: sqlite3
36
+ requirement: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 1.3.4
41
+ type: :development
42
+ prerelease: false
43
+ version_requirements: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 1.3.4
48
+ - !ruby/object:Gem::Dependency
49
+ name: jquery-rails
50
+ requirement: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 4.0.3
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 4.0.3
62
+ - !ruby/object:Gem::Dependency
63
+ name: rspec-rails
64
+ requirement: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 3.4.2
69
+ type: :development
70
+ prerelease: false
71
+ version_requirements: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 3.4.2
76
+ - !ruby/object:Gem::Dependency
77
+ name: simplecov
78
+ requirement: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.11'
83
+ type: :development
84
+ prerelease: false
85
+ version_requirements: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '0.11'
90
+ - !ruby/object:Gem::Dependency
91
+ name: pry-nav
92
+ requirement: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 0.2.4
97
+ type: :development
98
+ prerelease: false
99
+ version_requirements: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 0.2.4
104
+ - !ruby/object:Gem::Dependency
105
+ name: letter_opener
106
+ requirement: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 1.4.1
111
+ type: :development
112
+ prerelease: false
113
+ version_requirements: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 1.4.1
118
+ - !ruby/object:Gem::Dependency
119
+ name: midwire_common
120
+ requirement: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ type: :development
126
+ prerelease: false
127
+ version_requirements: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ description: Error notifications for Rails and for JavaScript errors
133
+ email:
134
+ - wojtek@oxos.pl
135
+ - 87a1779b@opayq.com
136
+ executables: []
137
+ extensions: []
138
+ extra_rdoc_files: []
139
+ files:
140
+ - MIT-LICENSE
141
+ - README.md
142
+ - Rakefile
143
+ - app/assets/javascripts/whoopsie.js
144
+ - app/assets/javascripts/whoopsie/tracekit-config.js
145
+ - app/assets/javascripts/whoopsie/tracekit.js
146
+ - app/controllers/whoopsie/application_controller.rb
147
+ - app/controllers/whoopsie/errors_controller.rb
148
+ - app/helpers/whoopsie/whoopsie_helper.rb
149
+ - config/routes.rb
150
+ - lib/whoopsie.rb
151
+ - lib/whoopsie/engine.rb
152
+ - lib/whoopsie/railtie.rb
153
+ - lib/whoopsie/version.rb
154
+ - spec/controllers/whoopsie/errors_controller_spec.rb
155
+ - spec/dummy/README.rdoc
156
+ - spec/dummy/Rakefile
157
+ - spec/dummy/app/assets/javascripts/application.js
158
+ - spec/dummy/app/assets/stylesheets/application.css
159
+ - spec/dummy/app/controllers/application_controller.rb
160
+ - spec/dummy/app/controllers/welcome_controller.rb
161
+ - spec/dummy/app/helpers/application_helper.rb
162
+ - spec/dummy/app/views/layouts/application.html.erb
163
+ - spec/dummy/app/views/welcome/show.html.erb
164
+ - spec/dummy/bin/bundle
165
+ - spec/dummy/bin/rails
166
+ - spec/dummy/bin/rake
167
+ - spec/dummy/bin/setup
168
+ - spec/dummy/config.ru
169
+ - spec/dummy/config/application.rb
170
+ - spec/dummy/config/boot.rb
171
+ - spec/dummy/config/database.yml
172
+ - spec/dummy/config/environment.rb
173
+ - spec/dummy/config/environments/development.rb
174
+ - spec/dummy/config/environments/production.rb
175
+ - spec/dummy/config/environments/test.rb
176
+ - spec/dummy/config/initializers/assets.rb
177
+ - spec/dummy/config/initializers/backtrace_silencers.rb
178
+ - spec/dummy/config/initializers/cookies_serializer.rb
179
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
180
+ - spec/dummy/config/initializers/inflections.rb
181
+ - spec/dummy/config/initializers/mime_types.rb
182
+ - spec/dummy/config/initializers/session_store.rb
183
+ - spec/dummy/config/initializers/wrap_parameters.rb
184
+ - spec/dummy/config/locales/en.yml
185
+ - spec/dummy/config/routes.rb
186
+ - spec/dummy/config/secrets.yml
187
+ - spec/dummy/db/test.sqlite3
188
+ - spec/dummy/public/404.html
189
+ - spec/dummy/public/422.html
190
+ - spec/dummy/public/500.html
191
+ - spec/dummy/public/favicon.ico
192
+ - spec/examples.txt
193
+ - spec/lib/whoopsie_spec.rb
194
+ - spec/rails_helper.rb
195
+ - spec/spec_helper.rb
196
+ homepage: https://github.com/midwire/whoopsie
197
+ licenses:
198
+ - MIT
199
+ metadata: {}
200
+ post_install_message:
201
+ rdoc_options: []
202
+ require_paths:
203
+ - lib
204
+ required_ruby_version: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - ">="
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
209
+ required_rubygems_version: !ruby/object:Gem::Requirement
210
+ requirements:
211
+ - - ">="
212
+ - !ruby/object:Gem::Version
213
+ version: '0'
214
+ requirements: []
215
+ rubyforge_project:
216
+ rubygems_version: 2.5.1
217
+ signing_key:
218
+ specification_version: 4
219
+ summary: Back-end and front-end error notifications
220
+ test_files:
221
+ - spec/controllers/whoopsie/errors_controller_spec.rb
222
+ - spec/dummy/app/assets/javascripts/application.js
223
+ - spec/dummy/app/assets/stylesheets/application.css
224
+ - spec/dummy/app/controllers/application_controller.rb
225
+ - spec/dummy/app/controllers/welcome_controller.rb
226
+ - spec/dummy/app/helpers/application_helper.rb
227
+ - spec/dummy/app/views/layouts/application.html.erb
228
+ - spec/dummy/app/views/welcome/show.html.erb
229
+ - spec/dummy/bin/bundle
230
+ - spec/dummy/bin/rails
231
+ - spec/dummy/bin/rake
232
+ - spec/dummy/bin/setup
233
+ - spec/dummy/config/application.rb
234
+ - spec/dummy/config/boot.rb
235
+ - spec/dummy/config/database.yml
236
+ - spec/dummy/config/environment.rb
237
+ - spec/dummy/config/environments/development.rb
238
+ - spec/dummy/config/environments/production.rb
239
+ - spec/dummy/config/environments/test.rb
240
+ - spec/dummy/config/initializers/assets.rb
241
+ - spec/dummy/config/initializers/backtrace_silencers.rb
242
+ - spec/dummy/config/initializers/cookies_serializer.rb
243
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
244
+ - spec/dummy/config/initializers/inflections.rb
245
+ - spec/dummy/config/initializers/mime_types.rb
246
+ - spec/dummy/config/initializers/session_store.rb
247
+ - spec/dummy/config/initializers/wrap_parameters.rb
248
+ - spec/dummy/config/locales/en.yml
249
+ - spec/dummy/config/routes.rb
250
+ - spec/dummy/config/secrets.yml
251
+ - spec/dummy/config.ru
252
+ - spec/dummy/db/test.sqlite3
253
+ - spec/dummy/public/404.html
254
+ - spec/dummy/public/422.html
255
+ - spec/dummy/public/500.html
256
+ - spec/dummy/public/favicon.ico
257
+ - spec/dummy/Rakefile
258
+ - spec/dummy/README.rdoc
259
+ - spec/examples.txt
260
+ - spec/lib/whoopsie_spec.rb
261
+ - spec/rails_helper.rb
262
+ - spec/spec_helper.rb