Permalink
Browse files

upgrading hoptoad notifier to gem version 2.1

  • Loading branch information...
1 parent 2f9b8b8 commit ee79a99051e899081e973f161b0d812a9fa7e610 @jgilliam committed Jan 20, 2010
Showing with 14 additions and 3,620 deletions.
  1. +1 −0 .gems
  2. +1 −0 .gitignore
  3. +1 −0 config/environment.rb
  4. +6 −0 lib/tasks/fix.rake
  5. +5 −0 lib/tasks/hoptoad_notifier_tasks.rake
  6. +0 −3 vendor/plugins/hoptoad_notifier/.yardopts
  7. +0 −22 vendor/plugins/hoptoad_notifier/MIT-LICENSE
  8. +0 −228 vendor/plugins/hoptoad_notifier/README.rdoc
  9. +0 −29 vendor/plugins/hoptoad_notifier/Rakefile
  10. +0 −8 vendor/plugins/hoptoad_notifier/TESTING.rdoc
  11. +0 −31 vendor/plugins/hoptoad_notifier/ginger_scenarios.rb
  12. +0 −1 vendor/plugins/hoptoad_notifier/install.rb
  13. +0 −139 vendor/plugins/hoptoad_notifier/lib/hoptoad_notifier.rb
  14. +0 −99 vendor/plugins/hoptoad_notifier/lib/hoptoad_notifier/backtrace.rb
  15. +0 −76 vendor/plugins/hoptoad_notifier/lib/hoptoad_notifier/catcher.rb
  16. +0 −229 vendor/plugins/hoptoad_notifier/lib/hoptoad_notifier/configuration.rb
  17. +0 −276 vendor/plugins/hoptoad_notifier/lib/hoptoad_notifier/notice.rb
  18. +0 −63 vendor/plugins/hoptoad_notifier/lib/hoptoad_notifier/sender.rb
  19. +0 −36 vendor/plugins/hoptoad_notifier/lib/hoptoad_tasks.rb
  20. +0 −91 vendor/plugins/hoptoad_notifier/lib/templates/rescue.erb
  21. +0 −8 vendor/plugins/hoptoad_notifier/rails/init.rb
  22. +0 −22 vendor/plugins/hoptoad_notifier/recipes/hoptoad.rb
  23. +0 −38 vendor/plugins/hoptoad_notifier/script/integration_test.rb
  24. +0 −84 vendor/plugins/hoptoad_notifier/tasks/hoptoad_notifier_tasks.rake
  25. +0 −94 vendor/plugins/hoptoad_notifier/test/backtrace_test.rb
  26. +0 −257 vendor/plugins/hoptoad_notifier/test/catcher_test.rb
  27. +0 −196 vendor/plugins/hoptoad_notifier/test/configuration_test.rb
  28. +0 −238 vendor/plugins/hoptoad_notifier/test/helper.rb
  29. +0 −76 vendor/plugins/hoptoad_notifier/test/hoptoad_2_0.xsd
  30. +0 −131 vendor/plugins/hoptoad_notifier/test/hoptoad_tasks_test.rb
  31. +0 −85 vendor/plugins/hoptoad_notifier/test/logger_test.rb
  32. +0 −342 vendor/plugins/hoptoad_notifier/test/notice_test.rb
  33. +0 −186 vendor/plugins/hoptoad_notifier/test/notifier_test.rb
  34. +0 −123 vendor/plugins/hoptoad_notifier/test/sender_test.rb
  35. +0 −1 vendor/plugins/hoptoad_notifier/vendor/ginger/.gitignore
  36. +0 −20 vendor/plugins/hoptoad_notifier/vendor/ginger/LICENCE
  37. +0 −50 vendor/plugins/hoptoad_notifier/vendor/ginger/README.textile
  38. +0 −57 vendor/plugins/hoptoad_notifier/vendor/ginger/Rakefile
  39. +0 −42 vendor/plugins/hoptoad_notifier/vendor/ginger/bin/ginger
  40. +0 −33 vendor/plugins/hoptoad_notifier/vendor/ginger/ginger.gemspec
  41. +0 −21 vendor/plugins/hoptoad_notifier/vendor/ginger/lib/ginger.rb
  42. +0 −20 vendor/plugins/hoptoad_notifier/vendor/ginger/lib/ginger/configuration.rb
  43. +0 −56 vendor/plugins/hoptoad_notifier/vendor/ginger/lib/ginger/kernel.rb
  44. +0 −24 vendor/plugins/hoptoad_notifier/vendor/ginger/lib/ginger/scenario.rb
  45. +0 −7 vendor/plugins/hoptoad_notifier/vendor/ginger/spec/ginger/configuration_spec.rb
  46. +0 −7 vendor/plugins/hoptoad_notifier/vendor/ginger/spec/ginger/kernel_spec.rb
  47. +0 −50 vendor/plugins/hoptoad_notifier/vendor/ginger/spec/ginger/scenario_spec.rb
  48. +0 −14 vendor/plugins/hoptoad_notifier/vendor/ginger/spec/ginger_spec.rb
  49. +0 −7 vendor/plugins/hoptoad_notifier/vendor/ginger/spec/spec_helper.rb
View
1 .gems
@@ -6,3 +6,4 @@ twitter-auth --version 0.1.21
liquid
dweinand-will_paginate --source 'http://gems.github.com'
facebooker --version 1.0.53
+hoptoad_notifier
View
@@ -8,3 +8,4 @@ config/database.yml*
config/facebooker.yml
config/s3.yml
solr/index
+solr/*.pid
View
@@ -23,6 +23,7 @@
config.gem 'liquid'
config.gem 'dweinand-will_paginate', :lib => 'will_paginate', :source => 'http://gems.github.com/'
config.gem 'facebooker', :version => '1.0.53'
+ config.gem 'hoptoad_notifier'
#config.gem 'curb', :version => '0.1.4'
# Settings in config/environments/* take precedence over those specified here.
View
@@ -1,4 +1,10 @@
namespace :fix do
+
+ desc "delete activities that don't have objects which are now nil"
+ task :abandoned_activities => :environment do
+ # not sure if this works yet
+ activities = Activity.find_by_sql("SELECT * from activities where NOT EXISTS (select * from users where activities.other_user_id = users.id or activities.other_user_id is null)")
+ end
desc "fix default branches for users"
task :default_branch => :environment do
@@ -0,0 +1,5 @@
+Dir[File.join(RAILS_ROOT, 'vendor', 'gems', 'hoptoad_notifier-*')].each do |vendored_notifier|
+ $: << File.join(vendored_notifier, 'lib')
+end
+
+require 'hoptoad_notifier/tasks'
@@ -1,3 +0,0 @@
--
-TESTING.rdoc
-MIT-LICENSE
@@ -1,22 +0,0 @@
-Copyright (c) 2007, Tammer Saleh, Thoughtbot, Inc.
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
@@ -1,228 +0,0 @@
-= HoptoadNotifier
-
-This is the notifier plugin for integrating apps with Hoptoad.
-
-When an uncaught exception occurs, HoptoadNotifier will POST the relevant data
-to the Hoptoad server specified in your environment.
-
-== Help
-
-* {IRC}[irc://irc.freenode.net/thoughtbot]
-* {mailing list}[http://groups.google.com/group/hoptoad-notifier-dev]
-
-== Installation
-
-=== Remove exception_notifier
-
-in your ApplicationController, REMOVE this line:
-
- include ExceptionNotifiable
-
-In your config/environment* files, remove all references to ExceptionNotifier
-
-Remove the vendor/plugins/exception_notifier directory.
-
-=== Install hoptoad_notifier
-
-from your project's RAILS_ROOT, run:
-
- script/plugin install git://github.com/thoughtbot/hoptoad_notifier.git
-
-=== Configuration
-
-you should have something like this in config/initializers/hoptoad.rb.
-
- HoptoadNotifier.configure do |config|
- config.api_key = '1234567890abcdef'
- end
-
-(Please note that this configuration should be in a global configuration, and
-is *not* environment-specific. Hoptoad is smart enough to know what errors are
-caused by what environments, so your staging errors don't get mixed in with
-your production errors.)
-
-After adding to your config/initializers like this you must restart your
-server. This will not affect the rake task but it bears stating.
-
-That should be it! Now all exceptions will be logged to Hoptoad where they can
-be aggregated, filtered, sorted, analyzed, massaged, and searched. In previous
-releases you had to include HoptoadNotifier::Catcher into your
-ApplicationController, but the plugin takes care of that now.
-
-You can test that Hoptoad is working in your production environment by using
-this rake task (from RAILS_ROOT):
-
- rake hoptoad:test
-
-If everything is configured properly, that task will send a notice to Hoptoad
-which will be visible immediately.
-
-=== NOTE FOR RAILS 1.2.* USERS:
-
-You will need to copy the hoptoad_notifier_tasks.rake file into your
-RAILS_ROOT/lib/tasks directory in order for the rake hoptoad:test task to work.
-
-== Usage
-
-for the most part, Hoptoad works for itself. Once you've included the notifier
-in your ApplicationController (which is now done automatically by the plugin),
-all errors will be rescued by the #rescue_action_in_public provided by the plugin.
-
-If you want to log arbitrary things which you've rescued yourself from a
-controller, you can do something like this:
-
- ...
- rescue => ex
- notify_hoptoad(ex)
- flash[:failure] = 'Encryptions could not be rerouted, try again.'
- end
- ...
-
-The #notify_hoptoad call will send the notice over to Hoptoad for later analysis. While in your controllers you use the notify_hoptoad method, anywhere else in your code, use HoptoadNotifier.notify.
-
-To perform custom error processing after Hoptoad has been notified, define the instance method #rescue_action_in_public_without_hoptoad(exception) in your controller.
-
-== Tracking deployments in Hoptoad
-
-Paying Hoptoad plans support the ability to track deployments of your application in Hoptoad.
-By notifying Hoptoad of your application deployments, all errors are resolved when a deploy occurs,
-so that you'll be notified again about any errors that reoccur after a deployment.
-
-Additionally, it's possible to review the errors in Hoptoad that occurred before and after a deploy.
-
-When Hoptoad is installed as a plugin this functionality is loaded automatically (if you have Capistrano version 2.0.0 or greater).
-
-When Hoptoad is installed as a gem, you need to add
-
- require 'hoptoad_notifier/recipes/hoptoad'
-
-to your deploy.rb
-
-== Going beyond exceptions
-
-You can also pass a hash to notify_hoptoad method and store whatever you want, not just an exception. And you can also use it anywhere, not just in controllers:
-
- begin
- params = {
- # params that you pass to a method that can throw an exception
- }
- my_unpredicable_method(params)
- rescue => e
- HoptoadNotifier.notify(
- :error_class => "Special Error",
- :error_message => "Special Error: #{e.message}",
- :request => { :params => params }
- )
- end
-
-While in your controllers you use the notify_hoptoad method, anywhere else in your code, use HoptoadNotifier.notify. Hoptoad will get all the information about the error itself. As for a hash, these are the keys you should pass:
-
-* :error_class – Use this to group similar errors together. When Hoptoad catches an exception it sends the class name of that exception object.
-* :error_message – This is the title of the error you see in the errors list. For exceptions it is "#{exception.class.name}: #{exception.message}"
-* :request – While there are several ways to send additional data to Hoptoad, passing a Hash with :params key as :request as in the example above is the most common use case. When Hoptoad catches an exception in a controller, the actual HTTP client request is being sent using this key.
-
-Hoptoad merges the hash you pass with these default options:
-
- def default_notice_options
- {
- :api_key => HoptoadNotifier.api_key,
- :error_message => 'Notification',
- :backtrace => caller,
- :request => {},
- :session => {}
- }
- end
-
-You can override any of those parameters.
-
-== Filtering
-
-You can specify a whitelist of errors, that Hoptoad will not report on. Use
-this feature when you are so apathetic to certain errors that you don't want
-them even logged.
-
-This filter will only be applied to automatic notifications, not manual
-notifications (when #notify is called directly).
-
-Hoptoad ignores the following exceptions by default:
-
- ActiveRecord::RecordNotFound
- ActionController::RoutingError
- ActionController::InvalidAuthenticityToken
- ActionController::UnknownAction
- CGI::Session::CookieStore::TamperedWithCookie
-
-To ignore errors in addition to those, specify their names in your Hoptoad
-configuration block.
-
- HoptoadNotifier.configure do |config|
- config.api_key = '1234567890abcdef'
- config.ignore << ActiveRecord::IgnoreThisError
- end
-
-To ignore *only* certain errors (and override the defaults), use the
-#ignore_only attribute.
-
- HoptoadNotifier.configure do |config|
- config.api_key = '1234567890abcdef'
- config.ignore_only = [ActiveRecord::IgnoreThisError]
- end
-
-To ignore certain user agents, add in the #ignore_user_agent attribute as a
-string or regexp:
-
- HoptoadNotifier.configure do |config|
- config.api_key = '1234567890abcdef'
- config.ignore_user_agent << /Ignored/
- config.ignore_user_agent << 'IgnoredUserAgent'
- end
-
-To ignore exceptions based on other conditions, use #ignore_by_filter:
-
- HoptoadNotifier.configure do |config|
- config.api_key = '1234567890abcdef'
- config.ignore_by_filter do |exception_data|
- true if exception_data[:error_class] == "RuntimeError"
- end
- end
-
-To replace sensitive information sent to the Hoptoad service with [FILTERED] use #params_filters:
-
- HoptoadNotifier.configure do |config|
- config.api_key = '1234567890abcdef'
- config.params_filters << "credit_card_number"
- end
-
-Note that, when rescuing exceptions within an ActionController method,
-hoptoad_notifier will reuse filters specified by #filter_params_logging.
-
-== Testing
-
-When you run your tests, you might notice that the Hoptoad service is recording
-notices generated using #notify when you don't expect it to. You can
-use code like this in your test_helper.rb to redefine that method so those
-errors are not reported while running tests.
-
- module HoptoadNotifier::Catcher
- def notify(thing)
- # do nothing.
- end
- end
-
-== Supported rails versions
-
-the notifier currently supports the following versions of Rails:
-
-* 1.2.6
-* 2.0.2
-* 2.1.2
-* 2.2.2
-* 2.3.2
-* 2.3.3
-* 2.3.4
-
-Please open up a support ticket on Tender ( http://help.hoptoadapp.com ) if you're using a version of Rails that is not listed above and the notifier is not working properly.
-
-== Thanks
-
-Thanks to Eugene Bolshakov for the excellent write-up on GOING BEYOND EXCEPTIONS, which we have included above.
@@ -1,29 +0,0 @@
-require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-
-desc 'Default: run unit tests.'
-task :default => :test
-
-desc 'Test the hoptoad_notifier plugin.'
-Rake::TestTask.new(:test) do |t|
- t.libs << 'lib'
- t.pattern = 'test/**/*_test.rb'
- t.verbose = true
-end
-
-desc 'Run ginger tests'
-task :ginger do
- $LOAD_PATH << File.join(*%w[vendor ginger lib])
- ARGV.clear
- ARGV << 'test'
- load File.join(*%w[vendor ginger bin ginger])
-end
-
-begin
- require 'yard'
- YARD::Rake::YardocTask.new do |t|
- t.files = ['lib/**/*.rb', 'TESTING.rdoc']
- end
-rescue LoadError
-end
@@ -1,8 +0,0 @@
-= For Maintainers:
-
-When developing the Hoptoad Notifier, be sure to use the integration test
-against an existing project on staging before pushing to master.
-
-+./script/integration_test.rb <test project's api key> <staging server hostname>+
-
-+./script/integration_test.rb <test project's api key> <staging server hostname> secure+
@@ -1,31 +0,0 @@
-require 'ginger'
-
-def create_scenario(version)
- scenario = Ginger::Scenario.new
- scenario[/^active_?support$/] = version
- scenario[/^active_?record$/] = version
- scenario[/^action_?pack$/] = version
- scenario[/^action_?controller$/] = version
- scenario
-end
-
-Ginger.configure do |config|
- config.aliases["active_record"] = "activerecord"
- config.aliases["active_support"] = "activesupport"
- config.aliases["action_controller"] = "actionpack"
-
- rails_1_2_6 = Ginger::Scenario.new
- rails_1_2_6[/^active_?support$/] = "1.4.4"
- rails_1_2_6[/^active_?record$/] = "1.15.6"
- rails_1_2_6[/^action_?pack$/] = "1.13.6"
- rails_1_2_6[/^action_?controller$/] = "1.13.6"
-
- config.scenarios << rails_1_2_6
- config.scenarios << create_scenario("2.0.2")
- config.scenarios << create_scenario("2.1.2")
- config.scenarios << create_scenario("2.2.2")
- config.scenarios << create_scenario("2.3.2")
- # Rails 2.3.3 has broken params filtering
- # config.scenarios << create_scenario("2.3.3")
- config.scenarios << create_scenario("2.3.4")
-end
@@ -1 +0,0 @@
-puts IO.read(File.join(File.dirname(__FILE__), 'INSTALL'))
Oops, something went wrong.

0 comments on commit ee79a99

Please sign in to comment.