[DRE-commits] r4852 - trunk/redmine/debian/patches
Jérémy Lal
kapouer-guest at alioth.debian.org
Sun Feb 28 18:33:33 UTC 2010
Author: kapouer-guest
Date: 2010-02-28 18:33:29 +0000 (Sun, 28 Feb 2010)
New Revision: 4852
Modified:
trunk/redmine/debian/patches/0018-engines-rails2.2.patch
Log:
Correct the plugin controllers paths
Modified: trunk/redmine/debian/patches/0018-engines-rails2.2.patch
===================================================================
--- trunk/redmine/debian/patches/0018-engines-rails2.2.patch 2010-02-28 16:31:55 UTC (rev 4851)
+++ trunk/redmine/debian/patches/0018-engines-rails2.2.patch 2010-02-28 18:33:29 UTC (rev 4852)
@@ -6,9 +6,9 @@
---
---- redmine-0.9.2.orig/vendor/plugins/engines/tasks/engines.rake
-+++ redmine-0.9.2/vendor/plugins/engines/tasks/engines.rake
-@@ -153,8 +153,8 @@ end
+--- a/vendor/plugins/engines/tasks/engines.rake
++++ b/vendor/plugins/engines/tasks/engines.rake
+@@ -153,8 +153,8 @@
# this is just a modification of the original task in railties/lib/tasks/documentation.rake,
# because the default task doesn't support subdirectories like <plugin>/app or
@@ -19,7 +19,7 @@
namespace :doc do
plugins = FileList['vendor/plugins/**'].collect { |plugin| File.basename(plugin) }
-@@ -173,9 +173,9 @@ namespace :doc do
+@@ -173,9 +173,9 @@
options << '--line-numbers' << '--inline-source'
options << '-T html'
@@ -31,9 +31,9 @@
end
if File.exists?("#{plugin_base}/README")
files.include("#{plugin_base}/README")
---- redmine-0.9.2.orig/vendor/plugins/engines/lib/engines.rb
-+++ redmine-0.9.2/vendor/plugins/engines/lib/engines.rb
-@@ -43,7 +43,7 @@ module Engines
+--- a/vendor/plugins/engines/lib/engines.rb
++++ b/vendor/plugins/engines/lib/engines.rb
+@@ -43,7 +43,7 @@
# List of extensions to load, can be changed in init.rb before calling Engines.init
mattr_accessor :rails_extensions
@@ -42,8 +42,8 @@
# The name of the public directory to mirror public engine assets into.
# Defaults to <tt>RAILS_ROOT/public/plugin_assets</tt>.
---- redmine-0.9.2.orig/vendor/plugins/engines/lib/engines/plugin.rb
-+++ redmine-0.9.2/vendor/plugins/engines/lib/engines/plugin.rb
+--- a/vendor/plugins/engines/lib/engines/plugin.rb
++++ b/vendor/plugins/engines/lib/engines/plugin.rb
@@ -4,9 +4,23 @@
#
# Engines.plugins[:plugin_name]
@@ -68,7 +68,7 @@
# Plugins can add paths to this attribute in init.rb if they need
# controllers loaded from additional locations.
attr_accessor :controller_paths
-@@ -18,6 +32,16 @@ module Engines
+@@ -18,6 +32,16 @@
attr_accessor :public_directory
protected
@@ -85,7 +85,7 @@
# The default set of code paths which will be added to the routing system
def default_controller_paths
%w(app/controllers components)
-@@ -34,15 +58,25 @@ module Engines
+@@ -34,15 +58,25 @@
def initialize(directory)
super directory
@@ -111,7 +111,7 @@
Assets.mirror_files_for(self)
end
-@@ -65,11 +99,25 @@ module Engines
+@@ -65,11 +99,25 @@
I18n.load_path.insert(app_index, *locale_files)
end
@@ -138,7 +138,7 @@
def migration_directory
File.join(self.directory, 'db', 'migrate')
--- /dev/null
-+++ redmine-0.9.2/vendor/plugins/engines/lib/engines/rails_extensions/routing.rb
++++ b/vendor/plugins/engines/lib/engines/rails_extensions/routing.rb
@@ -0,0 +1,87 @@
+# Effective use of Rails' routes can help create a tidy and elegant set of URLs,
+# and is a significant part of creating an external API for your web application.
@@ -227,9 +227,9 @@
+ end
+ end
+end
---- redmine-0.9.2.orig/config/routes.rb
-+++ redmine-0.9.2/config/routes.rb
-@@ -6,6 +6,11 @@ ActionController::Routing::Routes.draw d
+--- a/config/routes.rb
++++ b/config/routes.rb
+@@ -6,6 +6,11 @@
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
# Keep in mind you can assign values other than :controller and :action
@@ -241,3 +241,25 @@
map.home '', :controller => 'welcome'
map.signin 'login', :controller => 'account', :action => 'login'
+--- a/vendor/plugins/engines/lib/engines/plugin/loader.rb
++++ b/vendor/plugins/engines/lib/engines/plugin/loader.rb
+@@ -5,7 +5,16 @@
+ def register_plugin_as_loaded(plugin)
+ super plugin
+ Engines.plugins << plugin
+- end
++ register_to_routing(plugin)
++ end
++
++ # Registers the plugin's controller_paths for the routing system.
++ def register_to_routing(plugin)
++ if plugin.respond_to?('select_existing_paths')
++ initializer.configuration.controller_paths += plugin.select_existing_paths(:controller_paths)
++ initializer.configuration.controller_paths.uniq!
++ end
++ end
+ end
+ end
+-end
+\ No newline at end of file
++end
More information about the Pkg-ruby-extras-commits
mailing list