From 23820188b42342d749e042293470469fd24ccc19 Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Tue, 13 Oct 2009 20:47:28 -0700 Subject: [PATCH] Setup init.rb to work as a Rails GemPlugin --- init.rb | 32 +------------------------------- rails/init.rb | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 31 deletions(-) create mode 100644 rails/init.rb diff --git a/init.rb b/init.rb index 0fb04fc..7c16c46 100644 --- a/init.rb +++ b/init.rb @@ -1,31 +1 @@ -require 'redmine' - -# Patches to the Redmine core -require 'dispatcher' - -Dispatcher.to_prepare do - require_dependency 'users_helper' - require 'rate_sort_helper_patch' - require 'rate_time_entry_patch' - require 'rate_users_helper_patch' - SortHelper.send(:include, RateSortHelperPatch) - TimeEntry.send(:include, RateTimeEntryPatch) - UsersHelper.send(:include, RateUsersHelperPatch) -end - -# Hooks -require 'rate_project_hook' -require 'rate_memberships_hook' - -Redmine::Plugin.register :redmine_rate do - name 'Rate Plugin' - author 'Eric Davis' - url 'https://projects.littlestreamsoftware.com/projects/show/redmine-rate' - author_url 'http://www.littlestreamsoftware.com' - description "The Rate plugin provides an API that can be used to find the rate for a Member of a Project at a specific date. It also stores historical rate data so calculations will remain correct in the future." - version '0.1.0' - - requires_redmine :version_or_higher => '0.8.0' - - permission :view_rate, { } -end +require File.dirname(__FILE__) + "/rails/init" diff --git a/rails/init.rb b/rails/init.rb new file mode 100644 index 0000000..0fb04fc --- /dev/null +++ b/rails/init.rb @@ -0,0 +1,31 @@ +require 'redmine' + +# Patches to the Redmine core +require 'dispatcher' + +Dispatcher.to_prepare do + require_dependency 'users_helper' + require 'rate_sort_helper_patch' + require 'rate_time_entry_patch' + require 'rate_users_helper_patch' + SortHelper.send(:include, RateSortHelperPatch) + TimeEntry.send(:include, RateTimeEntryPatch) + UsersHelper.send(:include, RateUsersHelperPatch) +end + +# Hooks +require 'rate_project_hook' +require 'rate_memberships_hook' + +Redmine::Plugin.register :redmine_rate do + name 'Rate Plugin' + author 'Eric Davis' + url 'https://projects.littlestreamsoftware.com/projects/show/redmine-rate' + author_url 'http://www.littlestreamsoftware.com' + description "The Rate plugin provides an API that can be used to find the rate for a Member of a Project at a specific date. It also stores historical rate data so calculations will remain correct in the future." + version '0.1.0' + + requires_redmine :version_or_higher => '0.8.0' + + permission :view_rate, { } +end