Skip to content
Browse files

Move the init back into init.rb and use rails/init.rb to wrap.

  • Loading branch information...
1 parent e526a76 commit 5c08188362acc8ffdd74e714231f841575b2cb86 @edavis10 committed Feb 25, 2010
Showing with 40 additions and 41 deletions.
  1. +39 −1 init.rb
  2. +1 −40 rails/init.rb
View
40 init.rb
@@ -1,2 +1,40 @@
-require File.dirname(__FILE__) + "/rails/init"
+require 'redmine'
+require 'dispatcher'
+Dispatcher.to_prepare :timesheet_plugin do
+ # Needed for the compatibility check
+ begin
+ require_dependency 'time_entry_activity'
+ rescue LoadError
+ # TimeEntryActivity is not available
+ end
+end
+
+
+unless Redmine::Plugin.registered_plugins.keys.include?(:timesheet_plugin)
+ Redmine::Plugin.register :timesheet_plugin do
+ name 'Timesheet Plugin'
+ author 'Eric Davis of Little Stream Software'
+ description 'This is a Timesheet plugin for Redmine to show timelogs for all projects'
+ url 'https://projects.littlestreamsoftware.com/projects/redmine-timesheet'
+ author_url 'http://www.littlestreamsoftware.com'
+
+ version '0.5.0'
+ requires_redmine :version_or_higher => '0.8.0'
+
+ settings :default => {'list_size' => '5', 'precision' => '2'}, :partial => 'settings/timesheet_settings'
+
+ permission :see_project_timesheets, { }, :require => :member
+
+ menu(:top_menu,
+ :timesheet,
+ {:controller => 'timesheet', :action => 'index'},
+ :caption => :timesheet_title,
+ :if => Proc.new {
+ User.current.allowed_to?(:see_project_timesheets, nil, :global => true) ||
+ User.current.allowed_to?(:view_time_entries, nil, :global => true) ||
+ User.current.admin?
+ })
+
+ end
+end
View
41 rails/init.rb
@@ -1,40 +1 @@
-require 'redmine'
-
-require 'dispatcher'
-Dispatcher.to_prepare :timesheet_plugin do
- # Needed for the compatibility check
- begin
- require_dependency 'time_entry_activity'
- rescue LoadError
- # TimeEntryActivity is not available
- end
-end
-
-
-unless Redmine::Plugin.registered_plugins.keys.include?(:timesheet_plugin)
- Redmine::Plugin.register :timesheet_plugin do
- name 'Timesheet Plugin'
- author 'Eric Davis of Little Stream Software'
- description 'This is a Timesheet plugin for Redmine to show timelogs for all projects'
- url 'https://projects.littlestreamsoftware.com/projects/redmine-timesheet'
- author_url 'http://www.littlestreamsoftware.com'
-
- version '0.5.0'
- requires_redmine :version_or_higher => '0.8.0'
-
- settings :default => {'list_size' => '5', 'precision' => '2'}, :partial => 'settings/timesheet_settings'
-
- permission :see_project_timesheets, { }, :require => :member
-
- menu(:top_menu,
- :timesheet,
- {:controller => 'timesheet', :action => 'index'},
- :caption => :timesheet_title,
- :if => Proc.new {
- User.current.allowed_to?(:see_project_timesheets, nil, :global => true) ||
- User.current.allowed_to?(:view_time_entries, nil, :global => true) ||
- User.current.admin?
- })
-
- end
-end
+require File.dirname(__FILE__) + "/../init"

0 comments on commit 5c08188

Please sign in to comment.
Something went wrong with that request. Please try again.