raygun4ruby 3.2.3 → 3.2.4

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 (94) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +18 -18
  3. data/.rspec +1 -1
  4. data/.travis.yml +20 -20
  5. data/CHANGELOG.md +127 -124
  6. data/Gemfile +4 -4
  7. data/LICENSE.txt +22 -22
  8. data/README.md +420 -420
  9. data/Rakefile +27 -27
  10. data/examples/sinatras_raygun.rb +17 -17
  11. data/lib/generators/raygun/install_generator.rb +26 -26
  12. data/lib/raygun.rb +179 -179
  13. data/lib/raygun/affected_user.rb +59 -59
  14. data/lib/raygun/breadcrumbs.rb +34 -34
  15. data/lib/raygun/breadcrumbs/breadcrumb.rb +34 -34
  16. data/lib/raygun/breadcrumbs/store.rb +86 -86
  17. data/lib/raygun/client.rb +305 -305
  18. data/lib/raygun/configuration.rb +194 -194
  19. data/lib/raygun/error.rb +10 -10
  20. data/lib/raygun/javascript_tracker.rb +42 -42
  21. data/lib/raygun/middleware/breadcrumbs_store_initializer.rb +19 -19
  22. data/lib/raygun/middleware/javascript_exception_tracking.rb +32 -32
  23. data/lib/raygun/middleware/rack_exception_interceptor.rb +18 -18
  24. data/lib/raygun/middleware/rails_insert_affected_user.rb +26 -26
  25. data/lib/raygun/railtie.rb +39 -39
  26. data/lib/raygun/services/apply_whitelist_filter_to_payload.rb +27 -27
  27. data/lib/raygun/sidekiq.rb +71 -70
  28. data/lib/raygun/testable.rb +22 -22
  29. data/lib/raygun/version.rb +3 -3
  30. data/lib/raygun4ruby.rb +1 -1
  31. data/lib/resque/failure/raygun.rb +25 -25
  32. data/lib/tasks/raygun.tasks +7 -7
  33. data/raygun4ruby.gemspec +45 -45
  34. data/spec/dummy/.gitignore +17 -17
  35. data/spec/dummy/Gemfile +47 -47
  36. data/spec/dummy/README.rdoc +28 -28
  37. data/spec/dummy/Rakefile +6 -6
  38. data/spec/dummy/app/assets/config/manifest.js +2 -2
  39. data/spec/dummy/app/assets/javascripts/application.js +13 -13
  40. data/spec/dummy/app/assets/stylesheets/application.css +15 -15
  41. data/spec/dummy/app/controllers/application_controller.rb +5 -5
  42. data/spec/dummy/app/controllers/home_controller.rb +4 -4
  43. data/spec/dummy/app/helpers/application_helper.rb +2 -2
  44. data/spec/dummy/app/views/home/index.html.erb +3 -3
  45. data/spec/dummy/app/views/home/index.json.erb +1 -1
  46. data/spec/dummy/app/views/layouts/application.html.erb +14 -14
  47. data/spec/dummy/bin/bundle +3 -3
  48. data/spec/dummy/bin/rails +9 -9
  49. data/spec/dummy/bin/rake +9 -9
  50. data/spec/dummy/bin/setup +29 -29
  51. data/spec/dummy/bin/spring +17 -17
  52. data/spec/dummy/config.ru +4 -4
  53. data/spec/dummy/config/application.rb +26 -26
  54. data/spec/dummy/config/boot.rb +3 -3
  55. data/spec/dummy/config/database.yml +25 -25
  56. data/spec/dummy/config/environment.rb +5 -5
  57. data/spec/dummy/config/environments/development.rb +41 -41
  58. data/spec/dummy/config/environments/production.rb +79 -79
  59. data/spec/dummy/config/environments/test.rb +42 -42
  60. data/spec/dummy/config/initializers/assets.rb +11 -11
  61. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -7
  62. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -3
  63. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -4
  64. data/spec/dummy/config/initializers/inflections.rb +16 -16
  65. data/spec/dummy/config/initializers/mime_types.rb +4 -4
  66. data/spec/dummy/config/initializers/session_store.rb +3 -3
  67. data/spec/dummy/config/initializers/to_time_preserves_timezone.rb +10 -10
  68. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -14
  69. data/spec/dummy/config/locales/en.yml +23 -23
  70. data/spec/dummy/config/routes.rb +58 -58
  71. data/spec/dummy/config/secrets.yml +22 -22
  72. data/spec/dummy/db/seeds.rb +7 -7
  73. data/spec/dummy/public/404.html +67 -67
  74. data/spec/dummy/public/422.html +67 -67
  75. data/spec/dummy/public/500.html +66 -66
  76. data/spec/dummy/public/robots.txt +5 -5
  77. data/spec/dummy/test/test_helper.rb +10 -10
  78. data/spec/features/javascript_spec.rb +48 -48
  79. data/spec/rails_helper.rb +4 -4
  80. data/spec/raygun/breadcrumbs/breadcrumb_spec.rb +171 -171
  81. data/spec/raygun/breadcrumbs/store_spec.rb +170 -170
  82. data/spec/raygun/raygun_spec.rb +47 -47
  83. data/spec/services/apply_whitelist_filter_to_payload_spec.rb +251 -251
  84. data/spec/spec_helper.rb +24 -24
  85. data/spec/support/fake_logger.rb +17 -17
  86. data/test/integration/client_test.rb +19 -19
  87. data/test/test_helper.rb +72 -72
  88. data/test/unit/affected_user_test.rb +136 -136
  89. data/test/unit/client_test.rb +792 -792
  90. data/test/unit/configuration_test.rb +206 -206
  91. data/test/unit/raygun_test.rb +25 -25
  92. data/test/unit/resque_failure_test.rb +24 -24
  93. data/test/unit/sidekiq_failure_test.rb +32 -32
  94. metadata +7 -7
@@ -1,23 +1,23 @@
1
- module Raygun
2
-
3
- class ItWorksException < StandardError; end
4
-
5
- module Testable
6
-
7
- def track_test_exception
8
- Raygun.configuration.silence_reporting = false
9
- raise ItWorksException.new("Woohoo! Your Raygun<->Ruby connection is set up correctly")
10
- rescue ItWorksException => e
11
- response = Raygun.track_exception(e)
12
-
13
- if response.success?
14
- puts "Success! Now go check your Raygun.io Dashboard"
15
- else
16
- puts "Oh-oh, something went wrong - double check your API key"
17
- puts "API Key - " << Raygun.configuration.api_key << ")"
18
- puts "API Response - " << response
19
- end
20
- end
21
-
22
- end
1
+ module Raygun
2
+
3
+ class ItWorksException < StandardError; end
4
+
5
+ module Testable
6
+
7
+ def track_test_exception
8
+ Raygun.configuration.silence_reporting = false
9
+ raise ItWorksException.new("Woohoo! Your Raygun<->Ruby connection is set up correctly")
10
+ rescue ItWorksException => e
11
+ response = Raygun.track_exception(e)
12
+
13
+ if response.success?
14
+ puts "Success! Now go check your Raygun Dashboard"
15
+ else
16
+ puts "Oh-oh, something went wrong - double check your API key"
17
+ puts "API Key - " << Raygun.configuration.api_key << ")"
18
+ puts "API Response - " << response
19
+ end
20
+ end
21
+
22
+ end
23
23
  end
@@ -1,3 +1,3 @@
1
- module Raygun
2
- VERSION = "3.2.3"
3
- end
1
+ module Raygun
2
+ VERSION = "3.2.4"
3
+ end
data/lib/raygun4ruby.rb CHANGED
@@ -1 +1 @@
1
- require "raygun"
1
+ require "raygun"
@@ -1,26 +1,26 @@
1
- begin
2
- require 'resque'
3
- rescue LoadError
4
- raise "Can't find 'resque' gem. You'll need to require it before you require the Raygun Failure handler"
5
- end
6
-
7
- module Resque
8
- module Failure
9
- class Raygun < Base
10
-
11
- def save
12
- ::Raygun.track_exception(exception,
13
- custom_data: {
14
- resque: {
15
- worker: worker.to_s,
16
- queue: queue.to_s,
17
- job: payload['class'].to_s,
18
- args: payload['args'].inspect
19
- }
20
- }
21
- )
22
- end
23
-
24
- end
25
- end
1
+ begin
2
+ require 'resque'
3
+ rescue LoadError
4
+ raise "Can't find 'resque' gem. You'll need to require it before you require the Raygun Failure handler"
5
+ end
6
+
7
+ module Resque
8
+ module Failure
9
+ class Raygun < Base
10
+
11
+ def save
12
+ ::Raygun.track_exception(exception,
13
+ custom_data: {
14
+ resque: {
15
+ worker: worker.to_s,
16
+ queue: queue.to_s,
17
+ job: payload['class'].to_s,
18
+ args: payload['args'].inspect
19
+ }
20
+ }
21
+ )
22
+ end
23
+
24
+ end
25
+ end
26
26
  end
@@ -1,8 +1,8 @@
1
- namespace :raygun do
2
-
3
- desc "Test Raygun integration"
4
- task :test => :environment do
5
- Raygun.track_test_exception
6
- end
7
-
1
+ namespace :raygun do
2
+
3
+ desc "Test Raygun integration"
4
+ task :test => :environment do
5
+ Raygun.track_test_exception
6
+ end
7
+
8
8
  end
data/raygun4ruby.gemspec CHANGED
@@ -1,45 +1,45 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'raygun/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "raygun4ruby"
8
- spec.version = Raygun::VERSION
9
- spec.authors = ["Mindscape", "Nik Wakelin"]
10
- spec.email = ["hello@raygun.io"]
11
- spec.description = %q{Ruby Adapter for Raygun.io}
12
- spec.summary = %q{This gem provides support for Ruby and Ruby on Rails for the Raygun.io error reporter}
13
- spec.homepage = "http://raygun.io"
14
- spec.license = "MIT"
15
- spec.required_ruby_version = '>= 2.0'
16
-
17
- spec.files = `git ls-files | grep -Ev '^(test)'`.split("\n")
18
- spec.test_files = `git ls-files -- test/*`.split("\n")
19
-
20
- spec.executables = []
21
- spec.require_paths = ["lib"]
22
-
23
- spec.add_runtime_dependency "httparty", "> 0.13.7"
24
- spec.add_runtime_dependency "json"
25
- spec.add_runtime_dependency "rack"
26
- spec.add_runtime_dependency "concurrent-ruby"
27
-
28
- spec.add_development_dependency "bundler", ">= 1.1"
29
- spec.add_development_dependency "rake", ">= 12.3.3"
30
- spec.add_development_dependency "timecop"
31
- spec.add_development_dependency "minitest", "~> 5.11"
32
- spec.add_development_dependency "redis-namespace", ">= 1.3.1"
33
- spec.add_development_dependency "resque"
34
- spec.add_development_dependency "sidekiq", [">= 3", "< 3.2.2"]
35
- spec.add_development_dependency "mocha"
36
- spec.add_development_dependency "pry"
37
- spec.add_development_dependency "webmock"
38
-
39
- spec.add_development_dependency 'rails', "= 4.2.11"
40
- spec.add_development_dependency 'sqlite3', '~> 1.3.6'
41
- spec.add_development_dependency 'capybara'
42
- spec.add_development_dependency "rspec-rails", '~> 3.9'
43
- spec.add_development_dependency "launchy"
44
- spec.add_development_dependency "simplecov"
45
- end
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'raygun/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "raygun4ruby"
8
+ spec.version = Raygun::VERSION
9
+ spec.authors = ["Mindscape", "Nik Wakelin"]
10
+ spec.email = ["hello@raygun.com"]
11
+ spec.description = %q{Ruby Adapter for Raygun}
12
+ spec.summary = %q{This gem provides support for Ruby and Ruby on Rails for the Raygun error reporter}
13
+ spec.homepage = "https://raygun.com"
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = '>= 2.0'
16
+
17
+ spec.files = `git ls-files | grep -Ev '^(test)'`.split("\n")
18
+ spec.test_files = `git ls-files -- test/*`.split("\n")
19
+
20
+ spec.executables = []
21
+ spec.require_paths = ["lib"]
22
+
23
+ spec.add_runtime_dependency "httparty", "> 0.13.7"
24
+ spec.add_runtime_dependency "json"
25
+ spec.add_runtime_dependency "rack"
26
+ spec.add_runtime_dependency "concurrent-ruby"
27
+
28
+ spec.add_development_dependency "bundler", ">= 1.1"
29
+ spec.add_development_dependency "rake", ">= 12.3.3"
30
+ spec.add_development_dependency "timecop"
31
+ spec.add_development_dependency "minitest", "~> 5.11"
32
+ spec.add_development_dependency "redis-namespace", ">= 1.3.1"
33
+ spec.add_development_dependency "resque"
34
+ spec.add_development_dependency "sidekiq", [">= 3", "< 3.2.2"]
35
+ spec.add_development_dependency "mocha"
36
+ spec.add_development_dependency "pry"
37
+ spec.add_development_dependency "webmock"
38
+
39
+ spec.add_development_dependency 'rails', "= 4.2.11"
40
+ spec.add_development_dependency 'sqlite3', '~> 1.3.6'
41
+ spec.add_development_dependency 'capybara'
42
+ spec.add_development_dependency "rspec-rails", '~> 3.9'
43
+ spec.add_development_dependency "launchy"
44
+ spec.add_development_dependency "simplecov"
45
+ end
@@ -1,17 +1,17 @@
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
-
14
- # Ignore all logfiles and tempfiles.
15
- /log/*
16
- !/log/.keep
17
- /tmp
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
+
14
+ # Ignore all logfiles and tempfiles.
15
+ /log/*
16
+ !/log/.keep
17
+ /tmp
data/spec/dummy/Gemfile CHANGED
@@ -1,47 +1,47 @@
1
- source 'https://rubygems.org'
2
-
3
-
4
- # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
5
- gem 'rails', '4.2.11'
6
- # Use sqlite3 as the database for Active Record
7
- gem 'sqlite3'
8
- # Use SCSS for stylesheets
9
- gem 'sass-rails', '~> 5.0'
10
- # Use Uglifier as compressor for JavaScript assets
11
- gem 'uglifier', '>= 1.3.0'
12
- # Use CoffeeScript for .coffee assets and views
13
- gem 'coffee-rails', '~> 4.1.0'
14
- # See https://github.com/rails/execjs#readme for more supported runtimes
15
- # gem 'therubyracer', platforms: :ruby
16
-
17
- # Use jquery as the JavaScript library
18
- gem 'jquery-rails'
19
- # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
20
- gem 'turbolinks'
21
- # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
22
- gem 'jbuilder', '~> 2.0'
23
- # bundle exec rake doc:rails generates the API under doc/api.
24
- gem 'sdoc', '~> 0.4.0', group: :doc
25
-
26
- # Use ActiveModel has_secure_password
27
- # gem 'bcrypt', '~> 3.1.7'
28
-
29
- # Use Unicorn as the app server
30
- # gem 'unicorn'
31
-
32
- # Use Capistrano for deployment
33
- # gem 'capistrano-rails', group: :development
34
-
35
- group :development, :test do
36
- # Call 'byebug' anywhere in the code to stop execution and get a debugger console
37
- gem 'byebug'
38
- end
39
-
40
- group :development do
41
- # Access an IRB console on exception pages or by using <%= console %> in views
42
- gem 'web-console', '~> 2.0'
43
-
44
- # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
45
- gem 'spring'
46
- end
47
-
1
+ source 'https://rubygems.org'
2
+
3
+
4
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
5
+ gem 'rails', '4.2.11'
6
+ # Use sqlite3 as the database for Active Record
7
+ gem 'sqlite3'
8
+ # Use SCSS for stylesheets
9
+ gem 'sass-rails', '~> 5.0'
10
+ # Use Uglifier as compressor for JavaScript assets
11
+ gem 'uglifier', '>= 1.3.0'
12
+ # Use CoffeeScript for .coffee assets and views
13
+ gem 'coffee-rails', '~> 4.1.0'
14
+ # See https://github.com/rails/execjs#readme for more supported runtimes
15
+ # gem 'therubyracer', platforms: :ruby
16
+
17
+ # Use jquery as the JavaScript library
18
+ gem 'jquery-rails'
19
+ # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
20
+ gem 'turbolinks'
21
+ # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
22
+ gem 'jbuilder', '~> 2.0'
23
+ # bundle exec rake doc:rails generates the API under doc/api.
24
+ gem 'sdoc', '~> 0.4.0', group: :doc
25
+
26
+ # Use ActiveModel has_secure_password
27
+ # gem 'bcrypt', '~> 3.1.7'
28
+
29
+ # Use Unicorn as the app server
30
+ # gem 'unicorn'
31
+
32
+ # Use Capistrano for deployment
33
+ # gem 'capistrano-rails', group: :development
34
+
35
+ group :development, :test do
36
+ # Call 'byebug' anywhere in the code to stop execution and get a debugger console
37
+ gem 'byebug'
38
+ end
39
+
40
+ group :development do
41
+ # Access an IRB console on exception pages or by using <%= console %> in views
42
+ gem 'web-console', '~> 2.0'
43
+
44
+ # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
45
+ gem 'spring'
46
+ end
47
+
@@ -1,28 +1,28 @@
1
- == README
2
-
3
- This README would normally document whatever steps are necessary to get the
4
- application up and running.
5
-
6
- Things you may want to cover:
7
-
8
- * Ruby version
9
-
10
- * System dependencies
11
-
12
- * Configuration
13
-
14
- * Database creation
15
-
16
- * Database initialization
17
-
18
- * How to run the test suite
19
-
20
- * Services (job queues, cache servers, search engines, etc.)
21
-
22
- * Deployment instructions
23
-
24
- * ...
25
-
26
-
27
- Please feel free to use a different markup language if you do not plan to run
28
- <tt>rake doc:app</tt>.
1
+ == README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
25
+
26
+
27
+ Please feel free to use a different markup language if you do not plan to run
28
+ <tt>rake doc:app</tt>.
data/spec/dummy/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
- # Add your own tasks in files placed in lib/tasks ending in .rake,
2
- # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
-
4
- require File.expand_path('../config/application', __FILE__)
5
-
6
- Rails.application.load_tasks
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+
6
+ Rails.application.load_tasks
@@ -1,3 +1,3 @@
1
- //= link_tree ../images
2
- //= link_directory ../javascripts .js
1
+ //= link_tree ../images
2
+ //= link_directory ../javascripts .js
3
3
  //= link_directory ../stylesheets .css
@@ -1,13 +1,13 @@
1
- // This is a manifest file that'll be compiled into application.js, which will include all the files
2
- // listed below.
3
- //
4
- // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
- // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
- //
7
- // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
- // compiled file.
9
- //
10
- // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
- // about supported directives.
12
- //
13
- //= require_tree .
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .