Setup init.rb to work as a Rails GemPlugin

This commit is contained in:
Eric Davis
2009-10-13 20:47:28 -07:00
parent 31e3f2be9d
commit 23820188b4
2 changed files with 32 additions and 31 deletions

32
init.rb
View File

@@ -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"

31
rails/init.rb Normal file
View File

@@ -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