Hello community, here is the log from the commit of package rubygem-exception_notification for openSUSE:Factory checked in at 2016-01-12 16:12:07 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-exception_notification (Old) and /work/SRC/openSUSE:Factory/.rubygem-exception_notification.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-exception_notification" Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-exception_notification/rubygem-exception_notification.changes 2015-06-16 14:06:08.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-exception_notification.new/rubygem-exception_notification.changes 2016-01-12 16:12:08.000000000 +0100 @@ -1,0 +2,10 @@ +Sat Dec 5 05:30:02 UTC 2015 - co...@suse.com + +- updated to version 4.1.2 + see installed CHANGELOG.rdoc + + == 4.1.2 + * enhancements + * Change format of Slack notifications (by @eldano) + +------------------------------------------------------------------- Old: ---- exception_notification-4.1.1.gem New: ---- exception_notification-4.1.2.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-exception_notification.spec ++++++ --- /var/tmp/diff_new_pack.7iM4OI/_old 2016-01-12 16:12:09.000000000 +0100 +++ /var/tmp/diff_new_pack.7iM4OI/_new 2016-01-12 16:12:09.000000000 +0100 @@ -24,12 +24,12 @@ # Name: rubygem-exception_notification -Version: 4.1.1 +Version: 4.1.2 Release: 0 %define mod_name exception_notification %define mod_full_name %{mod_name}-%{version} BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: %{ruby >= 1.9.3} +BuildRequires: %{ruby >= 2.0} BuildRequires: %{rubygem gem2rpm} BuildRequires: ruby-macros >= 5 Url: http://smartinez87.github.com/exception_notification ++++++ exception_notification-4.1.1.gem -> exception_notification-4.1.2.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Appraisals new/Appraisals --- old/Appraisals 2015-06-09 16:51:23.000000000 +0200 +++ new/Appraisals 2015-12-04 21:45:42.000000000 +0100 @@ -1,11 +1,3 @@ -appraise "rails3_1" do - gem 'rails', '~> 3.1.0' -end - -appraise "rails3_2" do - gem 'rails', '~> 3.2.0' -end - appraise "rails4_0" do gem 'rails', '4.0.5' end @@ -13,3 +5,7 @@ appraise "rails4_1" do gem 'rails', '~> 4.1.1' end + +appraise "rails4_2" do + gem 'rails', '~> 4.2.0' +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CHANGELOG.rdoc new/CHANGELOG.rdoc --- old/CHANGELOG.rdoc 2015-06-09 16:51:23.000000000 +0200 +++ new/CHANGELOG.rdoc 2015-12-04 21:45:42.000000000 +0100 @@ -1,3 +1,7 @@ +== 4.1.2 +* enhancements + * Change format of Slack notifications (by @eldano) + == 4.1.1 * bug fixes diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Gemfile.lock new/Gemfile.lock --- old/Gemfile.lock 2015-06-09 16:51:23.000000000 +0200 +++ new/Gemfile.lock 1970-01-01 01:00:00.000000000 +0100 @@ -1,174 +0,0 @@ -PATH - remote: . - specs: - exception_notification (4.1.1) - actionmailer (>= 3.0.4) - activesupport (>= 3.0.4) - -GEM - remote: https://rubygems.org/ - specs: - actionmailer (3.2.6) - actionpack (= 3.2.6) - mail (~> 2.4.4) - actionpack (3.2.6) - activemodel (= 3.2.6) - activesupport (= 3.2.6) - builder (~> 3.0.0) - erubis (~> 2.7.0) - journey (~> 1.0.1) - rack (~> 1.4.0) - rack-cache (~> 1.2) - rack-test (~> 0.6.1) - sprockets (~> 2.1.3) - activemodel (3.2.6) - activesupport (= 3.2.6) - builder (~> 3.0.0) - activerecord (3.2.6) - activemodel (= 3.2.6) - activesupport (= 3.2.6) - arel (~> 3.0.2) - tzinfo (~> 0.3.29) - activeresource (3.2.6) - activemodel (= 3.2.6) - activesupport (= 3.2.6) - activesupport (3.2.6) - i18n (~> 0.6) - multi_json (~> 1.0) - addressable (2.3.5) - appraisal (1.0.0) - bundler - rake - thor (>= 0.14.0) - arel (3.0.2) - builder (3.0.0) - carrier-pigeon (0.7.0) - addressable - celluloid (0.15.2) - timers (~> 1.1.0) - colorize (0.5.8) - connection_pool (2.0.0) - coveralls (0.6.5) - colorize - multi_json (~> 1.3) - rest-client - simplecov (>= 0.7) - thor - erubis (2.7.0) - eventmachine (1.0.3) - faraday (0.8.7) - multipart-post (~> 1.1) - faraday_middleware (0.9.0) - faraday (>= 0.7.4, < 0.9) - hashie (1.2.0) - hike (1.2.1) - hipchat (1.2.0) - httparty - http_parser.rb (0.5.3) - httparty (0.10.2) - multi_json (~> 1.0) - multi_xml (>= 0.5.2) - i18n (0.6.0) - journey (1.0.4) - json (1.8.1) - mail (2.4.4) - i18n (>= 0.4.0) - mime-types (~> 1.16) - treetop (~> 1.4.8) - metaclass (0.0.1) - mime-types (1.19) - mocha (0.13.3) - metaclass (~> 0.0.1) - multi_json (1.10.1) - multi_xml (0.5.5) - multipart-post (1.2.0) - polyglot (0.3.3) - rack (1.4.1) - rack-cache (1.2) - rack (>= 0.4) - rack-ssl (1.3.2) - rack - rack-test (0.6.1) - rack (>= 1.0) - rails (3.2.6) - actionmailer (= 3.2.6) - actionpack (= 3.2.6) - activerecord (= 3.2.6) - activeresource (= 3.2.6) - activesupport (= 3.2.6) - bundler (~> 1.0) - railties (= 3.2.6) - railties (3.2.6) - actionpack (= 3.2.6) - activesupport (= 3.2.6) - rack-ssl (~> 1.3.2) - rake (>= 0.8.7) - rdoc (~> 3.4) - thor (>= 0.14.6, < 2.0) - rake (0.9.2.2) - rdoc (3.12) - json (~> 1.4) - redis (3.0.7) - redis-namespace (1.4.1) - redis (~> 3.0.4) - resque (1.2.3) - redis - redis-namespace - rest-client (1.6.7) - mime-types (>= 1.16) - sidekiq (3.0.0) - celluloid (>= 0.15.2) - connection_pool (>= 2.0.0) - json - redis (>= 3.0.6) - redis-namespace (>= 1.3.1) - simple_oauth (0.1.9) - simplecov (0.7.1) - multi_json (~> 1.0) - simplecov-html (~> 0.7.1) - simplecov-html (0.7.1) - slack-notifier (1.0.0) - sprockets (2.1.3) - hike (~> 1.2) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - sqlite3 (1.3.6) - thor (0.15.4) - tilt (1.3.3) - timers (1.1.0) - tinder (1.9.1) - eventmachine (>= 0.12.0, < 2) - faraday (~> 0.8) - faraday_middleware (~> 0.8) - hashie (~> 1.0) - json (~> 1.6) - mime-types (~> 1.16) - multi_json (~> 1.0) - multipart-post (~> 1.1) - twitter-stream (~> 0.1) - treetop (1.4.10) - polyglot - polyglot (>= 0.3.1) - twitter-stream (0.1.16) - eventmachine (>= 0.12.8) - http_parser.rb (~> 0.5.1) - simple_oauth (~> 0.1.4) - tzinfo (0.3.33) - -PLATFORMS - ruby - -DEPENDENCIES - appraisal (~> 1.0.0) - carrier-pigeon (>= 0.7.0) - coveralls (~> 0.6.5) - exception_notification! - hipchat (>= 1.0.0) - httparty (~> 0.10.2) - mocha (>= 0.13.0) - rails (>= 3.0.4) - resque (~> 1.2.0) - sidekiq (~> 3.0) - slack-notifier (>= 1.0.0) - sqlite3 (>= 1.3.4) - tinder (~> 1.8) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.md new/README.md --- old/README.md 2015-06-09 16:51:23.000000000 +0200 +++ new/README.md 2015-12-04 21:45:42.000000000 +0100 @@ -4,7 +4,6 @@ [![Travis](https://api.travis-ci.org/smartinez87/exception_notification.png)](http://travis-ci.org/smartinez87/exception_notification) [![Coverage Status](https://coveralls.io/repos/smartinez87/exception_notification/badge.png?branch=master)](https://coveralls.io/r/smartinez87/exception_notification) [![Code Climate](https://codeclimate.com/github/smartinez87/exception_notification.png)](https://codeclimate.com/github/smartinez87/exception_notification) -![project status](http://stillmaintained.com/smartinez87/exception_notification.png) **THIS README IS FOR THE MASTER BRANCH AND REFLECTS THE WORK CURRENTLY EXISTING ON THE MASTER BRANCH. IF YOU ARE WISHING TO USE A NON-MASTER BRANCH OF EXCEPTION NOTIFICATION, PLEASE CONSULT THAT BRANCH'S README AND NOT THIS ONE.** @@ -276,6 +275,13 @@ The parent mailer which ExceptionNotification mailer inherit from. +##### deliver_with + +*Symbol, default: :deliver_now + +The method name to send emalis using ActionMailer. + + ### Campfire notifier This notifier sends notifications to your Campfire room. Files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/exception_notification.gemspec new/exception_notification.gemspec --- old/exception_notification.gemspec 2015-06-09 16:51:23.000000000 +0200 +++ new/exception_notification.gemspec 2015-12-04 21:45:42.000000000 +0100 @@ -1,14 +1,14 @@ Gem::Specification.new do |s| s.name = 'exception_notification' - s.version = '4.1.1' + s.version = '4.1.2' s.authors = ["Jamis Buck", "Josh Peek"] - s.date = %q{2015-06-09} + s.date = %q{2015-12-04} s.summary = "Exception notification for Rails apps" s.homepage = "http://smartinez87.github.com/exception_notification" s.email = "smartine...@gmail.com" s.license = "MIT" - s.required_ruby_version = '>= 1.9.3' + s.required_ruby_version = '>= 2.0' s.required_rubygems_version = '>= 1.8.11' s.files = `git ls-files`.split("\n") @@ -16,17 +16,18 @@ s.test_files = `git ls-files -- test`.split("\n") s.require_path = 'lib' - s.add_dependency("actionmailer", ">= 3.0.4") - s.add_dependency("activesupport", ">= 3.0.4") + s.add_dependency("actionmailer", "~> 4.0") + s.add_dependency("activesupport", "~> 4.0") - s.add_development_dependency "rails", ">= 3.0.4" + s.add_development_dependency "rails", "~> 4.0" s.add_development_dependency "resque", "~> 1.2.0" - s.add_development_dependency "sidekiq", "~> 3.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.6.5" + s.add_development_dependency "coveralls", "~> 0.8.2" s.add_development_dependency "appraisal", "~> 1.0.0" s.add_development_dependency "hipchat", ">= 1.0.0" s.add_development_dependency "carrier-pigeon", ">= 0.7.0" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gemfiles/rails3_1.gemfile new/gemfiles/rails3_1.gemfile --- old/gemfiles/rails3_1.gemfile 2015-06-09 16:51:23.000000000 +0200 +++ new/gemfiles/rails3_1.gemfile 1970-01-01 01:00:00.000000000 +0100 @@ -1,7 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "rails", "~> 3.1.0" - -gemspec :path => "../" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gemfiles/rails3_2.gemfile new/gemfiles/rails3_2.gemfile --- old/gemfiles/rails3_2.gemfile 2015-06-09 16:51:23.000000000 +0200 +++ new/gemfiles/rails3_2.gemfile 1970-01-01 01:00:00.000000000 +0100 @@ -1,7 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "rails", "~> 3.2.0" - -gemspec :path => "../" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gemfiles/rails4_2.gemfile new/gemfiles/rails4_2.gemfile --- old/gemfiles/rails4_2.gemfile 1970-01-01 01:00:00.000000000 +0100 +++ new/gemfiles/rails4_2.gemfile 2015-12-04 21:45:42.000000000 +0100 @@ -0,0 +1,7 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "rails", "~> 4.2.0" + +gemspec :path => "../" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/exception_notifier/campfire_notifier.rb new/lib/exception_notifier/campfire_notifier.rb --- old/lib/exception_notifier/campfire_notifier.rb 2015-06-09 16:51:23.000000000 +0200 +++ new/lib/exception_notifier/campfire_notifier.rb 2015-12-04 21:45:42.000000000 +0100 @@ -17,7 +17,11 @@ end def call(exception, options={}) - @room.paste "A new exception occurred: '#{exception.message}' on '#{exception.backtrace.first}'" if active? + if active? + message = "A new exception occurred: '#{exception.message}'" + message += " on '#{exception.backtrace.first}'" if exception.backtrace + @room.paste message message + end end private diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/exception_notifier/email_notifier.rb new/lib/exception_notifier/email_notifier.rb --- old/lib/exception_notifier/email_notifier.rb 2015-06-09 16:51:23.000000000 +0200 +++ new/lib/exception_notifier/email_notifier.rb 2015-12-04 21:45:42.000000000 +0100 @@ -7,7 +7,7 @@ class EmailNotifier < Struct.new(:sender_address, :exception_recipients, :email_prefix, :email_format, :sections, :background_sections, :verbose_subject, :normalize_subject, :delivery_method, :mailer_settings, - :email_headers, :mailer_parent, :template_path) + :email_headers, :mailer_parent, :template_path, :deliver_with) module Mailer class MissingController @@ -88,11 +88,11 @@ name = @env.nil? ? 'background_exception_notification' : 'exception_notification' headers = { - :delivery_method => @options[:delivery_method], - :to => @options[:exception_recipients], - :from => @options[:sender_address], - :subject => subject, - :template_name => name + :delivery_method => @options[:delivery_method], + :to => @options[:exception_recipients], + :from => @options[:sender_address], + :subject => subject, + :template_name => name }.merge(@options[:email_headers]) mail = mail(headers) do |format| @@ -123,7 +123,7 @@ :sender_address, :exception_recipients, :email_prefix, :email_format, :sections, :background_sections, :verbose_subject, :normalize_subject, :delivery_method, :mailer_settings, - :email_headers, :mailer_parent, :template_path)) + :email_headers, :mailer_parent, :template_path, :deliver_with)) end def options @@ -140,12 +140,7 @@ end def call(exception, options={}) - message = create_email(exception, options) - if message.respond_to?(:deliver_now) - message.deliver_now - else - message.deliver - end + create_email(exception, options).send(deliver_with) end def create_email(exception, options={}) @@ -172,7 +167,8 @@ :mailer_settings => nil, :email_headers => {}, :mailer_parent => 'ActionMailer::Base', - :template_path => 'exception_notifier' + :template_path => 'exception_notifier', + :deliver_with => :deliver_now } end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/exception_notifier/hipchat_notifier.rb new/lib/exception_notifier/hipchat_notifier.rb --- old/lib/exception_notifier/hipchat_notifier.rb 2015-06-09 16:51:23.000000000 +0200 +++ new/lib/exception_notifier/hipchat_notifier.rb 2015-12-04 21:45:42.000000000 +0100 @@ -15,7 +15,9 @@ @from = options.delete(:from) || 'Exception' @room = HipChat::Client.new(api_token, opts)[room_name] @message_template = options.delete(:message_template) || ->(exception) { - "A new exception occurred: '#{exception.message}' on '#{exception.backtrace.first}'" + msg = "A new exception occurred: '#{exception.message}'" + msg += " on '#{exception.backtrace.first}'" if exception.backtrace + msg } @message_options = options @message_options[:color] ||= 'red' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/exception_notifier/irc_notifier.rb new/lib/exception_notifier/irc_notifier.rb --- old/lib/exception_notifier/irc_notifier.rb 2015-06-09 16:51:23.000000000 +0200 +++ new/lib/exception_notifier/irc_notifier.rb 2015-12-04 21:45:42.000000000 +0100 @@ -6,7 +6,8 @@ end def call(exception, options={}) - message = "'#{exception.message}' on '#{exception.backtrace.first}'" + message = "'#{exception.message}'" + message += " on '#{exception.backtrace.first}'" if exception.backtrace send_message([*@config.prefix, *message].join(' ')) if active? end @@ -42,4 +43,4 @@ false end end -end \ No newline at end of file +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/exception_notifier/slack_notifier.rb new/lib/exception_notifier/slack_notifier.rb --- old/lib/exception_notifier/slack_notifier.rb 2015-06-09 16:51:23.000000000 +0200 +++ new/lib/exception_notifier/slack_notifier.rb 2015-12-04 21:45:42.000000000 +0100 @@ -17,12 +17,28 @@ end def call(exception, options={}) - message = "An exception occurred: '#{exception.message}' on '#{exception.backtrace.first}'" + env = options[:env] || {} + title = "#{env['REQUEST_METHOD']} <#{env['REQUEST_URI']}>" + data = (env['exception_notifier.exception_data'] || {}).merge(options[:data] || {}) + text = "*An exception occurred while doing*: `#{title}`\n" + + clean_message = exception.message.gsub("`", "'") + fields = [ { title: 'Exception', value: clean_message} ] + + if exception.backtrace + formatted_backtrace = "```#{exception.backtrace.first(5).join("\n")}```" + fields.push({ title: 'Backtrace', value: formatted_backtrace }) + end + + unless data.empty? + deep_reject(data, @ignore_data_if) if @ignore_data_if.is_a?(Proc) + data_string = data.map{|k,v| "#{k}: #{v}"}.join("\n") + fields.push({ title: 'Data', value: "```#{data_string}```" }) + end - message = enrich_message_with_data(message, options) - message = enrich_message_with_backtrace(message, exception) + attchs = [color: 'danger', text: text, fields: fields, mrkdwn_in: %w(text fields)] - @notifier.ping(message, @message_opts) if valid? + @notifier.ping '', @message_opts.merge(attachments: attchs) if valid? end protected @@ -31,35 +47,17 @@ !@notifier.nil? end - def enrich_message_with_data(message, options) - def deep_reject(hash, block) - hash.each do |k, v| - if v.is_a?(Hash) - deep_reject(v, block) - end - - if block.call(k, v) - hash.delete(k) - end + def deep_reject(hash, block) + hash.each do |k, v| + if v.is_a?(Hash) + deep_reject(v, block) end - end - data = ((options[:env] || {})['exception_notifier.exception_data'] || {}).merge(options[:data] || {}) - deep_reject(data, @ignore_data_if) if @ignore_data_if.is_a?(Proc) - text = data.map{|k,v| "#{k}: #{v}"}.join(', ') - - if text.present? - text = ['*Data:*', text].join("\n") - [message, text].join("\n") - else - message + if block.call(k, v) + hash.delete(k) + end end end - def enrich_message_with_backtrace(message, exception) - backtrace = clean_backtrace(exception).first(10).join("\n") - [message, ['*Backtrace:*', backtrace]].join("\n") - end - end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2015-06-09 16:51:23.000000000 +0200 +++ new/metadata 2015-12-04 21:45:42.000000000 +0100 @@ -1,7 +1,7 @@ --- !ruby/object:Gem::Specification name: exception_notification version: !ruby/object:Gem::Version - version: 4.1.1 + version: 4.1.2 platform: ruby authors: - Jamis Buck @@ -9,50 +9,50 @@ autorequire: bindir: bin cert_chain: [] -date: 2015-06-09 00:00:00.000000000 Z +date: 2015-12-04 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: actionmailer requirement: !ruby/object:Gem::Requirement requirements: - - - ">=" + - - "~>" - !ruby/object:Gem::Version - version: 3.0.4 + version: '4.0' type: :runtime prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - - ">=" + - - "~>" - !ruby/object:Gem::Version - version: 3.0.4 + version: '4.0' - !ruby/object:Gem::Dependency name: activesupport requirement: !ruby/object:Gem::Requirement requirements: - - - ">=" + - - "~>" - !ruby/object:Gem::Version - version: 3.0.4 + version: '4.0' type: :runtime prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - - ">=" + - - "~>" - !ruby/object:Gem::Version - version: 3.0.4 + version: '4.0' - !ruby/object:Gem::Dependency name: rails requirement: !ruby/object:Gem::Requirement requirements: - - - ">=" + - - "~>" - !ruby/object:Gem::Version - version: 3.0.4 + version: '4.0' type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - - ">=" + - - "~>" - !ruby/object:Gem::Version - version: 3.0.4 + version: '4.0' - !ruby/object:Gem::Dependency name: resque requirement: !ruby/object:Gem::Requirement @@ -73,14 +73,20 @@ requirements: - - "~>" - !ruby/object:Gem::Version - version: '3.0' + version: 3.0.0 + - - "<" + - !ruby/object:Gem::Version + version: 3.2.2 type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version - version: '3.0' + version: 3.0.0 + - - "<" + - !ruby/object:Gem::Version + version: 3.2.2 - !ruby/object:Gem::Dependency name: tinder requirement: !ruby/object:Gem::Requirement @@ -143,14 +149,14 @@ requirements: - - "~>" - !ruby/object:Gem::Version - version: 0.6.5 + version: 0.8.2 type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version - version: 0.6.5 + version: 0.8.2 - !ruby/object:Gem::Dependency name: appraisal requirement: !ruby/object:Gem::Requirement @@ -217,7 +223,6 @@ - CHANGELOG.rdoc - CONTRIBUTING.md - Gemfile -- Gemfile.lock - MIT-LICENSE - README.md - Rakefile @@ -228,10 +233,9 @@ - examples/sinatra/config.ru - examples/sinatra/sinatra_app.rb - exception_notification.gemspec -- gemfiles/rails3_1.gemfile -- gemfiles/rails3_2.gemfile - gemfiles/rails4_0.gemfile - gemfiles/rails4_1.gemfile +- gemfiles/rails4_2.gemfile - lib/exception_notification.rb - lib/exception_notification/rack.rb - lib/exception_notification/rails.rb @@ -341,7 +345,7 @@ requirements: - - ">=" - !ruby/object:Gem::Version - version: 1.9.3 + version: '2.0' required_rubygems_version: !ruby/object:Gem::Requirement requirements: - - ">=" @@ -349,7 +353,7 @@ version: 1.8.11 requirements: [] rubyforge_project: -rubygems_version: 2.2.0 +rubygems_version: 2.4.5 signing_key: specification_version: 4 summary: Exception notification for Rails apps diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/dummy/Gemfile new/test/dummy/Gemfile --- old/test/dummy/Gemfile 2015-06-09 16:51:23.000000000 +0200 +++ new/test/dummy/Gemfile 2015-12-04 21:45:42.000000000 +0100 @@ -1,6 +1,6 @@ source 'http://rubygems.org' -gem 'rails', '4.0.0' +gem 'rails', '4.2.0' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/dummy/Gemfile.lock new/test/dummy/Gemfile.lock --- old/test/dummy/Gemfile.lock 2015-06-09 16:51:23.000000000 +0200 +++ new/test/dummy/Gemfile.lock 2015-12-04 21:45:42.000000000 +0100 @@ -1,112 +1,130 @@ PATH remote: ../../.. specs: - exception_notification (4.1.0.rc1) - actionmailer (>= 3.0.4) - activesupport (>= 3.0.4) + exception_notification (4.1.1) + actionmailer (~> 4.0) + activesupport (~> 4.0) GEM remote: http://rubygems.org/ specs: - actionmailer (4.0.0) - actionpack (= 4.0.0) - mail (~> 2.5.3) - actionpack (4.0.0) - activesupport (= 4.0.0) - builder (~> 3.1.0) - erubis (~> 2.7.0) - rack (~> 1.5.2) + actionmailer (4.2.0) + actionpack (= 4.2.0) + actionview (= 4.2.0) + activejob (= 4.2.0) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 1.0, >= 1.0.5) + actionpack (4.2.0) + actionview (= 4.2.0) + activesupport (= 4.2.0) + rack (~> 1.6.0) rack-test (~> 0.6.2) - activemodel (4.0.0) - activesupport (= 4.0.0) - builder (~> 3.1.0) - activerecord (4.0.0) - activemodel (= 4.0.0) - activerecord-deprecated_finders (~> 1.0.2) - activesupport (= 4.0.0) - arel (~> 4.0.0) - activerecord-deprecated_finders (1.0.3) - activesupport (4.0.0) - i18n (~> 0.6, >= 0.6.4) - minitest (~> 4.2) - multi_json (~> 1.3) - thread_safe (~> 0.1) - tzinfo (~> 0.3.37) - arel (4.0.0) - atomic (1.1.10) - builder (3.1.4) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.1) + actionview (4.2.0) + activesupport (= 4.2.0) + builder (~> 3.1) + erubis (~> 2.7.0) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.1) + activejob (4.2.0) + activesupport (= 4.2.0) + globalid (>= 0.3.0) + activemodel (4.2.0) + activesupport (= 4.2.0) + builder (~> 3.1) + activerecord (4.2.0) + activemodel (= 4.2.0) + activesupport (= 4.2.0) + arel (~> 6.0) + activesupport (4.2.0) + i18n (~> 0.7) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + arel (6.0.3) + builder (3.2.2) erubis (2.7.0) - eventmachine (1.0.3) - faraday (0.8.7) - multipart-post (~> 1.1) - faraday_middleware (0.9.0) - faraday (>= 0.7.4, < 0.9) - hashie (1.2.0) - hike (1.2.3) + eventmachine (1.0.8) + faraday (0.9.1) + multipart-post (>= 1.2, < 3) + faraday_middleware (0.10.0) + faraday (>= 0.7.4, < 0.10) + globalid (0.3.6) + activesupport (>= 4.1.0) + hashie (3.4.2) http_parser.rb (0.5.3) - httparty (0.11.0) - multi_json (~> 1.0) + httparty (0.13.5) + json (~> 1.8) multi_xml (>= 0.5.2) - i18n (0.6.4) - json (1.7.7) - mail (2.5.4) - mime-types (~> 1.16) - treetop (~> 1.4.8) - mime-types (1.23) - minitest (4.7.5) - multi_json (1.7.7) - multi_xml (0.5.4) - multipart-post (1.2.0) - polyglot (0.3.3) - rack (1.5.2) - rack-test (0.6.2) + i18n (0.7.0) + json (1.8.3) + loofah (2.0.3) + nokogiri (>= 1.5.9) + mail (2.6.3) + mime-types (>= 1.16, < 3) + mime-types (2.6.1) + mini_portile (0.6.2) + minitest (5.8.0) + multi_json (1.11.2) + multi_xml (0.5.5) + multipart-post (2.0.0) + nokogiri (1.6.6.2) + mini_portile (~> 0.6.0) + rack (1.6.4) + rack-test (0.6.3) rack (>= 1.0) - rails (4.0.0) - actionmailer (= 4.0.0) - actionpack (= 4.0.0) - activerecord (= 4.0.0) - activesupport (= 4.0.0) + rails (4.2.0) + actionmailer (= 4.2.0) + actionpack (= 4.2.0) + actionview (= 4.2.0) + activejob (= 4.2.0) + activemodel (= 4.2.0) + activerecord (= 4.2.0) + activesupport (= 4.2.0) bundler (>= 1.3.0, < 2.0) - railties (= 4.0.0) - sprockets-rails (~> 2.0.0) - railties (4.0.0) - actionpack (= 4.0.0) - activesupport (= 4.0.0) + railties (= 4.2.0) + sprockets-rails + rails-deprecated_sanitizer (1.0.3) + activesupport (>= 4.2.0.alpha) + rails-dom-testing (1.0.7) + activesupport (>= 4.2.0.beta, < 5.0) + nokogiri (~> 1.6.0) + rails-deprecated_sanitizer (>= 1.0.1) + rails-html-sanitizer (1.0.2) + loofah (~> 2.0) + railties (4.2.0) + actionpack (= 4.2.0) + activesupport (= 4.2.0) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) - rake (10.1.0) + rake (10.4.2) simple_oauth (0.1.9) - sprockets (2.10.0) - hike (~> 1.2) - multi_json (~> 1.0) + sprockets (3.3.3) rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - sprockets-rails (2.0.0) + sprockets-rails (2.3.2) actionpack (>= 3.0) activesupport (>= 3.0) - sprockets (~> 2.8) - sqlite3 (1.3.7) - thor (0.18.1) - thread_safe (0.1.0) - atomic - tilt (1.4.1) - tinder (1.9.2) + sprockets (>= 2.8, < 4.0) + sqlite3 (1.3.10) + thor (0.19.1) + thread_safe (0.3.5) + tinder (1.10.1) eventmachine (~> 1.0) - faraday (~> 0.8) + faraday (~> 0.9.0) faraday_middleware (~> 0.9) - hashie (~> 1.0) - json (~> 1.7.5) - mime-types (~> 1.19) - multi_json (~> 1.5) + hashie (>= 1.0) + json (~> 1.8.0) + mime-types + multi_json (~> 1.7) twitter-stream (~> 0.1) - treetop (1.4.14) - polyglot - polyglot (>= 0.3.1) twitter-stream (0.1.16) eventmachine (>= 0.12.8) http_parser.rb (~> 0.5.1) simple_oauth (~> 0.1.4) - tzinfo (0.3.37) + tzinfo (1.2.2) + thread_safe (~> 0.1) PLATFORMS ruby @@ -114,6 +132,6 @@ DEPENDENCIES exception_notification! httparty - rails (= 4.0.0) + rails (= 4.2.0) sqlite3 tinder diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/dummy/config/environments/development.rb new/test/dummy/config/environments/development.rb --- old/test/dummy/config/environments/development.rb 2015-06-09 16:51:23.000000000 +0200 +++ new/test/dummy/config/environments/development.rb 2015-12-04 21:45:42.000000000 +0100 @@ -1,6 +1,7 @@ Dummy::Application.configure do # Settings specified here will take precedence over those in config/application.rb + config.eager_load = false # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the webserver when you make code changes. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/dummy/config/environments/production.rb new/test/dummy/config/environments/production.rb --- old/test/dummy/config/environments/production.rb 2015-06-09 16:51:23.000000000 +0200 +++ new/test/dummy/config/environments/production.rb 2015-12-04 21:45:42.000000000 +0100 @@ -1,6 +1,7 @@ Dummy::Application.configure do # Settings specified here will take precedence over those in config/application.rb + config.eager_load = true # The production environment is meant for finished, "live" apps. # Code is not reloaded between requests config.cache_classes = true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/dummy/config/environments/test.rb new/test/dummy/config/environments/test.rb --- old/test/dummy/config/environments/test.rb 2015-06-09 16:51:23.000000000 +0200 +++ new/test/dummy/config/environments/test.rb 2015-12-04 21:45:42.000000000 +0100 @@ -1,6 +1,7 @@ Dummy::Application.configure do # Settings specified here will take precedence over those in config/application.rb + config.eager_load = false # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped @@ -32,4 +33,6 @@ # Print deprecation notices to the stderr config.active_support.deprecation = :stderr + + config.active_support.test_order = :random end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/dummy/config/initializers/secret_token.rb new/test/dummy/config/initializers/secret_token.rb --- old/test/dummy/config/initializers/secret_token.rb 2015-06-09 16:51:23.000000000 +0200 +++ new/test/dummy/config/initializers/secret_token.rb 2015-12-04 21:45:42.000000000 +0100 @@ -5,3 +5,4 @@ # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attacks. Dummy::Application.config.secret_token = 'cfdf538142b0b383e722e8e7ea839b8ce6c3dc94a57856b343a2d13be66f5b690a55c991cec6e98ed60ea9b7e58265af23cb40cbadee02f13f1c45c2625f482b' +Dummy::Application.config.secret_key_base = 'my new secret' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/exception_notifier/campfire_notifier_test.rb new/test/exception_notifier/campfire_notifier_test.rb --- old/test/exception_notifier/campfire_notifier_test.rb 2015-06-09 16:51:23.000000000 +0200 +++ new/test/exception_notifier/campfire_notifier_test.rb 2015-12-04 21:45:42.000000000 +0100 @@ -16,6 +16,18 @@ assert_includes notif[:message][:body], "/exception_notification/test/campfire_test.rb:45" end + test "should send campfire notification without backtrace info if properly configured" do + ExceptionNotifier::CampfireNotifier.stubs(:new).returns(Object.new) + campfire = ExceptionNotifier::CampfireNotifier.new({:subdomain => 'test', :token => 'test_token', :room_name => 'test_room'}) + campfire.stubs(:call).returns(fake_notification_without_backtrace) + notif = campfire.call(fake_exception_without_backtrace) + + assert !notif[:message].empty? + assert_equal notif[:message][:type], 'PasteMessage' + assert_includes notif[:message][:body], "A new exception occurred:" + assert_includes notif[:message][:body], "my custom error" + end + test "should not send campfire notification if badly configured" do wrong_params = {:subdomain => 'test', :token => 'bad_token', :room_name => 'test_room'} Tinder::Campfire.stubs(:new).with('test', {:token => 'bad_token'}).returns(nil) @@ -50,4 +62,15 @@ e end end + + def fake_notification_without_backtrace + {:message => {:type => 'PasteMessage', + :body => "A new exception occurred: 'my custom error'" + } + } + end + + def fake_exception_without_backtrace + StandardError.new('my custom error') + end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/exception_notifier/email_notifier_test.rb new/test/exception_notifier/email_notifier_test.rb --- old/test/exception_notifier/email_notifier_test.rb 2015-06-09 16:51:23.000000000 +0200 +++ new/test/exception_notifier/email_notifier_test.rb 2015-12-04 21:45:42.000000000 +0100 @@ -149,4 +149,22 @@ assert_equal @ignored_exception.class.inspect, "ActiveRecord::RecordNotFound" assert_nil @ignored_mail end + + if defined?(Rails) && ('4.2'...'5.0').cover?(Rails.version) + test "should be able to specify ActionMailer::MessageDelivery method" do + email_notifier = ExceptionNotifier::EmailNotifier.new( + :email_prefix => '[Dummy ERROR] ', + :sender_address => %{"Dummy Notifier" <dummynotif...@example.com>}, + :exception_recipients => %w{dummyexcepti...@example.com}, + :deliver_with => :deliver_now + ) + # In Rails 4.2, it gives deprecation warning like "`#deliver` is + # deprecated and will be removed in Rails 5." when "#deliver" is + # used. If methods like "#deliver_now" is used, it should not + # give any warnings. + assert_silent do + email_notifier.call(@exception) + end + end + end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/exception_notifier/hipchat_notifier_test.rb new/test/exception_notifier/hipchat_notifier_test.rb --- old/test/exception_notifier/hipchat_notifier_test.rb 2015-06-09 16:51:23.000000000 +0200 +++ new/test/exception_notifier/hipchat_notifier_test.rb 2015-12-04 21:45:42.000000000 +0100 @@ -16,6 +16,19 @@ hipchat.call(fake_exception) end + test "should send hipchat notification without backtrace info if properly configured" do + options = { + :api_token => 'good_token', + :room_name => 'room_name', + :color => 'yellow', + } + + HipChat::Room.any_instance.expects(:send).with('Exception', fake_body_without_backtrace, { :color => 'yellow' }) + + hipchat = ExceptionNotifier::HipchatNotifier.new(options) + hipchat.call(fake_exception_without_backtrace) + end + test "should allow custom from value if set" do options = { :api_token => 'good_token', @@ -111,4 +124,12 @@ e end end + + def fake_body_without_backtrace + "A new exception occurred: '#{fake_exception_without_backtrace.message}'" + end + + def fake_exception_without_backtrace + StandardError.new('my custom error') + end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/exception_notifier/irc_notifier_test.rb new/test/exception_notifier/irc_notifier_test.rb --- old/test/exception_notifier/irc_notifier_test.rb 2015-06-09 16:51:23.000000000 +0200 +++ new/test/exception_notifier/irc_notifier_test.rb 2015-12-04 21:45:42.000000000 +0100 @@ -16,6 +16,19 @@ irc.call(fake_exception) end + test "should send irc notification without backtrace info if properly configured" do + options = { + :domain => 'irc.example.com' + } + + CarrierPigeon.expects(:send).with(has_key(:uri)) do |v| + /my custom error/.match(v[:message]) + end + + irc = ExceptionNotifier::IrcNotifier.new(options) + irc.call(fake_exception_without_backtrace) + end + test "should properly construct URI from constituent parts" do options = { :nick => 'BadNewsBot', @@ -82,4 +95,8 @@ e end end + + def fake_exception_without_backtrace + StandardError.new('my custom error') + end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/exception_notifier/slack_notifier_test.rb new/test/exception_notifier/slack_notifier_test.rb --- old/test/exception_notifier/slack_notifier_test.rb 2015-06-09 16:51:23.000000000 +0200 +++ new/test/exception_notifier/slack_notifier_test.rb 2015-12-04 21:45:42.000000000 +0100 @@ -14,19 +14,30 @@ webhook_url: "http://slack.webhook.url" } - Slack::Notifier.any_instance.expects(:ping).with(fake_notification, {}) + Slack::Notifier.any_instance.expects(:ping).with('', fake_notification) slack_notifier = ExceptionNotifier::SlackNotifier.new(options) slack_notifier.call(@exception) end + test "should send a slack notification without backtrace info if properly configured" do + options = { + webhook_url: "http://slack.webhook.url" + } + + Slack::Notifier.any_instance.expects(:ping).with('', fake_notification(fake_exception_without_backtrace)) + + slack_notifier = ExceptionNotifier::SlackNotifier.new(options) + slack_notifier.call(fake_exception_without_backtrace) + end + test "should send the notification to the specified channel" do options = { webhook_url: "http://slack.webhook.url", channel: "channel" } - Slack::Notifier.any_instance.expects(:ping).with(fake_notification, {}) + Slack::Notifier.any_instance.expects(:ping).with('', fake_notification) slack_notifier = ExceptionNotifier::SlackNotifier.new(options) slack_notifier.call(@exception) @@ -40,7 +51,7 @@ username: "username" } - Slack::Notifier.any_instance.expects(:ping).with(fake_notification, {}) + Slack::Notifier.any_instance.expects(:ping).with('', fake_notification) slack_notifier = ExceptionNotifier::SlackNotifier.new(options) slack_notifier.call(@exception) @@ -58,7 +69,7 @@ } } - Slack::Notifier.any_instance.expects(:ping).with(fake_notification, {icon_url: "icon"}) + Slack::Notifier.any_instance.expects(:ping).with('', options[:additional_parameters].merge(fake_notification) ) slack_notifier = ExceptionNotifier::SlackNotifier.new(options) slack_notifier.call(@exception) @@ -70,7 +81,7 @@ slack_notifier = ExceptionNotifier::SlackNotifier.new(options) assert_nil slack_notifier.notifier - assert_nil slack_notifier.call(fake_exception) + assert_nil slack_notifier.call(@exception) end test "should pass along environment data" do @@ -92,9 +103,9 @@ } } - expected_data_string = 'foo: bar, john: doe, user_id: 5' + expected_data_string = "foo: bar\njohn: doe\nuser_id: 5" - Slack::Notifier.any_instance.expects(:ping).with(fake_notification(@exception, expected_data_string), {}) + Slack::Notifier.any_instance.expects(:ping).with('', fake_notification(@exception, expected_data_string)) slack_notifier = ExceptionNotifier::SlackNotifier.new(options) slack_notifier.call(@exception, notification_options) end @@ -109,9 +120,18 @@ end end + def fake_exception_without_backtrace + StandardError.new('my custom error') + end + def fake_notification(exception=@exception, data_string=nil) - message = "An exception occurred: '#{exception.message}' on '#{exception.backtrace.first}'\n" - message += "*Data:*\n#{data_string}\n" unless data_string.nil? - message += "*Backtrace:*\n" + exception.backtrace.join("\n") + text = "*An exception occurred while doing*: ` <>`\n" + + fields = [ { title: 'Exception', value: exception.message} ] + fields.push({ title: 'Backtrace', value: "```backtrace line 1\nbacktrace line 2```" }) if exception.backtrace + fields.push({ title: 'Data', value: "```#{data_string}```" }) if data_string + + { attachments: [ color: 'danger', text: text, fields: fields, mrkdwn_in: %w(text fields) ] } end + end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/test_helper.rb new/test/test_helper.rb --- old/test/test_helper.rb 2015-06-09 16:51:23.000000000 +0200 +++ new/test/test_helper.rb 2015-12-04 21:45:42.000000000 +0100 @@ -15,3 +15,4 @@ require "mocha/setup" Rails.backtrace_cleaner.remove_silencers! +