-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
22 additions
and
26 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,7 @@ | ||
ActionController::Routing::Routes.draw do |map| | ||
|
||
map.with_options(:controller => 'notices', :method => :post) do |m| | ||
m.connect 'notices', :action => 'index' # API v1 (hoptoad) | ||
m.connect 'notifier_api/v2/notices', :action => 'index_v2' # API v2 (hoptoad / airbrake, xml based) | ||
end | ||
# API v1 (hoptoad) | ||
post 'notices', :to => 'notices#index' | ||
|
||
if Rails.env == 'test' | ||
# route without the :method => :post requirement since otherwise the route is | ||
# not recognized in the functional test. dont know why though... | ||
map.connect '/notices/index_v2', :controller => 'notices', :action => 'index_v2' | ||
end | ||
# API v2 (hoptoad / airbrake, xml based) | ||
post 'notifier_api/v2/notices', :to => 'notices#index_v2' | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,18 @@ | ||
require 'redmine' | ||
require 'dispatcher' | ||
Redmine::Plugin.register :redmine_hoptoad_server do | ||
name 'Redmine Hoptoad Server plugin' | ||
author 'Jan Schulz-Hofen, Planio GmbH' | ||
description 'Turns Redmine into an Airbrake / Hoptoad compatible server, i.e. an API provider which can be used with the Airbrake gem / hoptoad_notifier plugin. See http://github.com/yeah/redmine_hoptoad_server' | ||
version '0.0.1' | ||
end | ||
|
||
begin | ||
gem 'nokogiri' | ||
require 'nokogiri' | ||
rescue LoadError | ||
Rails.logger.error "Nokogiri gem not found, parsing hoptoad API v2 requests will be sub-optimal" | ||
end | ||
|
||
Dispatcher.to_prepare do | ||
Issue.send(:include, RedmineHoptoadServer::Patches::IssuePatch) unless Issue.include?(RedmineHoptoadServer::Patches::IssuePatch) | ||
IssueObserver.send(:include, RedmineHoptoadServer::Patches::IssueObserverPatch) unless IssueObserver.include?(RedmineHoptoadServer::Patches::IssueObserverPatch) | ||
Rails.configuration.to_prepare do | ||
require_dependency 'redmine_hoptoad_server/patches/issue_patch' | ||
require_dependency 'redmine_hoptoad_server/patches/issue_observer_patch' | ||
end | ||
|
||
Redmine::Plugin.register :redmine_hoptoad_server do | ||
name 'Redmine Hoptoad Server plugin' | ||
author 'Jan Schulz-Hofen, Planio GmbH' | ||
description 'Turns Redmine into a Hoptoad server, i.e. an API provider which can be used with the hoptoad_notifier. See http://github.com/yeah/redmine_hoptoad_server' | ||
version '0.0.1' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters