Merged trunk r1773.

git-svn-id: http://redmine.rubyforge.org/svn/branches/work@1774 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2008-08-30 14:41:07 +00:00
parent ab83ed5d8e
commit a377069fb2
398 changed files with 14736 additions and 5683 deletions
+105 -15
View File
@@ -1,19 +1,109 @@
# Don't change this file. Configuration is done in config/environment.rb and config/environments/*.rb
# Don't change this file!
# Configure your app in config/environment.rb and config/environments/*.rb
unless defined?(RAILS_ROOT)
root_path = File.join(File.dirname(__FILE__), '..')
unless RUBY_PLATFORM =~ /mswin32/
require 'pathname'
root_path = Pathname.new(root_path).cleanpath(true).to_s
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
module Rails
class << self
def boot!
unless booted?
preinitialize
pick_boot.run
end
end
def booted?
defined? Rails::Initializer
end
def pick_boot
(vendor_rails? ? VendorBoot : GemBoot).new
end
def vendor_rails?
File.exist?("#{RAILS_ROOT}/vendor/rails")
end
def preinitialize
load(preinitializer_path) if File.exist?(preinitializer_path)
end
def preinitializer_path
"#{RAILS_ROOT}/config/preinitializer.rb"
end
end
class Boot
def run
load_initializer
Rails::Initializer.run(:set_load_path)
end
end
class VendorBoot < Boot
def load_initializer
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
Rails::Initializer.run(:install_gem_spec_stubs)
end
end
class GemBoot < Boot
def load_initializer
self.class.load_rubygems
load_rails_gem
require 'initializer'
end
def load_rails_gem
if version = self.class.gem_version
gem 'rails', version
else
gem 'rails'
end
rescue Gem::LoadError => load_error
$stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
exit 1
end
class << self
def rubygems_version
Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion
end
def gem_version
if defined? RAILS_GEM_VERSION
RAILS_GEM_VERSION
elsif ENV.include?('RAILS_GEM_VERSION')
ENV['RAILS_GEM_VERSION']
else
parse_gem_version(read_environment_rb)
end
end
def load_rubygems
require 'rubygems'
unless rubygems_version >= '0.9.4'
$stderr.puts %(Rails requires RubyGems >= 0.9.4 (you have #{rubygems_version}). Please `gem update --system` and try again.)
exit 1
end
rescue LoadError
$stderr.puts %(Rails requires RubyGems >= 0.9.4. Please install RubyGems and try again: http://rubygems.rubyforge.org)
exit 1
end
def parse_gem_version(text)
$1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
end
private
def read_environment_rb
File.read("#{RAILS_ROOT}/config/environment.rb")
end
end
end
RAILS_ROOT = root_path
end
if File.directory?("#{RAILS_ROOT}/vendor/rails")
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
else
require 'rubygems'
require 'initializer'
end
Rails::Initializer.run(:set_load_path)
# All that for this:
Rails.boot!
+3
View File
@@ -12,6 +12,7 @@ production:
host: localhost
username: root
password:
encoding: utf8
development:
adapter: mysql
@@ -19,6 +20,7 @@ development:
host: localhost
username: root
password:
encoding: utf8
test:
adapter: mysql
@@ -26,6 +28,7 @@ test:
host: localhost
username: root
password:
encoding: utf8
test_pgsql:
adapter: postgresql
+21
View File
@@ -0,0 +1,21 @@
# Outgoing email settings
production:
delivery_method: :smtp
smtp_settings:
address: smtp.example.net
port: 25
domain: example.net
authentication: :login
user_name: redmine@example.net
password: redmine
development:
delivery_method: :smtp
smtp_settings:
address: 127.0.0.1
port: 25
domain: example.net
authentication: :login
user_name: redmine@example.net
password: redmine
+6 -51
View File
@@ -5,7 +5,7 @@
# ENV['RAILS_ENV'] ||= 'production'
# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.0.2' unless defined? RAILS_GEM_VERSION
RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
@@ -31,7 +31,7 @@ Rails::Initializer.run do |config|
# config.log_level = :debug
# Use the database for sessions instead of the file system
# (create the session table with 'rake create_sessions_table')
# (create the session table with 'rake db:sessions:create')
# config.action_controller.session_store = :active_record_store
config.action_controller.session_store = :PStore
@@ -49,54 +49,9 @@ Rails::Initializer.run do |config|
# Use Active Record's schema dumper instead of SQL when creating the test database
# (enables use of different database adapters for development and test environments)
# config.active_record.schema_format = :ruby
# See Rails::Configuration for more options
# SMTP server configuration
config.action_mailer.smtp_settings = {
:address => "127.0.0.1",
:port => 25,
:domain => "somenet.foo",
:authentication => :login,
:user_name => "redmine@somenet.foo",
:password => "redmine",
}
config.action_mailer.perform_deliveries = true
# Tell ActionMailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
#config.action_mailer.delivery_method = :test
config.action_mailer.delivery_method = :smtp
# Deliveries are disabled by default. Do NOT modify this section.
# Define your email configuration in email.yml instead.
# It will automatically turn deliveries on
config.action_mailer.perform_deliveries = false
end
ActiveRecord::Errors.default_error_messages = {
:inclusion => "activerecord_error_inclusion",
:exclusion => "activerecord_error_exclusion",
:invalid => "activerecord_error_invalid",
:confirmation => "activerecord_error_confirmation",
:accepted => "activerecord_error_accepted",
:empty => "activerecord_error_empty",
:blank => "activerecord_error_blank",
:too_long => "activerecord_error_too_long",
:too_short => "activerecord_error_too_short",
:wrong_length => "activerecord_error_wrong_length",
:taken => "activerecord_error_taken",
:not_a_number => "activerecord_error_not_a_number"
}
ActionView::Base.field_error_proc = Proc.new{ |html_tag, instance| "#{html_tag}" }
Mime::SET << Mime::CSV unless Mime::SET.include?(Mime::CSV)
Mime::Type.register 'application/pdf', :pdf
GLoc.set_config :default_language => :en
GLoc.clear_strings
GLoc.set_kcode
GLoc.load_localized_strings
GLoc.set_config(:raise_string_not_found_errors => false)
require 'redmine'
+1
View File
@@ -13,4 +13,5 @@ config.whiny_nils = true
config.action_controller.consider_all_requests_local = true
config.action_controller.perform_caching = false
config.action_mailer.perform_deliveries = true
config.action_mailer.delivery_method = :test
+2 -1
View File
@@ -13,4 +13,5 @@ config.whiny_nils = true
config.action_controller.consider_all_requests_local = true
config.action_controller.perform_caching = false
config.action_mailer.delivery_method = :test
config.action_mailer.perform_deliveries = true
config.action_mailer.delivery_method = :test
+2 -1
View File
@@ -13,4 +13,5 @@ config.whiny_nils = true
config.action_controller.consider_all_requests_local = true
config.action_controller.perform_caching = false
config.action_mailer.delivery_method = :test
config.action_mailer.perform_deliveries = true
config.action_mailer.delivery_method = :test
+17
View File
@@ -0,0 +1,17 @@
ActiveRecord::Errors.default_error_messages = {
:inclusion => "activerecord_error_inclusion",
:exclusion => "activerecord_error_exclusion",
:invalid => "activerecord_error_invalid",
:confirmation => "activerecord_error_confirmation",
:accepted => "activerecord_error_accepted",
:empty => "activerecord_error_empty",
:blank => "activerecord_error_blank",
:too_long => "activerecord_error_too_long",
:too_short => "activerecord_error_too_short",
:wrong_length => "activerecord_error_wrong_length",
:taken => "activerecord_error_taken",
:not_a_number => "activerecord_error_not_a_number"
}
ActionView::Base.field_error_proc = Proc.new{ |html_tag, instance| "#{html_tag}" }
@@ -0,0 +1,4 @@
# Add new mime types for use in respond_to blocks:
Mime::SET << Mime::CSV unless Mime::SET.include?(Mime::CSV)
Mime::Type.register 'application/pdf', :pdf
+7
View File
@@ -0,0 +1,7 @@
GLoc.set_config :default_language => :en
GLoc.clear_strings
GLoc.set_kcode
GLoc.load_localized_strings
GLoc.set_config(:raise_string_not_found_errors => false)
require 'redmine'
+17
View File
@@ -0,0 +1,17 @@
# Loads action_mailer settings from email.yml
# and turns deliveries on if configuration file is found
filename = File.join(File.dirname(__FILE__), '..', 'email.yml')
if File.file?(filename)
mailconfig = YAML::load_file(filename)
if mailconfig.is_a?(Hash) && mailconfig.has_key?(Rails.env)
# Enable deliveries
ActionMailer::Base.perform_deliveries = true
mailconfig[Rails.env].each do |k, v|
v.symbolize_keys! if v.respond_to?(:symbolize_keys!)
ActionMailer::Base.send("#{k}=", v)
end
end
end
+5
View File
@@ -31,8 +31,13 @@ ActionController::Routing::Routes.draw do |map|
omap.repositories_diff 'repositories/diff/:id/*path', :action => 'diff'
omap.repositories_entry 'repositories/entry/:id/*path', :action => 'entry'
omap.repositories_entry 'repositories/annotate/:id/*path', :action => 'annotate'
omap.repositories_revision 'repositories/revision/:id/:rev', :action => 'revision'
end
map.connect 'attachments/:id', :controller => 'attachments', :action => 'show', :id => /\d+/
map.connect 'attachments/:id/:filename', :controller => 'attachments', :action => 'show', :id => /\d+/, :filename => /.*/
map.connect 'attachments/download/:id/:filename', :controller => 'attachments', :action => 'download', :id => /\d+/, :filename => /.*/
# Allow downloading Web Service WSDL as a file with an extension
# instead of a file named 'wsdl'
map.connect ':controller/service.wsdl', :action => 'wsdl'
+17 -1
View File
@@ -43,7 +43,7 @@ activity_days_default:
per_page_options:
default: '25,50,100'
mail_from:
default: redmine@somenet.foo
default: redmine@example.net
bcc_recipients:
default: 1
text_formatting:
@@ -59,6 +59,15 @@ protocol:
feeds_limit:
format: int
default: 15
enabled_scm:
serialized: true
default:
- Subversion
- Darcs
- Mercurial
- Cvs
- Bazaar
- Git
autofetch_changesets:
default: 1
sys_api_enabled:
@@ -92,6 +101,10 @@ notified_events:
default:
- issue_added
- issue_updated
mail_handler_api_enabled:
default: 0
mail_handler_api_key:
default:
issue_list_default_columns:
serialized: true
default:
@@ -109,6 +122,9 @@ default_projects_public:
# multiple values accepted, comma separated
repositories_encodings:
default: ''
# encoding used to convert commit logs to UTF-8
commit_logs_encoding:
default: 'UTF-8'
ui_theme:
default: ''
emails_footer: