diff --git a/init.rb b/init.rb index 7c16c46..0fb04fc 100644 --- a/init.rb +++ b/init.rb @@ -1 +1,31 @@ -require File.dirname(__FILE__) + "/rails/init" +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 diff --git a/rails/init.rb b/rails/init.rb index 0fb04fc..48087f0 100644 --- a/rails/init.rb +++ b/rails/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__) + "/../init"