Skip to content

Commit

Permalink
Merge f201a0a into f196413
Browse files Browse the repository at this point in the history
  • Loading branch information
FLarra committed Dec 19, 2018
2 parents f196413 + f201a0a commit 95fb9e3
Show file tree
Hide file tree
Showing 60 changed files with 1,069 additions and 932 deletions.
1 change: 1 addition & 0 deletions .rubocop.yml
@@ -0,0 +1 @@
inherit_from: .rubocop_todo.yml
180 changes: 180 additions & 0 deletions .rubocop_todo.yml
@@ -0,0 +1,180 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2018-12-18 20:02:43 -0300 using RuboCop version 0.59.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 1
# Configuration parameters: Include.
# Include: **/*.gemspec
Gemspec/RequiredRubyVersion:
Exclude:
- 'exception_notification.gemspec'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleAlignWith, AutoCorrect, Severity.
# SupportedStylesAlignWith: keyword, variable, start_of_line
Layout/EndAlignment:
Exclude:
- 'lib/exception_notifier/campfire_notifier.rb'
- 'lib/exception_notifier/hipchat_notifier.rb'

# Offense count: 2
# Cop supports --auto-correct.
Layout/RescueEnsureAlignment:
Exclude:
- 'lib/exception_notifier/modules/error_grouping.rb'
- 'test/exception_notifier/webhook_notifier_test.rb'

# Offense count: 2
# Configuration parameters: AllowSafeAssignment.
Lint/AssignmentInCondition:
Exclude:
- 'lib/exception_notifier/modules/error_grouping.rb'

# Offense count: 12
Lint/RescueException:
Exclude:
- 'examples/sinatra/sinatra_app.rb'
- 'lib/exception_notification/rack.rb'
- 'lib/exception_notification/sidekiq.rb'
- 'lib/exception_notifier.rb'
- 'test/exception_notifier/campfire_notifier_test.rb'
- 'test/exception_notifier/hipchat_notifier_test.rb'
- 'test/exception_notifier/irc_notifier_test.rb'
- 'test/exception_notifier/slack_notifier_test.rb'
- 'test/exception_notifier/sns_notifier_test.rb'
- 'test/exception_notifier/webhook_notifier_test.rb'

# Offense count: 2
# Configuration parameters: ContextCreatingMethods, MethodCreatingMethods.
Lint/UselessAccessModifier:
Exclude:
- 'lib/exception_notifier/datadog_notifier.rb'
- 'test/exception_notifier/datadog_notifier_test.rb'

# Offense count: 1
Lint/UselessAssignment:
Exclude:
- 'lib/exception_notifier/sns_notifier.rb'

# Offense count: 18
Metrics/AbcSize:
Max: 97

# Offense count: 3
# Configuration parameters: CountComments, ExcludedMethods.
# ExcludedMethods: refine
Metrics/BlockLength:
Max: 88

# Offense count: 10
# Configuration parameters: CountComments.
Metrics/ClassLength:
Max: 186

# Offense count: 9
Metrics/CyclomaticComplexity:
Max: 24

# Offense count: 28
# Configuration parameters: CountComments, ExcludedMethods.
Metrics/MethodLength:
Max: 90

# Offense count: 7
Metrics/PerceivedComplexity:
Max: 24

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, EnforcedStyle.
# SupportedStyles: nested, compact
Style/ClassAndModuleChildren:
Exclude:
- 'test/dummy/test/test_helper.rb'

# Offense count: 6
Style/ClassVars:
Exclude:
- 'lib/exception_notifier.rb'
- 'test/exception_notifier/modules/error_grouping_test.rb'

# Offense count: 28
Style/Documentation:
Enabled: false

# Offense count: 1
Style/DoubleNegation:
Exclude:
- 'lib/exception_notifier/irc_notifier.rb'

# Offense count: 1
Style/EvalWithLocation:
Exclude:
- 'test/exception_notifier_test.rb'

# Offense count: 6
# Configuration parameters: MinBodyLength.
Style/GuardClause:
Exclude:
- 'lib/exception_notifier/campfire_notifier.rb'
- 'lib/exception_notifier/email_notifier.rb'
- 'lib/exception_notifier/google_chat_notifier.rb'
- 'lib/exception_notifier/irc_notifier.rb'
- 'lib/exception_notifier/slack_notifier.rb'
- 'lib/exception_notifier/sns_notifier.rb'

# Offense count: 7
# Cop supports --auto-correct.
Style/IfUnlessModifier:
Exclude:
- 'lib/exception_notification/rack.rb'
- 'lib/exception_notifier/datadog_notifier.rb'
- 'lib/exception_notifier/google_chat_notifier.rb'
- 'lib/exception_notifier/webhook_notifier.rb'
- 'test/dummy/test/functional/posts_controller_test.rb'
- 'test/exception_notifier/email_notifier_test.rb'

# Offense count: 3
Style/MethodMissingSuper:
Exclude:
- 'lib/exception_notifier/email_notifier.rb'
- 'lib/exception_notifier/mattermost_notifier.rb'
- 'lib/exception_notifier/teams_notifier.rb'

# Offense count: 3
Style/MissingRespondToMissing:
Exclude:
- 'lib/exception_notifier/email_notifier.rb'
- 'lib/exception_notifier/mattermost_notifier.rb'
- 'lib/exception_notifier/teams_notifier.rb'

# Offense count: 1
Style/MultilineBlockChain:
Exclude:
- 'lib/exception_notifier/email_notifier.rb'

# Offense count: 2
Style/NestedTernaryOperator:
Exclude:
- 'lib/exception_notifier/slack_notifier.rb'
- 'lib/exception_notifier/sns_notifier.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, EnforcedStyle, IgnoredMethods.
# SupportedStyles: predicate, comparison
Style/NumericPredicate:
Exclude:
- 'spec/**/*'
- 'test/exception_notifier/modules/error_grouping_test.rb'

# Offense count: 253
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Max: 226
2 changes: 1 addition & 1 deletion Appraisals
@@ -1,7 +1,7 @@
rails_versions = ['~> 4.0.5', '~> 4.1.1', '~> 4.2.0', '~> 5.0.0', '~> 5.1.0', '~> 5.2.0']

rails_versions.each do |rails_version|
appraise "rails#{rails_version.slice(/\d+\.\d+/).gsub('.', '_')}" do
appraise "rails#{rails_version.slice(/\d+\.\d+/).tr('.', '_')}" do
gem 'rails', rails_version
end
end
2 changes: 1 addition & 1 deletion Gemfile
@@ -1,3 +1,3 @@
source "https://rubygems.org"
source 'https://rubygems.org'

gemspec
12 changes: 6 additions & 6 deletions examples/sinatra/Gemfile
@@ -1,8 +1,8 @@
source "https://rubygems.org"
source 'https://rubygems.org'

gem "exception_notification", path: "../../"
gem 'exception_notification', path: '../../'

gem "thin", "~> 1.5.1"
gem "sinatra", "~> 1.3.5"
gem "foreman"
gem "mailcatcher"
gem 'foreman'
gem 'mailcatcher'
gem 'sinatra', '~> 1.3.5'
gem 'thin', '~> 1.5.1'
2 changes: 1 addition & 1 deletion examples/sinatra/config.ru
@@ -1,3 +1,3 @@
require ::File.expand_path('../sinatra_app', __FILE__)
require ::File.expand_path('../sinatra_app', __FILE__)

run SinatraApp
19 changes: 10 additions & 9 deletions examples/sinatra/sinatra_app.rb
Expand Up @@ -9,24 +9,25 @@ class SinatraApp < Sinatra::Base
end

use ExceptionNotification::Rack,
email: {
email_prefix: '[Example] ',
sender_address: %{"notifier" <notifier@example.com>},
exception_recipients: %w{exceptions@example.com},
smtp_settings: {
address: 'localhost',
port: 1025
email: {
email_prefix: '[Example] ',
sender_address: %("notifier" <notifier@example.com>),
exception_recipients: %w[exceptions@example.com],
smtp_settings: {
address: 'localhost',
port: 1025
}
}
}

get '/' do
raise StandardError, "ERROR: #{params[:error]}" unless params[:error].blank?

'Everything is fine! Now, lets break things clicking <a href="/?error=ops"> here </a>. Dont forget to see the emails at <a href="http://localhost:1080">mailcatcher</a> !'
end

get '/background_notification' do
begin
1/0
1 / 0
rescue Exception => e
ExceptionNotifier.notify_exception(e, data: { msg: 'Cannot divide by zero!' })
end
Expand Down
46 changes: 23 additions & 23 deletions exception_notification.gemspec
@@ -1,12 +1,12 @@
Gem::Specification.new do |s|
s.name = 'exception_notification'
s.version = '4.3.0'
s.authors = ["Jamis Buck", "Josh Peek"]
s.date = %q{2018-11-22}
s.summary = "Exception notification for Rails apps"
s.homepage = "https://smartinez87.github.io/exception_notification/"
s.email = "smartinez87@gmail.com"
s.license = "MIT"
s.authors = ['Jamis Buck', 'Josh Peek']
s.date = '2018-11-22'
s.summary = 'Exception notification for Rails apps'
s.homepage = 'https://smartinez87.github.io/exception_notification/'
s.email = 'smartinez87@gmail.com'
s.license = 'MIT'

s.required_ruby_version = '>= 2.0'
s.required_rubygems_version = '>= 1.8.11'
Expand All @@ -16,23 +16,23 @@ Gem::Specification.new do |s|
s.test_files = `git ls-files -- test`.split("\n")
s.require_path = 'lib'

s.add_dependency("actionmailer", ">= 4.0", "< 6")
s.add_dependency("activesupport", ">= 4.0", "< 6")
s.add_dependency('actionmailer', '>= 4.0', '< 6')
s.add_dependency('activesupport', '>= 4.0', '< 6')

s.add_development_dependency "rails", ">= 4.0", "< 6"
s.add_development_dependency "resque", "~> 1.2.0"
s.add_development_dependency 'rails', '>= 4.0', '< 6'
s.add_development_dependency 'resque', '~> 1.2.0'
# Sidekiq 3.2.2 does not support Ruby 1.9.
s.add_development_dependency "sidekiq", "~> 3.0.0", "< 3.2.2"
s.add_development_dependency "tinder", "~> 1.8"
s.add_development_dependency "httparty", "~> 0.10.2"
s.add_development_dependency "mocha", ">= 0.13.0"
s.add_development_dependency "sqlite3", ">= 1.3.4"
s.add_development_dependency "coveralls", "~> 0.8.2"
s.add_development_dependency "appraisal", "~> 2.2.0"
s.add_development_dependency "hipchat", ">= 1.0.0"
s.add_development_dependency "carrier-pigeon", ">= 0.7.0"
s.add_development_dependency "slack-notifier", ">= 1.0.0"
s.add_development_dependency "aws-sdk-sns", "~> 1"
s.add_development_dependency "dogapi", ">= 1.23.0"
s.add_development_dependency "timecop", "~>0.9.0"
s.add_development_dependency 'appraisal', '~> 2.2.0'
s.add_development_dependency 'aws-sdk-sns', '~> 1'
s.add_development_dependency 'carrier-pigeon', '>= 0.7.0'
s.add_development_dependency 'coveralls', '~> 0.8.2'
s.add_development_dependency 'dogapi', '>= 1.23.0'
s.add_development_dependency 'hipchat', '>= 1.0.0'
s.add_development_dependency 'httparty', '~> 0.10.2'
s.add_development_dependency 'mocha', '>= 0.13.0'
s.add_development_dependency 'sidekiq', '~> 3.0.0', '< 3.2.2'
s.add_development_dependency 'slack-notifier', '>= 1.0.0'
s.add_development_dependency 'sqlite3', '>= 1.3.4'
s.add_development_dependency 'timecop', '~>0.9.0'
s.add_development_dependency 'tinder', '~> 1.8'
end
6 changes: 3 additions & 3 deletions gemfiles/rails4_0.gemfile
@@ -1,7 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"
source 'https://rubygems.org'

gem "rails", "~> 4.0.5"
gem 'rails', '~> 4.0.5'

gemspec path: "../"
gemspec path: '../'
6 changes: 3 additions & 3 deletions gemfiles/rails4_1.gemfile
@@ -1,7 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"
source 'https://rubygems.org'

gem "rails", "~> 4.1.1"
gem 'rails', '~> 4.1.1'

gemspec path: "../"
gemspec path: '../'
6 changes: 3 additions & 3 deletions gemfiles/rails4_2.gemfile
@@ -1,7 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"
source 'https://rubygems.org'

gem "rails", "~> 4.2.0"
gem 'rails', '~> 4.2.0'

gemspec path: "../"
gemspec path: '../'
6 changes: 3 additions & 3 deletions gemfiles/rails5_0.gemfile
@@ -1,7 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"
source 'https://rubygems.org'

gem "rails", "~> 5.0.0"
gem 'rails', '~> 5.0.0'

gemspec path: "../"
gemspec path: '../'
6 changes: 3 additions & 3 deletions gemfiles/rails5_1.gemfile
@@ -1,7 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"
source 'https://rubygems.org'

gem "rails", "~> 5.1.0"
gem 'rails', '~> 5.1.0'

gemspec path: "../"
gemspec path: '../'
6 changes: 3 additions & 3 deletions gemfiles/rails5_2.gemfile
@@ -1,7 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"
source 'https://rubygems.org'

gem "rails", "~> 5.2.0"
gem 'rails', '~> 5.2.0'

gemspec path: "../"
gemspec path: '../'

0 comments on commit 95fb9e3

Please sign in to comment.