Skip to content
This repository has been archived by the owner on Jun 8, 2019. 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"
end

desc 'Test the hoptoad_notifier gem.'
desc 'Test the airbrake gem.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
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."
task :bump, :part do |t, args|
# Thanks, Jeweler!
if HoptoadNotifier::VERSION =~ /^(\d+)\.(\d+)\.(\d+)(?:\.(.*?))?$/
if Airbrake::VERSION =~ /^(\d+)\.(\d+)\.(\d+)(?:\.(.*?))?$/
major = $1.to_i
minor = $2.to_i
patch = $3.to_i
Expand All @@ -48,9 +48,9 @@ namespace :changeling do

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
module HoptoadNotifier
module Airbrake
VERSION = "#{version}".freeze
end
EOF
Expand All @@ -59,10 +59,10 @@ EOF

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

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 -*-
$:.push File.expand_path("../lib", __FILE__)
require "hoptoad_notifier/version"
require "airbrake/version"

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

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

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

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

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 configure the Hoptoad shim
And I configure my application to require the "hoptoad_notifier" gem
And I run "script/generate hoptoad -k myapikey"
And I configure the Airbrake shim
And I configure my application to require the "airbrake" gem
And I run "script/generate airbrake -k myapikey"

Scenario: Rescue an exception in the dispatcher
When I define a Metal endpoint called "Exploder":
Expand All @@ -15,7 +15,7 @@ Feature: Rescue errors in Rails middleware
end
"""
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 class | RuntimeError |
| 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

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
Given the following Rack app:
"""
require 'rack'
require 'hoptoad_notifier'
require 'airbrake'
HoptoadNotifier.configure do |config|
Airbrake.configure do |config|
config.api_key = 'my_api_key'
end
app = Rack::Builder.app do
use HoptoadNotifier::Rack
use Airbrake::Rack
run lambda { |env| raise "Rack down" }
end
"""
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 class | RuntimeError |
| parameters | param: value |
Expand Down

0 comments on commit ceb0feb

Please sign in to comment.