Skip to content
This repository has been archived by the owner on Nov 11, 2017. It is now read-only.

Commit

Permalink
WIP: Hoptoad -> Airbrake
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Yurek committed Aug 11, 2011
1 parent 02220b1 commit ceb0feb
Show file tree
Hide file tree
Showing 65 changed files with 759 additions and 746 deletions.
12 changes: 6 additions & 6 deletions Rakefile
Expand Up @@ -16,7 +16,7 @@ task :clean do
exec "rm -rf tmp" exec "rm -rf tmp"
end end


desc 'Test the hoptoad_notifier gem.' desc 'Test the airbrake gem.'
Rake::TestTask.new(:test) do |t| Rake::TestTask.new(:test) do |t|
t.libs << 'lib' t.libs << 'lib'
t.pattern = 'test/**/*_test.rb' t.pattern = 'test/**/*_test.rb'
Expand All @@ -27,7 +27,7 @@ namespace :changeling do
desc "Bumps the version by a minor or patch version, depending on what was passed in." desc "Bumps the version by a minor or patch version, depending on what was passed in."
task :bump, :part do |t, args| task :bump, :part do |t, args|
# Thanks, Jeweler! # Thanks, Jeweler!
if HoptoadNotifier::VERSION =~ /^(\d+)\.(\d+)\.(\d+)(?:\.(.*?))?$/ if Airbrake::VERSION =~ /^(\d+)\.(\d+)\.(\d+)(?:\.(.*?))?$/
major = $1.to_i major = $1.to_i
minor = $2.to_i minor = $2.to_i
patch = $3.to_i patch = $3.to_i
Expand All @@ -48,9 +48,9 @@ namespace :changeling do


version = [major, minor, patch, build].compact.join('.') version = [major, minor, patch, build].compact.join('.')


File.open(File.join("lib", "hoptoad_notifier", "version.rb"), "w") do |f| File.open(File.join("lib", "airbrake", "notifier", "version.rb"), "w") do |f|
f.write <<EOF f.write <<EOF
module HoptoadNotifier module Airbrake
VERSION = "#{version}".freeze VERSION = "#{version}".freeze
end end
EOF EOF
Expand All @@ -59,10 +59,10 @@ EOF


desc "Writes out the new CHANGELOG and prepares the release" desc "Writes out the new CHANGELOG and prepares the release"
task :change do task :change do
load 'lib/hoptoad_notifier/version.rb' load 'lib/airbrake/version.rb'
file = "CHANGELOG" file = "CHANGELOG"
old = File.read(file) old = File.read(file)
version = HoptoadNotifier::VERSION version = Airbrake::VERSION
message = "Bumping to version #{version}" message = "Bumping to version #{version}"


File.open(file, "w") do |f| File.open(file, "w") do |f|
Expand Down
10 changes: 5 additions & 5 deletions hoptoad_notifier.gemspec → airbrake.gemspec
@@ -1,10 +1,10 @@
# -*- encoding: utf-8 -*- # -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__) $:.push File.expand_path("../lib", __FILE__)
require "hoptoad_notifier/version" require "airbrake/version"


Gem::Specification.new do |s| Gem::Specification.new do |s|
s.name = %q{hoptoad_notifier} s.name = %q{airbrake}
s.version = HoptoadNotifier::VERSION.dup s.version = Airbrake::VERSION.dup
s.summary = %q{Send your application errors to our hosted service and reclaim your inbox.} s.summary = %q{Send your application errors to our hosted service and reclaim your inbox.}


s.require_paths = ["lib"] s.require_paths = ["lib"]
Expand All @@ -26,8 +26,8 @@ Gem::Specification.new do |s|
s.add_development_dependency("shoulda", "~> 2.11.3") s.add_development_dependency("shoulda", "~> 2.11.3")


s.authors = ["thoughtbot, inc"] s.authors = ["thoughtbot, inc"]
s.email = %q{support@hoptoadapp.com} s.email = %q{support@airbrakeapp.com}
s.homepage = "http://www.hoptoadapp.com" s.homepage = "http://www.airbrakeapp.com"


s.platform = Gem::Platform::RUBY s.platform = Gem::Platform::RUBY
end end
10 changes: 5 additions & 5 deletions features/metal.feature
@@ -1,11 +1,11 @@
Feature: Rescue errors in Rails middleware Feature: Rescue errors in Rails middleware


Background: Background:
Given I have built and installed the "hoptoad_notifier" gem Given I have built and installed the "airbrake" gem
And I generate a new Rails application And I generate a new Rails application
And I configure the Hoptoad shim And I configure the Airbrake shim
And I configure my application to require the "hoptoad_notifier" gem And I configure my application to require the "airbrake" gem
And I run "script/generate hoptoad -k myapikey" And I run "script/generate airbrake -k myapikey"


Scenario: Rescue an exception in the dispatcher Scenario: Rescue an exception in the dispatcher
When I define a Metal endpoint called "Exploder": When I define a Metal endpoint called "Exploder":
Expand All @@ -15,7 +15,7 @@ Feature: Rescue errors in Rails middleware
end end
""" """
When I perform a request to "http://example.com:123/metal/index?param=value" When I perform a request to "http://example.com:123/metal/index?param=value"
Then I should receive the following Hoptoad notification: Then I should receive the following Airbrake notification:
| error message | RuntimeError: Explode | | error message | RuntimeError: Explode |
| error class | RuntimeError | | error class | RuntimeError |
| parameters | param: value | | parameters | param: value |
Expand Down
10 changes: 5 additions & 5 deletions features/rack.feature
@@ -1,25 +1,25 @@
Feature: Use the notifier in a plain Rack app Feature: Use the notifier in a plain Rack app


Background: Background:
Given I have built and installed the "hoptoad_notifier" gem Given I have built and installed the "airbrake" gem


Scenario: Rescue and exception in a Rack app Scenario: Rescue and exception in a Rack app
Given the following Rack app: Given the following Rack app:
""" """
require 'rack' require 'rack'
require 'hoptoad_notifier' require 'airbrake'
HoptoadNotifier.configure do |config| Airbrake.configure do |config|
config.api_key = 'my_api_key' config.api_key = 'my_api_key'
end end
app = Rack::Builder.app do app = Rack::Builder.app do
use HoptoadNotifier::Rack use Airbrake::Rack
run lambda { |env| raise "Rack down" } run lambda { |env| raise "Rack down" }
end end
""" """
When I perform a Rack request to "http://example.com:123/test/index?param=value" When I perform a Rack request to "http://example.com:123/test/index?param=value"
Then I should receive the following Hoptoad notification: Then I should receive the following Airbrake notification:
| error message | RuntimeError: Rack down | | error message | RuntimeError: Rack down |
| error class | RuntimeError | | error class | RuntimeError |
| parameters | param: value | | parameters | param: value |
Expand Down

0 comments on commit ceb0feb

Please sign in to comment.