[DRE-commits] [SCM] redmine.git branch, master-experimental, updated. debian/1.4.4+dfsg1-1-35-g042f641

Ondřej Surý ondrej at sury.org
Wed Oct 17 11:19:34 UTC 2012


The following commit has been merged in the master-experimental branch:
commit aa3d2e51056333ac7ddd51c0cf0010b13e76cb40
Author: Ondřej Surý <ondrej at sury.org>
Date:   Mon Oct 15 18:04:17 2012 +0200

    Move rest of the extra code from enviroment.rb to additional_environment.rb and start properly using Rails.env instead of ENV['RAILS_ENV']

diff --git a/debian/patches/2002_FHS_through_env_vars.patch b/debian/patches/2002_FHS_through_env_vars.patch
index 213a0dd..173997b 100644
--- a/debian/patches/2002_FHS_through_env_vars.patch
+++ b/debian/patches/2002_FHS_through_env_vars.patch
@@ -55,21 +55,8 @@ Last-Update: 2012-01-19
            pdf_encoding = l(:general_pdf_encoding).upcase
 --- /dev/null
 +++ b/config/additional_environment.rb
-@@ -0,0 +1,7 @@
-+# log path
-+config.paths['log'] = File.join(ENV['RAILS_LOG'], "#{ENV['RAILS_ENV']}.log") unless !ENV['RAILS_LOG']
-+
-+config.cache_store = :file_store, ENV['RAILS_CACHE']
-+
-+# Set Active Record's database.yml path
-+config.paths['config/database'] = File.join(ENV['RAILS_ETC'], 'database.yml') unless !ENV['RAILS_ETC']
---- a/config/environment.rb
-+++ b/config/environment.rb
-@@ -10,5 +10,15 @@ if Dir.glob(File.join(vendor_plugins_dir
-   exit 1
- end
- 
-+ENV['RAILS_ENV'] ||= 'production'
+@@ -0,0 +1,17 @@
++Rails.env ||= ActiveSupport::StringInquirer.new('production')
 +
 +# for debian package : setup proper environment variables and paths
 +# To run redmine as unprivileged user, see /usr/share/doc/redmine/README.Debian
@@ -79,5 +66,10 @@ Last-Update: 2012-01-19
 +ENV['RAILS_VAR'] ||= "/var/lib/redmine/#{ENV['X_DEBIAN_SITEID']}"
 +ENV['RAILS_CACHE'] ||= "/var/cache/redmine/#{ENV['X_DEBIAN_SITEID']}"
 +
- # Initialize the rails application
- RedmineApp::Application.initialize!
++# log path
++config.paths['log'] = File.join(ENV['RAILS_LOG'], "#{Rails.env}.log") unless !ENV['RAILS_LOG']
++
++config.cache_store = :file_store, ENV['RAILS_CACHE']
++
++# Set Active Record's database.yml path
++config.paths['config/database'] = File.join(ENV['RAILS_ETC'], 'database.yml') unless !ENV['RAILS_ETC']
diff --git a/debian/patches/2003_externalize_session_config.patch b/debian/patches/2003_externalize_session_config.patch
index 065a7e8..e061230 100644
--- a/debian/patches/2003_externalize_session_config.patch
+++ b/debian/patches/2003_externalize_session_config.patch
@@ -48,12 +48,13 @@ Last-Update: 2010-01-10
 -
 -desc 'Generates a secret token for the application.'
 -task :generate_secret_token => ['config/initializers/secret_token.rb']
---- a/config/environment.rb
-+++ b/config/environment.rb
-@@ -20,5 +20,19 @@ ENV['RAILS_LOG'] ||= "/var/log/redmine/#
- ENV['RAILS_VAR'] ||= "/var/lib/redmine/#{ENV['X_DEBIAN_SITEID']}"
- ENV['RAILS_CACHE'] ||= "/var/cache/redmine/#{ENV['X_DEBIAN_SITEID']}"
+--- a/config/additional_environment.rb
++++ b/config/additional_environment.rb
+@@ -15,3 +15,18 @@ config.cache_store = :file_store, ENV['R
  
+ # Set Active Record's database.yml path
+ config.paths['config/database'] = File.join(ENV['RAILS_ETC'], 'database.yml') unless !ENV['RAILS_ETC']
++
 +# 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.
@@ -62,11 +63,9 @@ Last-Update: 2010-01-10
 +sessionconfig = YAML::load_file(filename)
 +require 'action_controller'
 +relativeUrlRoot = ENV['RAILS_RELATIVE_URL_ROOT']
-+ActionController::Base.session = {
++
++config.session_store :cookie_store, {
 +  :key => sessionconfig[Rails.env]['key'],
 +  :secret => sessionconfig[Rails.env]['secret'],
 +  :path => (relativeUrlRoot.blank?) ? '/' : relativeUrlRoot
 +}
-+
- # Initialize the rails application
- RedmineApp::Application.initialize!
diff --git a/debian/patches/2005_FHS_schema_dump.patch b/debian/patches/2005_FHS_schema_dump.patch
index 58b3401..fc8fa58 100644
--- a/debian/patches/2005_FHS_schema_dump.patch
+++ b/debian/patches/2005_FHS_schema_dump.patch
@@ -4,13 +4,13 @@ Description: FHS schema dump
 Forwarded: not-needed
 Author: Jérémy Lal <kapouer at melix.org>
 Last-Update: 2010-05-25
---- a/config/environment.rb
-+++ b/config/environment.rb
-@@ -19,6 +19,7 @@ ENV['RAILS_ETC'] ||= "/etc/redmine/#{ENV
+--- a/config/additional_environment.rb
++++ b/config/additional_environment.rb
+@@ -7,6 +7,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"
  
- # loads cookie based session session and secret keys
- # this is needed here because initializers are loaded after plugins,
+ # log path
+ config.paths['log'] = File.join(ENV['RAILS_LOG'], "#{Rails.env}.log") unless !ENV['RAILS_LOG']
diff --git a/debian/patches/2009_FHS_thin_config.patch b/debian/patches/2009_FHS_thin_config.patch
index ce5e48c..0a90874 100644
--- a/debian/patches/2009_FHS_thin_config.patch
+++ b/debian/patches/2009_FHS_thin_config.patch
@@ -3,9 +3,9 @@ Description: FHS support for thin config
 Forwarded: not-needed
 Author: Jérémy Lal <kapouer at melix.org>
 Last-Update: 2010-11-01
---- a/config/environment.rb
-+++ b/config/environment.rb
-@@ -14,6 +14,7 @@ ENV['RAILS_ENV'] ||= 'production'
+--- a/config/additional_environment.rb
++++ b/config/additional_environment.rb
+@@ -2,6 +2,7 @@ Rails.env ||= ActiveSupport::StringInqui
  
  # for debian package : setup proper environment variables and paths
  # To run redmine as unprivileged user, see /usr/share/doc/redmine/README.Debian

-- 
redmine.git



More information about the Pkg-ruby-extras-commits mailing list