Skip to content

Commit

Permalink
added new yarps_config.yml file for general config options. removed m…
Browse files Browse the repository at this point in the history
…ail.rb-initializer, mailer now set from yarps_config.yml in environment.rb
  • Loading branch information
bakkdoor committed Sep 5, 2008
1 parent 2a233a3 commit d412193
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 16 deletions.
23 changes: 17 additions & 6 deletions src/config/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')

# Load custom config file for current environment
require 'yaml'
YARPS_CONFIG = YAML.load(File.read(RAILS_ROOT + "/config/yarps_config.yml"))[RAILS_ENV]

Rails::Initializer.run do |config|
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
Expand Down Expand Up @@ -41,16 +45,23 @@
# Make Time.zone default to the specified zone, and make Active Record store time values
# in the database in UTC, and return them converted to the specified local zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Uncomment to use default local time.
config.time_zone = 'UTC'

#config.time_zone = 'UTC'
config.time_zone = YARPS_CONFIG[:time_zone] || 'UTC'

config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => YARPS_CONFIG['mailer']['address'],
:domain => YARPS_CONFIG['mailer']['domain'],
:port => YARPS_CONFIG['mailer']['port'],
:user_name => YARPS_CONFIG['mailer']['user_name'],
:password => YARPS_CONFIG['mailer']['password'],
:authentication => YARPS_CONFIG['mailer']['authentication'] }

# Your secret key for verifying cookie session data integrity.
# If you 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.
config.action_controller.session = {
:session_key => '_projmgr_session',
:secret => 'eb012faf46e5c22bf557b2019a7bd16c8fa1fb18530829355a2482d45bbc3cb5e1031a1ef4654c0bb37e1b355483a948b3959d3b202938efe59dadbc5fafe54b'
}
config.action_controller.session = YARPS_CONFIG['session']

# ruby-gem dependencies
config.gem "RedCloth", :version => ">= 3.301", :source => "http://code.whytheluckystiff.net/"
Expand Down
10 changes: 0 additions & 10 deletions src/config/initializers/mail.rb

This file was deleted.

29 changes: 29 additions & 0 deletions src/config/yarps_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
default: &default
yarps_version: 0.1
host: localhost:3000
time_zone: Berlin
email: mail@example.com
session:
session_key: "_projmgr_session"
secret: eb012faf46e5c22bf557b2019a7bd16c8fa1fb18530829355a2482d45bbc3cb5e1031a1ef4654c0bb37e1b355483a948b3959d3b202938efe59dadbc5fafe54b
mailer:
address: smtp.example.com
domain: localhost:3000
port: 25
from: mail@example.com
user_name: user
password: password
authentication: login

development:
<<: *default

test:
<<: *default

production:
<<: *default
use_ssl: true
ssl_certificate_common_name: openid.flasht.de
ssl_certificate_sha1: D2:1B:D8:C4:39:B7:EE:10:DA:E2:4E:0A:65:98:8E:27:C9:32:4B:F0

0 comments on commit d412193

Please sign in to comment.