[DRE-commits] r4835 - trunk/redmine/debian/patches
Jérémy Lal
kapouer-guest at alioth.debian.org
Sun Feb 28 15:44:25 UTC 2010
Author: kapouer-guest
Date: 2010-02-28 15:44:24 +0000 (Sun, 28 Feb 2010)
New Revision: 4835
Added:
trunk/redmine/debian/patches/0011-Sanitize-textarea-id-for-rails2.2.patch
trunk/redmine/debian/patches/0012-OrderedHash-to-Hash.patch
trunk/redmine/debian/patches/0013-Monkey-patches-for-group-support-taken-from-rails-2..patch
trunk/redmine/debian/patches/0014-Move-session-configuration-to-YML-file-next-to-datab.patch
trunk/redmine/debian/patches/0015-Request-forgery-protection-allow-XHR.patch
trunk/redmine/debian/patches/0016-plugin_assets_in_var_dir.patch
trunk/redmine/debian/patches/0017-dump_schema_to_cache_dir.patch
trunk/redmine/debian/patches/0018-engines-rails2.2.patch
Removed:
trunk/redmine/debian/patches/0012-Sanitize-textarea-id-for-rails2.2.patch
trunk/redmine/debian/patches/0013-OrderedHash-to-Hash.patch
trunk/redmine/debian/patches/0014-Monkey-patches-for-group-support-taken-from-rails-2..patch
trunk/redmine/debian/patches/0015-Move-session-configuration-to-YML-file-next-to-datab.patch
trunk/redmine/debian/patches/0016-Request-forgery-protection-allow-XHR.patch
trunk/redmine/debian/patches/0017-plugin_assets_in_var_dir.patch
trunk/redmine/debian/patches/0018-dump_schema_to_cache_dir.patch
trunk/redmine/debian/patches/0019-engines-rails2.2.patch
Modified:
trunk/redmine/debian/patches/0004-Returns-a-hash-in-any-case-since-rails-2.2-could-ret.patch
trunk/redmine/debian/patches/0005-No-need-to-declare-dependency-on-mocha.-It-s-there-b.patch
trunk/redmine/debian/patches/series
Log:
Refresh patches, reorder them.
Modified: trunk/redmine/debian/patches/0004-Returns-a-hash-in-any-case-since-rails-2.2-could-ret.patch
===================================================================
--- trunk/redmine/debian/patches/0004-Returns-a-hash-in-any-case-since-rails-2.2-could-ret.patch 2010-02-28 15:44:17 UTC (rev 4834)
+++ trunk/redmine/debian/patches/0004-Returns-a-hash-in-any-case-since-rails-2.2-could-ret.patch 2010-02-28 15:44:24 UTC (rev 4835)
@@ -6,11 +6,9 @@
app/models/query.rb | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
-diff --git a/app/models/query.rb b/app/models/query.rb
-index 788f34e..bb87284 100644
--- a/app/models/query.rb
+++ b/app/models/query.rb
-@@ -430,6 +430,9 @@ class Query < ActiveRecord::Base
+@@ -434,6 +434,9 @@
r = r.keys.inject({}) {|h, k| h[c.custom_field.cast_value(k)] = r[k]; h}
end
end
@@ -20,4 +18,3 @@
r
rescue ::ActiveRecord::StatementInvalid => e
raise StatementInvalid.new(e.message)
---
Modified: trunk/redmine/debian/patches/0005-No-need-to-declare-dependency-on-mocha.-It-s-there-b.patch
===================================================================
--- trunk/redmine/debian/patches/0005-No-need-to-declare-dependency-on-mocha.-It-s-there-b.patch 2010-02-28 15:44:17 UTC (rev 4834)
+++ trunk/redmine/debian/patches/0005-No-need-to-declare-dependency-on-mocha.-It-s-there-b.patch 2010-02-28 15:44:24 UTC (rev 4835)
@@ -6,14 +6,11 @@
config/environments/test.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
-diff --git a/config/environments/test.rb b/config/environments/test.rb
-index 0d1b42e..fd764b8 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
-@@ -26,4 +26,4 @@ config.action_controller.allow_forgery_protection = false
+@@ -26,4 +26,4 @@
config.gem "thoughtbot-shoulda", :lib => "shoulda", :source => "http://gems.github.com"
- config.gem "nofxx-object_daddy", :lib => "object_daddy", :source => "http://gems.github.com"
+ config.gem "edavis10-object_daddy", :lib => "object_daddy"
-config.gem "mocha"
+#config.gem "mocha"
---
Copied: trunk/redmine/debian/patches/0011-Sanitize-textarea-id-for-rails2.2.patch (from rev 4834, trunk/redmine/debian/patches/0012-Sanitize-textarea-id-for-rails2.2.patch)
===================================================================
--- trunk/redmine/debian/patches/0011-Sanitize-textarea-id-for-rails2.2.patch (rev 0)
+++ trunk/redmine/debian/patches/0011-Sanitize-textarea-id-for-rails2.2.patch 2010-02-28 15:44:24 UTC (rev 4835)
@@ -0,0 +1,66 @@
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
+Date: Sun, 17 Jan 2010 15:18:41 +0100
+Subject: [PATCH] Sanitize textarea id for rails2.2
+
+In rails 2.2, the id attribute of a textarea is not sanitized as it is for other form tags. Fix this using a minimal monkey patch from rails 2.3.
+---
+ .../initializers/text_field_helper_santitize_id.rb | 49 ++++++++++++++++++++
+ 1 files changed, 49 insertions(+), 0 deletions(-)
+ create mode 100644 config/initializers/text_field_helper_santitize_id.rb
+
+diff --git a/config/initializers/text_field_helper_santitize_id.rb b/config/initializers/text_field_helper_santitize_id.rb
+new file mode 100644
+index 0000000..429c806
+--- /dev/null
++++ b/config/initializers/text_field_helper_santitize_id.rb
+@@ -0,0 +1,49 @@
++require 'action_view/helpers/tag_helper'
++
++module ActionView
++ module Helpers
++ module FormTagHelper
++ # Creates a text input area; use a textarea for longer text inputs such as blog posts or descriptions.
++ #
++ # ==== Options
++ # * <tt>:size</tt> - A string specifying the dimensions (columns by rows) of the textarea (e.g., "25x10").
++ # * <tt>:rows</tt> - Specify the number of rows in the textarea
++ # * <tt>:cols</tt> - Specify the number of columns in the textarea
++ # * <tt>:disabled</tt> - If set to true, the user will not be able to use this input.
++ # * <tt>:escape</tt> - By default, the contents of the text input are HTML escaped.
++ # If you need unescaped contents, set this to false.
++ # * Any other key creates standard HTML attributes for the tag.
++ #
++ # ==== Examples
++ # text_area_tag 'post'
++ # # => <textarea id="post" name="post"></textarea>
++ #
++ # text_area_tag 'bio', @user.bio
++ # # => <textarea id="bio" name="bio">This is my biography.</textarea>
++ #
++ # text_area_tag 'body', nil, :rows => 10, :cols => 25
++ # # => <textarea cols="25" id="body" name="body" rows="10"></textarea>
++ #
++ # text_area_tag 'body', nil, :size => "25x10"
++ # # => <textarea name="body" id="body" cols="25" rows="10"></textarea>
++ #
++ # text_area_tag 'description', "Description goes here.", :disabled => true
++ # # => <textarea disabled="disabled" id="description" name="description">Description goes here.</textarea>
++ #
++ # text_area_tag 'comment', nil, :class => 'comment_input'
++ # # => <textarea class="comment_input" id="comment" name="comment"></textarea>
++ def text_area_tag(name, content = nil, options = {})
++ options.stringify_keys!
++
++ if size = options.delete("size")
++ options["cols"], options["rows"] = size.split("x") if size.respond_to?(:split)
++ end
++
++ escape = options.key?("escape") ? options.delete("escape") : true
++ content = html_escape(content) if escape
++
++ content_tag :textarea, content, { "name" => name, "id" => sanitize_to_id(name) }.update(options.stringify_keys)
++ end
++ end
++ end
++end
+--
Copied: trunk/redmine/debian/patches/0012-OrderedHash-to-Hash.patch (from rev 4834, trunk/redmine/debian/patches/0013-OrderedHash-to-Hash.patch)
===================================================================
--- trunk/redmine/debian/patches/0012-OrderedHash-to-Hash.patch (rev 0)
+++ trunk/redmine/debian/patches/0012-OrderedHash-to-Hash.patch 2010-02-28 15:44:24 UTC (rev 4835)
@@ -0,0 +1,20 @@
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
+Date: Thu, 21 Jan 2010 09:38:43 +0100
+Subject: [PATCH] OrderedHash to Hash
+
+Since in rails 2.2 OrderedHash < Array, not < Hash.
+---
+ app/models/issue.rb | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+--- a/app/models/issue.rb
++++ b/app/models/issue.rb
+@@ -157,7 +157,7 @@
+ if new_tracker_id
+ self.tracker_id = new_tracker_id
+ end
+- send :attributes_without_tracker_first=, new_attributes, *args
++ send :attributes_without_tracker_first=, new_attributes.to_hash, *args
+ end
+ # Do not redefine alias chain on reload (see #4838)
+ alias_method_chain(:attributes=, :tracker_first) unless method_defined?(:attributes_without_tracker_first=)
Deleted: trunk/redmine/debian/patches/0012-Sanitize-textarea-id-for-rails2.2.patch
===================================================================
--- trunk/redmine/debian/patches/0012-Sanitize-textarea-id-for-rails2.2.patch 2010-02-28 15:44:17 UTC (rev 4834)
+++ trunk/redmine/debian/patches/0012-Sanitize-textarea-id-for-rails2.2.patch 2010-02-28 15:44:24 UTC (rev 4835)
@@ -1,66 +0,0 @@
-From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
-Date: Sun, 17 Jan 2010 15:18:41 +0100
-Subject: [PATCH] Sanitize textarea id for rails2.2
-
-In rails 2.2, the id attribute of a textarea is not sanitized as it is for other form tags. Fix this using a minimal monkey patch from rails 2.3.
----
- .../initializers/text_field_helper_santitize_id.rb | 49 ++++++++++++++++++++
- 1 files changed, 49 insertions(+), 0 deletions(-)
- create mode 100644 config/initializers/text_field_helper_santitize_id.rb
-
-diff --git a/config/initializers/text_field_helper_santitize_id.rb b/config/initializers/text_field_helper_santitize_id.rb
-new file mode 100644
-index 0000000..429c806
---- /dev/null
-+++ b/config/initializers/text_field_helper_santitize_id.rb
-@@ -0,0 +1,49 @@
-+require 'action_view/helpers/tag_helper'
-+
-+module ActionView
-+ module Helpers
-+ module FormTagHelper
-+ # Creates a text input area; use a textarea for longer text inputs such as blog posts or descriptions.
-+ #
-+ # ==== Options
-+ # * <tt>:size</tt> - A string specifying the dimensions (columns by rows) of the textarea (e.g., "25x10").
-+ # * <tt>:rows</tt> - Specify the number of rows in the textarea
-+ # * <tt>:cols</tt> - Specify the number of columns in the textarea
-+ # * <tt>:disabled</tt> - If set to true, the user will not be able to use this input.
-+ # * <tt>:escape</tt> - By default, the contents of the text input are HTML escaped.
-+ # If you need unescaped contents, set this to false.
-+ # * Any other key creates standard HTML attributes for the tag.
-+ #
-+ # ==== Examples
-+ # text_area_tag 'post'
-+ # # => <textarea id="post" name="post"></textarea>
-+ #
-+ # text_area_tag 'bio', @user.bio
-+ # # => <textarea id="bio" name="bio">This is my biography.</textarea>
-+ #
-+ # text_area_tag 'body', nil, :rows => 10, :cols => 25
-+ # # => <textarea cols="25" id="body" name="body" rows="10"></textarea>
-+ #
-+ # text_area_tag 'body', nil, :size => "25x10"
-+ # # => <textarea name="body" id="body" cols="25" rows="10"></textarea>
-+ #
-+ # text_area_tag 'description', "Description goes here.", :disabled => true
-+ # # => <textarea disabled="disabled" id="description" name="description">Description goes here.</textarea>
-+ #
-+ # text_area_tag 'comment', nil, :class => 'comment_input'
-+ # # => <textarea class="comment_input" id="comment" name="comment"></textarea>
-+ def text_area_tag(name, content = nil, options = {})
-+ options.stringify_keys!
-+
-+ if size = options.delete("size")
-+ options["cols"], options["rows"] = size.split("x") if size.respond_to?(:split)
-+ end
-+
-+ escape = options.key?("escape") ? options.delete("escape") : true
-+ content = html_escape(content) if escape
-+
-+ content_tag :textarea, content, { "name" => name, "id" => sanitize_to_id(name) }.update(options.stringify_keys)
-+ end
-+ end
-+ end
-+end
---
Copied: trunk/redmine/debian/patches/0013-Monkey-patches-for-group-support-taken-from-rails-2..patch (from rev 4834, trunk/redmine/debian/patches/0014-Monkey-patches-for-group-support-taken-from-rails-2..patch)
===================================================================
--- trunk/redmine/debian/patches/0013-Monkey-patches-for-group-support-taken-from-rails-2..patch (rev 0)
+++ trunk/redmine/debian/patches/0013-Monkey-patches-for-group-support-taken-from-rails-2..patch 2010-02-28 15:44:24 UTC (rev 4835)
@@ -0,0 +1,85 @@
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
+Date: Sat, 9 Jan 2010 23:30:15 +0100
+Subject: [PATCH] Monkey patches for group support, taken from rails 2.3.
+
+---
+ config/initializers/action_group.rb | 69 +++++++++++++++++++++++++++++++++++
+ 1 files changed, 69 insertions(+), 0 deletions(-)
+ create mode 100644 config/initializers/action_group.rb
+
+diff --git a/config/initializers/action_group.rb b/config/initializers/action_group.rb
+new file mode 100644
+index 0000000..0adfd78
+--- /dev/null
++++ b/config/initializers/action_group.rb
+@@ -0,0 +1,69 @@
++module ActionView
++ module Helpers
++ module FormOptionsHelper
++ def options_for_select(container, selected = nil)
++ return container if String === container
++
++ container = container.to_a if Hash === container
++ selected, disabled = extract_selected_and_disabled(selected)
++
++ options_for_select = container.inject([]) do |options, element|
++ text, value = option_text_and_value(element)
++ selected_attribute = ' selected="selected"' if option_value_selected?(value, selected)
++ disabled_attribute = ' disabled="disabled"' if disabled && option_value_selected?(value, disabled)
++ options << %(<option value="#{html_escape(value.to_s)}"#{selected_attribute}#{disabled_attribute}>#{html_escape(text.to_s)}</option>)
++ end
++
++ options_for_select.join("\n")
++ end
++ def extract_selected_and_disabled(selected)
++ if selected.is_a?(Hash)
++ [selected[:selected], selected[:disabled]]
++ else
++ [selected, nil]
++ end
++ end
++ def grouped_options_for_select(grouped_options, selected_key = nil, prompt = nil)
++ body = ''
++ body << content_tag(:option, prompt, :value => "") if prompt
++ grouped_options = grouped_options.sort if grouped_options.is_a?(Hash)
++ grouped_options.each do |group|
++ body << content_tag(:optgroup, options_for_select(group[1], selected_key), :label => group[0])
++ end
++ body
++ end
++ end
++ end
++
++ require 'action_view/test_case'
++ require 'action_controller/test_process'
++ class FormOptionsHelperTest < ActionView::TestCase
++ def test_grouped_options_for_select_with_array
++ assert_dom_equal(
++ "<optgroup label=\"North America\"><option value=\"US\">United States</option>\n<option value=\"Canada\">Canada</option></optgroup><optgroup label=\"Europe\"><option value=\"GB\">Great Britain</option>\n<option value=\"Germany\">Germany</option></optgroup>",
++ grouped_options_for_select([
++ ["North America",
++ [['United States','US'],"Canada"]],
++ ["Europe",
++ [["Great Britain","GB"], "Germany"]]
++ ])
++ )
++ end
++
++ def test_grouped_options_for_select_with_selected_and_prompt
++ assert_dom_equal(
++ "<option value=\"\">Choose a product...</option><optgroup label=\"Hats\"><option value=\"Baseball Cap\">Baseball Cap</option>\n<option selected=\"selected\" value=\"Cowboy Hat\">Cowboy Hat</option></optgroup>",
++ grouped_options_for_select([["Hats", ["Baseball Cap","Cowboy Hat"]]], "Cowboy Hat", "Choose a product...")
++ )
++ end
++
++ def test_optgroups_with_with_options_with_hash
++ assert_dom_equal(
++ "<optgroup label=\"Europe\"><option value=\"Denmark\">Denmark</option>\n<option value=\"Germany\">Germany</option></optgroup><optgroup label=\"North America\"><option value=\"United States\">United States</option>\n<option value=\"Canada\">Canada</option></optgroup>",
++ grouped_options_for_select({'North America' => ['United States','Canada'], 'Europe' => ['Denmark','Germany']})
++ )
++ end
++ end
++end
++
++
+--
Deleted: trunk/redmine/debian/patches/0013-OrderedHash-to-Hash.patch
===================================================================
--- trunk/redmine/debian/patches/0013-OrderedHash-to-Hash.patch 2010-02-28 15:44:17 UTC (rev 4834)
+++ trunk/redmine/debian/patches/0013-OrderedHash-to-Hash.patch 2010-02-28 15:44:24 UTC (rev 4835)
@@ -1,23 +0,0 @@
-From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
-Date: Thu, 21 Jan 2010 09:38:43 +0100
-Subject: [PATCH] OrderedHash to Hash
-
-Since in rails 2.2 OrderedHash < Array, not < Hash.
----
- app/models/issue.rb | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/app/models/issue.rb b/app/models/issue.rb
-index f4ebb29..4146547 100644
---- a/app/models/issue.rb
-+++ b/app/models/issue.rb
-@@ -157,7 +157,7 @@ class Issue < ActiveRecord::Base
- if new_tracker_id
- self.tracker_id = new_tracker_id
- end
-- send :attributes_without_tracker_first=, new_attributes, *args
-+ send :attributes_without_tracker_first=, new_attributes.to_hash, *args
- end
- alias_method_chain :attributes=, :tracker_first
-
---
Deleted: trunk/redmine/debian/patches/0014-Monkey-patches-for-group-support-taken-from-rails-2..patch
===================================================================
--- trunk/redmine/debian/patches/0014-Monkey-patches-for-group-support-taken-from-rails-2..patch 2010-02-28 15:44:17 UTC (rev 4834)
+++ trunk/redmine/debian/patches/0014-Monkey-patches-for-group-support-taken-from-rails-2..patch 2010-02-28 15:44:24 UTC (rev 4835)
@@ -1,85 +0,0 @@
-From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
-Date: Sat, 9 Jan 2010 23:30:15 +0100
-Subject: [PATCH] Monkey patches for group support, taken from rails 2.3.
-
----
- config/initializers/action_group.rb | 69 +++++++++++++++++++++++++++++++++++
- 1 files changed, 69 insertions(+), 0 deletions(-)
- create mode 100644 config/initializers/action_group.rb
-
-diff --git a/config/initializers/action_group.rb b/config/initializers/action_group.rb
-new file mode 100644
-index 0000000..0adfd78
---- /dev/null
-+++ b/config/initializers/action_group.rb
-@@ -0,0 +1,69 @@
-+module ActionView
-+ module Helpers
-+ module FormOptionsHelper
-+ def options_for_select(container, selected = nil)
-+ return container if String === container
-+
-+ container = container.to_a if Hash === container
-+ selected, disabled = extract_selected_and_disabled(selected)
-+
-+ options_for_select = container.inject([]) do |options, element|
-+ text, value = option_text_and_value(element)
-+ selected_attribute = ' selected="selected"' if option_value_selected?(value, selected)
-+ disabled_attribute = ' disabled="disabled"' if disabled && option_value_selected?(value, disabled)
-+ options << %(<option value="#{html_escape(value.to_s)}"#{selected_attribute}#{disabled_attribute}>#{html_escape(text.to_s)}</option>)
-+ end
-+
-+ options_for_select.join("\n")
-+ end
-+ def extract_selected_and_disabled(selected)
-+ if selected.is_a?(Hash)
-+ [selected[:selected], selected[:disabled]]
-+ else
-+ [selected, nil]
-+ end
-+ end
-+ def grouped_options_for_select(grouped_options, selected_key = nil, prompt = nil)
-+ body = ''
-+ body << content_tag(:option, prompt, :value => "") if prompt
-+ grouped_options = grouped_options.sort if grouped_options.is_a?(Hash)
-+ grouped_options.each do |group|
-+ body << content_tag(:optgroup, options_for_select(group[1], selected_key), :label => group[0])
-+ end
-+ body
-+ end
-+ end
-+ end
-+
-+ require 'action_view/test_case'
-+ require 'action_controller/test_process'
-+ class FormOptionsHelperTest < ActionView::TestCase
-+ def test_grouped_options_for_select_with_array
-+ assert_dom_equal(
-+ "<optgroup label=\"North America\"><option value=\"US\">United States</option>\n<option value=\"Canada\">Canada</option></optgroup><optgroup label=\"Europe\"><option value=\"GB\">Great Britain</option>\n<option value=\"Germany\">Germany</option></optgroup>",
-+ grouped_options_for_select([
-+ ["North America",
-+ [['United States','US'],"Canada"]],
-+ ["Europe",
-+ [["Great Britain","GB"], "Germany"]]
-+ ])
-+ )
-+ end
-+
-+ def test_grouped_options_for_select_with_selected_and_prompt
-+ assert_dom_equal(
-+ "<option value=\"\">Choose a product...</option><optgroup label=\"Hats\"><option value=\"Baseball Cap\">Baseball Cap</option>\n<option selected=\"selected\" value=\"Cowboy Hat\">Cowboy Hat</option></optgroup>",
-+ grouped_options_for_select([["Hats", ["Baseball Cap","Cowboy Hat"]]], "Cowboy Hat", "Choose a product...")
-+ )
-+ end
-+
-+ def test_optgroups_with_with_options_with_hash
-+ assert_dom_equal(
-+ "<optgroup label=\"Europe\"><option value=\"Denmark\">Denmark</option>\n<option value=\"Germany\">Germany</option></optgroup><optgroup label=\"North America\"><option value=\"United States\">United States</option>\n<option value=\"Canada\">Canada</option></optgroup>",
-+ grouped_options_for_select({'North America' => ['United States','Canada'], 'Europe' => ['Denmark','Germany']})
-+ )
-+ end
-+ end
-+end
-+
-+
---
Copied: trunk/redmine/debian/patches/0014-Move-session-configuration-to-YML-file-next-to-datab.patch (from rev 4834, trunk/redmine/debian/patches/0015-Move-session-configuration-to-YML-file-next-to-datab.patch)
===================================================================
--- trunk/redmine/debian/patches/0014-Move-session-configuration-to-YML-file-next-to-datab.patch (rev 0)
+++ trunk/redmine/debian/patches/0014-Move-session-configuration-to-YML-file-next-to-datab.patch 2010-02-28 15:44:24 UTC (rev 4835)
@@ -0,0 +1,81 @@
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
+Date: Sun, 10 Jan 2010 00:30:02 +0100
+Subject: [PATCH] Move session configuration to YML file, next to database.yml path.
+
+---
+
+--- redmine-0.9.2.orig/config/environment.rb
++++ redmine-0.9.2/config/environment.rb
+@@ -19,6 +19,19 @@ RAILS_GEM_VERSION = '2.2.3' unless defin
+ # Bootstrap the Rails environment, frameworks, and default configuration
+ require File.join(File.dirname(__FILE__), 'boot')
+
++# loads cookie based session session and secret keys
++# this is needed here because initializers are loaded after plugins,
++# and some plugins initialize ActionController which requires a secret to be set.
++# crash if file not found
++filename = ENV['RAILS_ETC'] ? File.join(ENV['RAILS_ETC'], 'session.yml') : File.join(File.dirname(__FILE__), '..', 'session.yml')
++sessionconfig = YAML::load_file(filename)
++require 'action_controller'
++ActionController::Base.session = {
++ :session_key => sessionconfig[Rails.env]['session_key'],
++ :secret => sessionconfig[Rails.env]['secret'],
++ :session_path => ENV['RAILS_RELATIVE_URL_ROOT'] ? ENV['RAILS_RELATIVE_URL_ROOT'] : '/'
++}
++
+ # Load Engine plugin if available
+ begin
+ require File.join(File.dirname(__FILE__), '../vendor/plugins/engines/boot')
+diff --git a/lib/tasks/initializers.rake b/lib/tasks/initializers.rake
+index ce87475..a108204 100644
+--- a/lib/tasks/initializers.rake
++++ b/lib/tasks/initializers.rake
+@@ -1,11 +1,14 @@
+ desc 'Generates a configuration file for cookie store sessions.'
++task :generate_session_store do
+
+-file 'config/initializers/session_store.rb' do
+- path = File.join(RAILS_ROOT, 'config', 'initializers', 'session_store.rb')
+- secret = ActiveSupport::SecureRandom.hex(40)
+- File.open(path, 'w') do |f|
+- f.write <<"EOF"
+-# This file was generated by 'rake config/initializers/session_store.rb',
++ENV['X_DEBIAN_SITEID'] ||= 'default'
++ENV['RAILS_ETC'] ||= "/etc/redmine/#{ENV['X_DEBIAN_SITEID']}"
++filename = ENV['YML_SESSION_FILENAME'] ? ENV['YML_SESSION_FILENAME'] : 'session.yml'
++path = File.join(ENV['RAILS_ETC'] ? ENV['RAILS_ETC'] : File.join(RAILS_ROOT, 'config'), filename)
++secret = ActiveSupport::SecureRandom.hex(40)
++File.open(path, 'w') do |f|
++ f.write <<"EOF"
++# This file was generated by 'rake generate_session_store',
+ # and should not be made visible to public.
+ # If you have a load-balancing Redmine cluster, you will need to use the
+ # same version of this file on each machine. And be sure to restart your
+@@ -15,13 +18,18 @@ file 'config/initializers/session_store.rb' do
+ # change this key, all old sessions will become invalid! Make sure the
+ # secret is at least 30 characters and all random, no regular words or
+ # you'll be exposed to dictionary attacks.
+-ActionController::Base.session = {
+- :session_key => '_redmine_session',
+- :secret => '#{secret}'
+-}
++production:
++ session_key: _redmine_#{ENV['X_DEBIAN_SITEID']}
++ secret: #{secret}
++
++development:
++ session_key: _redmine_#{ENV['X_DEBIAN_SITEID']}
++ secret: #{secret}
++
++test:
++ session_key: _redmine_#{ENV['X_DEBIAN_SITEID']}
++ secret: #{secret}
++
+ EOF
+- end
+ end
+-
+-desc 'Generates a configuration file for cookie store sessions.'
+-task :generate_session_store => ['config/initializers/session_store.rb']
++end
+--
Deleted: trunk/redmine/debian/patches/0015-Move-session-configuration-to-YML-file-next-to-datab.patch
===================================================================
--- trunk/redmine/debian/patches/0015-Move-session-configuration-to-YML-file-next-to-datab.patch 2010-02-28 15:44:17 UTC (rev 4834)
+++ trunk/redmine/debian/patches/0015-Move-session-configuration-to-YML-file-next-to-datab.patch 2010-02-28 15:44:24 UTC (rev 4835)
@@ -1,81 +0,0 @@
-From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
-Date: Sun, 10 Jan 2010 00:30:02 +0100
-Subject: [PATCH] Move session configuration to YML file, next to database.yml path.
-
----
-
---- redmine-0.9.2.orig/config/environment.rb
-+++ redmine-0.9.2/config/environment.rb
-@@ -19,6 +19,19 @@ RAILS_GEM_VERSION = '2.2.3' unless defin
- # Bootstrap the Rails environment, frameworks, and default configuration
- require File.join(File.dirname(__FILE__), 'boot')
-
-+# loads cookie based session session and secret keys
-+# this is needed here because initializers are loaded after plugins,
-+# and some plugins initialize ActionController which requires a secret to be set.
-+# crash if file not found
-+filename = ENV['RAILS_ETC'] ? File.join(ENV['RAILS_ETC'], 'session.yml') : File.join(File.dirname(__FILE__), '..', 'session.yml')
-+sessionconfig = YAML::load_file(filename)
-+require 'action_controller'
-+ActionController::Base.session = {
-+ :session_key => sessionconfig[Rails.env]['session_key'],
-+ :secret => sessionconfig[Rails.env]['secret'],
-+ :session_path => ENV['RAILS_RELATIVE_URL_ROOT'] ? ENV['RAILS_RELATIVE_URL_ROOT'] : '/'
-+}
-+
- # Load Engine plugin if available
- begin
- require File.join(File.dirname(__FILE__), '../vendor/plugins/engines/boot')
-diff --git a/lib/tasks/initializers.rake b/lib/tasks/initializers.rake
-index ce87475..a108204 100644
---- a/lib/tasks/initializers.rake
-+++ b/lib/tasks/initializers.rake
-@@ -1,11 +1,14 @@
- desc 'Generates a configuration file for cookie store sessions.'
-+task :generate_session_store do
-
--file 'config/initializers/session_store.rb' do
-- path = File.join(RAILS_ROOT, 'config', 'initializers', 'session_store.rb')
-- secret = ActiveSupport::SecureRandom.hex(40)
-- File.open(path, 'w') do |f|
-- f.write <<"EOF"
--# This file was generated by 'rake config/initializers/session_store.rb',
-+ENV['X_DEBIAN_SITEID'] ||= 'default'
-+ENV['RAILS_ETC'] ||= "/etc/redmine/#{ENV['X_DEBIAN_SITEID']}"
-+filename = ENV['YML_SESSION_FILENAME'] ? ENV['YML_SESSION_FILENAME'] : 'session.yml'
-+path = File.join(ENV['RAILS_ETC'] ? ENV['RAILS_ETC'] : File.join(RAILS_ROOT, 'config'), filename)
-+secret = ActiveSupport::SecureRandom.hex(40)
-+File.open(path, 'w') do |f|
-+ f.write <<"EOF"
-+# This file was generated by 'rake generate_session_store',
- # and should not be made visible to public.
- # If you have a load-balancing Redmine cluster, you will need to use the
- # same version of this file on each machine. And be sure to restart your
-@@ -15,13 +18,18 @@ file 'config/initializers/session_store.rb' do
- # change this key, all old sessions will become invalid! Make sure the
- # secret is at least 30 characters and all random, no regular words or
- # you'll be exposed to dictionary attacks.
--ActionController::Base.session = {
-- :session_key => '_redmine_session',
-- :secret => '#{secret}'
--}
-+production:
-+ session_key: _redmine_#{ENV['X_DEBIAN_SITEID']}
-+ secret: #{secret}
-+
-+development:
-+ session_key: _redmine_#{ENV['X_DEBIAN_SITEID']}
-+ secret: #{secret}
-+
-+test:
-+ session_key: _redmine_#{ENV['X_DEBIAN_SITEID']}
-+ secret: #{secret}
-+
- EOF
-- end
- end
--
--desc 'Generates a configuration file for cookie store sessions.'
--task :generate_session_store => ['config/initializers/session_store.rb']
-+end
---
Copied: trunk/redmine/debian/patches/0015-Request-forgery-protection-allow-XHR.patch (from rev 4834, trunk/redmine/debian/patches/0016-Request-forgery-protection-allow-XHR.patch)
===================================================================
--- trunk/redmine/debian/patches/0015-Request-forgery-protection-allow-XHR.patch (rev 0)
+++ trunk/redmine/debian/patches/0015-Request-forgery-protection-allow-XHR.patch 2010-02-28 15:44:24 UTC (rev 4835)
@@ -0,0 +1,31 @@
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
+Date: Sun, 14 Feb 2010 15:54:48 +0100
+Subject: [PATCH] Request forgery protection allow XHR
+
+This patch is from rails 2.3.5. If not applied, XHR requests return error 500.
+Submitted to rails 2.2.3-2 :
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=569811
+---
+ .../initializers/request_forgery_protection_xhr.rb | 12 ++++++++++++
+ 1 files changed, 12 insertions(+), 0 deletions(-)
+ create mode 100644 config/initializers/request_forgery_protection_xhr.rb
+
+diff --git a/config/initializers/request_forgery_protection_xhr.rb b/config/initializers/request_forgery_protection_xhr.rb
+new file mode 100644
+index 0000000..1886080
+--- /dev/null
++++ b/config/initializers/request_forgery_protection_xhr.rb
+@@ -0,0 +1,12 @@
++module ActionController
++ module RequestForgeryProtection
++ protected
++ def verified_request?
++ !protect_against_forgery? ||
++ request.method == :get ||
++ request.xhr? ||
++ !verifiable_request_format? ||
++ form_authenticity_token == params[request_forgery_protection_token]
++ end
++ end
++end
+--
Deleted: trunk/redmine/debian/patches/0016-Request-forgery-protection-allow-XHR.patch
===================================================================
--- trunk/redmine/debian/patches/0016-Request-forgery-protection-allow-XHR.patch 2010-02-28 15:44:17 UTC (rev 4834)
+++ trunk/redmine/debian/patches/0016-Request-forgery-protection-allow-XHR.patch 2010-02-28 15:44:24 UTC (rev 4835)
@@ -1,31 +0,0 @@
-From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
-Date: Sun, 14 Feb 2010 15:54:48 +0100
-Subject: [PATCH] Request forgery protection allow XHR
-
-This patch is from rails 2.3.5. If not applied, XHR requests return error 500.
-Submitted to rails 2.2.3-2 :
-http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=569811
----
- .../initializers/request_forgery_protection_xhr.rb | 12 ++++++++++++
- 1 files changed, 12 insertions(+), 0 deletions(-)
- create mode 100644 config/initializers/request_forgery_protection_xhr.rb
-
-diff --git a/config/initializers/request_forgery_protection_xhr.rb b/config/initializers/request_forgery_protection_xhr.rb
-new file mode 100644
-index 0000000..1886080
---- /dev/null
-+++ b/config/initializers/request_forgery_protection_xhr.rb
-@@ -0,0 +1,12 @@
-+module ActionController
-+ module RequestForgeryProtection
-+ protected
-+ def verified_request?
-+ !protect_against_forgery? ||
-+ request.method == :get ||
-+ request.xhr? ||
-+ !verifiable_request_format? ||
-+ form_authenticity_token == params[request_forgery_protection_token]
-+ end
-+ end
-+end
---
Copied: trunk/redmine/debian/patches/0016-plugin_assets_in_var_dir.patch (from rev 4834, trunk/redmine/debian/patches/0017-plugin_assets_in_var_dir.patch)
===================================================================
--- trunk/redmine/debian/patches/0016-plugin_assets_in_var_dir.patch (rev 0)
+++ trunk/redmine/debian/patches/0016-plugin_assets_in_var_dir.patch 2010-02-28 15:44:24 UTC (rev 4835)
@@ -0,0 +1,17 @@
+Author: Jérémy Lal <kapouer at melix.org>
+Bug-Debian: http://bugs.debian.org/570308
+
+---
+Engines plugin writes to /usr/share/redmine/public/plugin_assets
+at runtime. This patch makes it write to a proper directory.
+
+--- a/config/environment.rb
++++ b/config/environment.rb
+@@ -34,6 +34,7 @@
+ # Load Engine plugin if available
+ begin
+ require File.join(File.dirname(__FILE__), '../vendor/plugins/engines/boot')
++ Engines::public_directory = "#{ENV['RAILS_CACHE']}/plugin_assets"
+ rescue LoadError
+ # Not available
+ end
Copied: trunk/redmine/debian/patches/0017-dump_schema_to_cache_dir.patch (from rev 4834, trunk/redmine/debian/patches/0018-dump_schema_to_cache_dir.patch)
===================================================================
--- trunk/redmine/debian/patches/0017-dump_schema_to_cache_dir.patch (rev 0)
+++ trunk/redmine/debian/patches/0017-dump_schema_to_cache_dir.patch 2010-02-28 15:44:24 UTC (rev 4835)
@@ -0,0 +1,19 @@
+Author: Jérémy Lal <kapouer at melix.org>
+
+---
+rake task db:migrate calls db:schema:dump, which writes to
+/usr/share/redmine/db, independently of the X_DEBIAN_SITEID instance.
+This patch makes it write to (by default)
+/var/cache/redmine/${X_DEBIAN_SITEID}/schema.db
+so that each instance has its own migration dump.
+
+--- redmine-0.9.2.orig/config/environment.rb
++++ redmine-0.9.2/config/environment.rb
+@@ -11,6 +11,7 @@ ENV['RAILS_ETC'] ||= "/etc/redmine/#{ENV
+ ENV['RAILS_LOG'] ||= "/var/log/redmine/#{ENV['X_DEBIAN_SITEID']}"
+ ENV['RAILS_VAR'] ||= "/var/lib/redmine/#{ENV['X_DEBIAN_SITEID']}"
+ ENV['RAILS_CACHE'] ||= "/var/cache/redmine/#{ENV['X_DEBIAN_SITEID']}"
++ENV['SCHEMA'] ||= "#{ENV['RAILS_CACHE']}/schema.db"
+
+ # Specifies gem version of Rails to use when vendor/rails is not present
+ RAILS_GEM_VERSION = '2.2.3' unless defined? RAILS_GEM_VERSION
Deleted: trunk/redmine/debian/patches/0017-plugin_assets_in_var_dir.patch
===================================================================
--- trunk/redmine/debian/patches/0017-plugin_assets_in_var_dir.patch 2010-02-28 15:44:17 UTC (rev 4834)
+++ trunk/redmine/debian/patches/0017-plugin_assets_in_var_dir.patch 2010-02-28 15:44:24 UTC (rev 4835)
@@ -1,17 +0,0 @@
-Author: Jérémy Lal <kapouer at melix.org>
-Bug-Debian: http://bugs.debian.org/570308
-
----
-Engines plugin writes to /usr/share/redmine/public/plugin_assets
-at runtime. This patch makes it write to a proper directory.
-
---- redmine-0.9.2.orig/config/environment.rb
-+++ redmine-0.9.2/config/environment.rb
-@@ -21,6 +21,7 @@ require File.join(File.dirname(__FILE__)
- # Load Engine plugin if available
- begin
- require File.join(File.dirname(__FILE__), '../vendor/plugins/engines/boot')
-+ Engines::public_directory = "#{ENV['RAILS_CACHE']}/plugin_assets"
- rescue LoadError
- # Not available
- end
Deleted: trunk/redmine/debian/patches/0018-dump_schema_to_cache_dir.patch
===================================================================
--- trunk/redmine/debian/patches/0018-dump_schema_to_cache_dir.patch 2010-02-28 15:44:17 UTC (rev 4834)
+++ trunk/redmine/debian/patches/0018-dump_schema_to_cache_dir.patch 2010-02-28 15:44:24 UTC (rev 4835)
@@ -1,19 +0,0 @@
-Author: Jérémy Lal <kapouer at melix.org>
-
----
-rake task db:migrate calls db:schema:dump, which writes to
-/usr/share/redmine/db, independently of the X_DEBIAN_SITEID instance.
-This patch makes it write to (by default)
-/var/cache/redmine/${X_DEBIAN_SITEID}/schema.db
-so that each instance has its own migration dump.
-
---- redmine-0.9.2.orig/config/environment.rb
-+++ redmine-0.9.2/config/environment.rb
-@@ -11,6 +11,7 @@ ENV['RAILS_ETC'] ||= "/etc/redmine/#{ENV
- ENV['RAILS_LOG'] ||= "/var/log/redmine/#{ENV['X_DEBIAN_SITEID']}"
- ENV['RAILS_VAR'] ||= "/var/lib/redmine/#{ENV['X_DEBIAN_SITEID']}"
- ENV['RAILS_CACHE'] ||= "/var/cache/redmine/#{ENV['X_DEBIAN_SITEID']}"
-+ENV['SCHEMA'] ||= "#{ENV['RAILS_CACHE']}/schema.db"
-
- # Specifies gem version of Rails to use when vendor/rails is not present
- RAILS_GEM_VERSION = '2.2.3' unless defined? RAILS_GEM_VERSION
Copied: trunk/redmine/debian/patches/0018-engines-rails2.2.patch (from rev 4834, trunk/redmine/debian/patches/0019-engines-rails2.2.patch)
===================================================================
--- trunk/redmine/debian/patches/0018-engines-rails2.2.patch (rev 0)
+++ trunk/redmine/debian/patches/0018-engines-rails2.2.patch 2010-02-28 15:44:24 UTC (rev 4835)
@@ -0,0 +1,243 @@
+Description: Backport of Engines plugin for rails 2.2, and redmine compatibility fix.
+ The engines plugin provided upstream is rails 2.3 compatible.
+ Several fixes taken from an earlier engines version and earlier redmine version
+ have been used to make it work with rails 2.2.3
+Author: Jérémy Lal <kapouer at melix.org>
+
+---
+
+--- 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
+
+ # 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
+-# <plugin>/component. These tasks now include every file under a plugin's load paths (see
+-# Plugin#load_paths).
++# <plugin>/component. These tasks now include every file under a plugin's code paths (see
++# Plugin#code_paths).
+ namespace :doc do
+
+ plugins = FileList['vendor/plugins/**'].collect { |plugin| File.basename(plugin) }
+@@ -173,9 +173,9 @@ namespace :doc do
+ options << '--line-numbers' << '--inline-source'
+ options << '-T html'
+
+- # Include every file in the plugin's load_paths (see Plugin#load_paths)
++ # Include every file in the plugin's code_paths (see Plugin#code_paths)
+ if Engines.plugins[plugin]
+- files.include("#{plugin_base}/{#{Engines.plugins[plugin].load_paths.join(",")}}/**/*.rb")
++ files.include("#{plugin_base}/{#{Engines.plugins[plugin].code_paths.join(",")}}/**/*.rb")
+ 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
+
+ # List of extensions to load, can be changed in init.rb before calling Engines.init
+ mattr_accessor :rails_extensions
+- self.rails_extensions = %w(asset_helpers form_tag_helpers migrations dependencies)
++ self.rails_extensions = %w(asset_helpers routing form_tag_helpers migrations dependencies)
+
+ # 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
+@@ -4,9 +4,23 @@
+ #
+ # Engines.plugins[:plugin_name]
+ #
++# If this plugin contains paths in directories other than <tt>app/controllers</tt>,
++# <tt>app/helpers</tt>, <tt>app/models</tt> and <tt>components</tt>, authors can
++# declare this by adding extra paths to #code_paths:
++#
++# Rails.plugin[:my_plugin].code_paths << "app/sweepers" << "vendor/my_lib"
++#
+ # Other properties of the Plugin instance can also be set.
+ module Engines
+ class Plugin < Rails::Plugin
++ # Plugins can add code paths to this attribute in init.rb if they
++ # need plugin directories to be added to the load path, i.e.
++ #
++ # plugin.code_paths << 'app/other_classes'
++ #
++ # Defaults to ["app/controllers", "app/helpers", "app/models", "components"]
++ attr_accessor :code_paths
++
+ # 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
+ attr_accessor :public_directory
+
+ protected
++
++ # The default set of code paths which will be added to $LOAD_PATH
++ # and Dependencies.load_paths
++ def default_code_paths
++ # lib will actually be removed from the load paths when we call
++ # uniq! in #inject_into_load_paths, but it's important to keep it
++ # around (for the documentation tasks, for instance).
++ %w(app/controllers app/helpers app/models components lib)
++ end
++
+ # 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
+
+ def initialize(directory)
+ super directory
++ @code_paths = default_code_paths
+ @controller_paths = default_controller_paths
+ @public_directory = default_public_directory
+ end
+
++ # Returns a list of paths this plugin wishes to make available in $LOAD_PATH
++ #
++ # Overwrites the correspondend method in the superclass
++ def load_paths
++ report_nonexistant_or_empty_plugin! unless valid?
++ select_existing_paths :code_paths
++ end
++
+ # Extends the superclass' load method to additionally mirror public assets
+ def load(initializer)
+ return if loaded?
+ super initializer
+ add_plugin_locale_paths
++ add_plugin_view_paths
+ Assets.mirror_files_for(self)
+ end
+
+@@ -65,11 +99,25 @@ module Engines
+ I18n.load_path.insert(app_index, *locale_files)
+ end
+
++ def add_plugin_view_paths
++ view_path = File.join(directory, 'app', 'views')
++ if File.exist?(view_path)
++ ActionController::Base.prepend_view_path(view_path) # push it just underneath the app
++ # ActionView::TemplateFinder.process_view_paths(view_path)
++ ActionView::Base.process_view_paths(view_path)
++ end
++ end
++
+ # The path to this plugin's public files
+ def public_asset_directory
+ "#{File.basename(Engines.public_directory)}/#{name}"
+ end
+
++ # The path to this plugin's routes file
++ def routes_path
++ File.join(directory, "config/routes.rb")
++ end
++
+ # The directory containing this plugin's migrations (<tt>plugin/db/migrate</tt>)
+ def migration_directory
+ File.join(self.directory, 'db', 'migrate')
+--- /dev/null
++++ redmine-0.9.2/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.
++#
++# When developing plugins which contain controllers, it seems obvious that including
++# the corresponding routes would be extremely useful. This is particularly true
++# when exposing RESTful resources using the new REST-ian features of Rails.
++#
++# == Including routes in your plugin
++#
++# The engines plugin makes it possible to include a set of routes within your plugin
++# very simply, as it turns out. In your plugin, you simply include a <tt>routes.rb</tt>
++# file like the one below at the root of your plugin:
++#
++# connect "/login", :controller => "my_plugin/account", :action => "login"
++#
++# # add a named route
++# logout "/logout", :controller => "my_plugin/account", :action => "logout"
++#
++# # some restful stuff
++# resources :things do |t|
++# t.resources :other_things
++# end
++#
++# Everywhere in a normal <tt>RAILS_ROOT/config/routes.rb</tt> file
++# where you might have <tt>map.connect</tt>, you just use <tt>connect</tt> in your
++# plugin's <tt>routes.rb</tt>.
++#
++# === Hooking it up in your application
++#
++# While it would be possible to have each plugin's routes automagically included into
++# the application's route set, to do so would actually be a stunningly bad idea. Route
++# priority is the key issue here. You, the application developer, needs to be in complete
++# control when it comes to specifying the priority of routes in your application, since
++# the ordering of your routes directly affects how Rails will interpret incoming requests.
++#
++# To add plugin routes into your application's <tt>routes.rb</tt> file, you need to explicitly
++# map them in using the Engines::RailsExtensions::Routing#from_plugin method:
++#
++# ApplicationController::Routing::Routes.draw do |map|
++#
++# map.connect "/app_stuff", :controller => "application_thing" # etc...
++#
++# # This line includes the routes from the given plugin at this point, giving you
++# # control over the priority of your application routes
++# map.from_plugin :your_plugin
++#
++# map.connect ":controller/:action/:id"
++# end
++#
++# By including routes in plugins which have controllers, you can now share in a simple way
++# a compact and elegant URL scheme which corresponds to those controllers.
++#
++# ---
++#
++# The Engines::RailsExtensions::Routing module defines extensions to Rails'
++# routing (ActionController::Routing) mechanism such that routes can be loaded
++# from a given plugin.
++#
++# The key method is Engines::RailsExtensions::Routing#from_plugin, which can be called
++# within your application's <tt>config/routes.rb</tt> file to load plugin routes at that point.
++#
++module Engines::RailsExtensions::Routing
++ # Loads the set of routes from within a plugin and evaluates them at this
++ # point within an application's main <tt>routes.rb</tt> file.
++ #
++ # Plugin routes are loaded from <tt><plugin_root>/routes.rb</tt>.
++ def from_plugin(name)
++ map = self # to make 'map' available within the plugin route file
++ begin
++ routes_path = Engines.plugins[name].routes_path
++ Engines.logger.debug "loading routes from #{routes_path}"
++ eval(IO.read(routes_path), binding, routes_path) if File.file?(routes_path)
++ rescue
++ end
++ end
++end
++
++
++module ::ActionController #:nodoc:
++ module Routing #:nodoc:
++ class RouteSet #:nodoc:
++ class Mapper #:nodoc:
++ include Engines::RailsExtensions::Routing
++ end
++ 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
+ # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
+ # Keep in mind you can assign values other than :controller and :action
+
++ # Allow Redmine plugins to map routes and potentially override them
++ Rails.plugins.each do |plugin|
++ map.from_plugin plugin.name.to_sym
++ end
++
+ map.home '', :controller => 'welcome'
+
+ map.signin 'login', :controller => 'account', :action => 'login'
Deleted: trunk/redmine/debian/patches/0019-engines-rails2.2.patch
===================================================================
--- trunk/redmine/debian/patches/0019-engines-rails2.2.patch 2010-02-28 15:44:17 UTC (rev 4834)
+++ trunk/redmine/debian/patches/0019-engines-rails2.2.patch 2010-02-28 15:44:24 UTC (rev 4835)
@@ -1,243 +0,0 @@
-Description: Backport of Engines plugin for rails 2.2, and redmine compatibility fix.
- The engines plugin provided upstream is rails 2.3 compatible.
- Several fixes taken from an earlier engines version and earlier redmine version
- have been used to make it work with rails 2.2.3
-Author: Jérémy Lal <kapouer at melix.org>
-
----
-
---- 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
-
- # 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
--# <plugin>/component. These tasks now include every file under a plugin's load paths (see
--# Plugin#load_paths).
-+# <plugin>/component. These tasks now include every file under a plugin's code paths (see
-+# Plugin#code_paths).
- namespace :doc do
-
- plugins = FileList['vendor/plugins/**'].collect { |plugin| File.basename(plugin) }
-@@ -173,9 +173,9 @@ namespace :doc do
- options << '--line-numbers' << '--inline-source'
- options << '-T html'
-
-- # Include every file in the plugin's load_paths (see Plugin#load_paths)
-+ # Include every file in the plugin's code_paths (see Plugin#code_paths)
- if Engines.plugins[plugin]
-- files.include("#{plugin_base}/{#{Engines.plugins[plugin].load_paths.join(",")}}/**/*.rb")
-+ files.include("#{plugin_base}/{#{Engines.plugins[plugin].code_paths.join(",")}}/**/*.rb")
- 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
-
- # List of extensions to load, can be changed in init.rb before calling Engines.init
- mattr_accessor :rails_extensions
-- self.rails_extensions = %w(asset_helpers form_tag_helpers migrations dependencies)
-+ self.rails_extensions = %w(asset_helpers routing form_tag_helpers migrations dependencies)
-
- # 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
-@@ -4,9 +4,23 @@
- #
- # Engines.plugins[:plugin_name]
- #
-+# If this plugin contains paths in directories other than <tt>app/controllers</tt>,
-+# <tt>app/helpers</tt>, <tt>app/models</tt> and <tt>components</tt>, authors can
-+# declare this by adding extra paths to #code_paths:
-+#
-+# Rails.plugin[:my_plugin].code_paths << "app/sweepers" << "vendor/my_lib"
-+#
- # Other properties of the Plugin instance can also be set.
- module Engines
- class Plugin < Rails::Plugin
-+ # Plugins can add code paths to this attribute in init.rb if they
-+ # need plugin directories to be added to the load path, i.e.
-+ #
-+ # plugin.code_paths << 'app/other_classes'
-+ #
-+ # Defaults to ["app/controllers", "app/helpers", "app/models", "components"]
-+ attr_accessor :code_paths
-+
- # 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
- attr_accessor :public_directory
-
- protected
-+
-+ # The default set of code paths which will be added to $LOAD_PATH
-+ # and Dependencies.load_paths
-+ def default_code_paths
-+ # lib will actually be removed from the load paths when we call
-+ # uniq! in #inject_into_load_paths, but it's important to keep it
-+ # around (for the documentation tasks, for instance).
-+ %w(app/controllers app/helpers app/models components lib)
-+ end
-+
- # 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
-
- def initialize(directory)
- super directory
-+ @code_paths = default_code_paths
- @controller_paths = default_controller_paths
- @public_directory = default_public_directory
- end
-
-+ # Returns a list of paths this plugin wishes to make available in $LOAD_PATH
-+ #
-+ # Overwrites the correspondend method in the superclass
-+ def load_paths
-+ report_nonexistant_or_empty_plugin! unless valid?
-+ select_existing_paths :code_paths
-+ end
-+
- # Extends the superclass' load method to additionally mirror public assets
- def load(initializer)
- return if loaded?
- super initializer
- add_plugin_locale_paths
-+ add_plugin_view_paths
- Assets.mirror_files_for(self)
- end
-
-@@ -65,11 +99,25 @@ module Engines
- I18n.load_path.insert(app_index, *locale_files)
- end
-
-+ def add_plugin_view_paths
-+ view_path = File.join(directory, 'app', 'views')
-+ if File.exist?(view_path)
-+ ActionController::Base.prepend_view_path(view_path) # push it just underneath the app
-+ # ActionView::TemplateFinder.process_view_paths(view_path)
-+ ActionView::Base.process_view_paths(view_path)
-+ end
-+ end
-+
- # The path to this plugin's public files
- def public_asset_directory
- "#{File.basename(Engines.public_directory)}/#{name}"
- end
-
-+ # The path to this plugin's routes file
-+ def routes_path
-+ File.join(directory, "config/routes.rb")
-+ end
-+
- # The directory containing this plugin's migrations (<tt>plugin/db/migrate</tt>)
- def migration_directory
- File.join(self.directory, 'db', 'migrate')
---- /dev/null
-+++ redmine-0.9.2/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.
-+#
-+# When developing plugins which contain controllers, it seems obvious that including
-+# the corresponding routes would be extremely useful. This is particularly true
-+# when exposing RESTful resources using the new REST-ian features of Rails.
-+#
-+# == Including routes in your plugin
-+#
-+# The engines plugin makes it possible to include a set of routes within your plugin
-+# very simply, as it turns out. In your plugin, you simply include a <tt>routes.rb</tt>
-+# file like the one below at the root of your plugin:
-+#
-+# connect "/login", :controller => "my_plugin/account", :action => "login"
-+#
-+# # add a named route
-+# logout "/logout", :controller => "my_plugin/account", :action => "logout"
-+#
-+# # some restful stuff
-+# resources :things do |t|
-+# t.resources :other_things
-+# end
-+#
-+# Everywhere in a normal <tt>RAILS_ROOT/config/routes.rb</tt> file
-+# where you might have <tt>map.connect</tt>, you just use <tt>connect</tt> in your
-+# plugin's <tt>routes.rb</tt>.
-+#
-+# === Hooking it up in your application
-+#
-+# While it would be possible to have each plugin's routes automagically included into
-+# the application's route set, to do so would actually be a stunningly bad idea. Route
-+# priority is the key issue here. You, the application developer, needs to be in complete
-+# control when it comes to specifying the priority of routes in your application, since
-+# the ordering of your routes directly affects how Rails will interpret incoming requests.
-+#
-+# To add plugin routes into your application's <tt>routes.rb</tt> file, you need to explicitly
-+# map them in using the Engines::RailsExtensions::Routing#from_plugin method:
-+#
-+# ApplicationController::Routing::Routes.draw do |map|
-+#
-+# map.connect "/app_stuff", :controller => "application_thing" # etc...
-+#
-+# # This line includes the routes from the given plugin at this point, giving you
-+# # control over the priority of your application routes
-+# map.from_plugin :your_plugin
-+#
-+# map.connect ":controller/:action/:id"
-+# end
-+#
-+# By including routes in plugins which have controllers, you can now share in a simple way
-+# a compact and elegant URL scheme which corresponds to those controllers.
-+#
-+# ---
-+#
-+# The Engines::RailsExtensions::Routing module defines extensions to Rails'
-+# routing (ActionController::Routing) mechanism such that routes can be loaded
-+# from a given plugin.
-+#
-+# The key method is Engines::RailsExtensions::Routing#from_plugin, which can be called
-+# within your application's <tt>config/routes.rb</tt> file to load plugin routes at that point.
-+#
-+module Engines::RailsExtensions::Routing
-+ # Loads the set of routes from within a plugin and evaluates them at this
-+ # point within an application's main <tt>routes.rb</tt> file.
-+ #
-+ # Plugin routes are loaded from <tt><plugin_root>/routes.rb</tt>.
-+ def from_plugin(name)
-+ map = self # to make 'map' available within the plugin route file
-+ begin
-+ routes_path = Engines.plugins[name].routes_path
-+ Engines.logger.debug "loading routes from #{routes_path}"
-+ eval(IO.read(routes_path), binding, routes_path) if File.file?(routes_path)
-+ rescue
-+ end
-+ end
-+end
-+
-+
-+module ::ActionController #:nodoc:
-+ module Routing #:nodoc:
-+ class RouteSet #:nodoc:
-+ class Mapper #:nodoc:
-+ include Engines::RailsExtensions::Routing
-+ end
-+ 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
- # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
- # Keep in mind you can assign values other than :controller and :action
-
-+ # Allow Redmine plugins to map routes and potentially override them
-+ Rails.plugins.each do |plugin|
-+ map.from_plugin plugin.name.to_sym
-+ end
-+
- map.home '', :controller => 'welcome'
-
- map.signin 'login', :controller => 'account', :action => 'login'
Modified: trunk/redmine/debian/patches/series
===================================================================
--- trunk/redmine/debian/patches/series 2010-02-28 15:44:17 UTC (rev 4834)
+++ trunk/redmine/debian/patches/series 2010-02-28 15:44:24 UTC (rev 4835)
@@ -8,11 +8,11 @@
0008-Wrong-path-for-interpreter.patch
0009-Allows-environment-variables-to-setup-debian-paths.patch
0010-Duplicate-name-value-in-request.patch
-0012-Sanitize-textarea-id-for-rails2.2.patch
-0013-OrderedHash-to-Hash.patch
-0014-Monkey-patches-for-group-support-taken-from-rails-2..patch
-0015-Move-session-configuration-to-YML-file-next-to-datab.patch
-0016-Request-forgery-protection-allow-XHR.patch
-0017-plugin_assets_in_var_dir.patch
-0018-dump_schema_to_cache_dir.patch
-0019-engines-rails2.2.patch
+0011-Sanitize-textarea-id-for-rails2.2.patch
+0012-OrderedHash-to-Hash.patch
+0013-Monkey-patches-for-group-support-taken-from-rails-2..patch
+0014-Move-session-configuration-to-YML-file-next-to-datab.patch
+0015-Request-forgery-protection-allow-XHR.patch
+0016-plugin_assets_in_var_dir.patch
+0017-dump_schema_to_cache_dir.patch
+0018-engines-rails2.2.patch
More information about the Pkg-ruby-extras-commits
mailing list