Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Commit

Permalink
Extracting Configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffersongirao committed Oct 9, 2012
1 parent 3ec16ed commit 1d47dff
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/mailers/candidate_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# encoding: utf-8
class CandidateMailer < ActionMailer::Base
default from: "sistema@votocomovamos.com.br"
default from: Settings.email_sender

def claim(candidate_id)
@candidate = Candidate.find(candidate_id)
Expand Down
7 changes: 7 additions & 0 deletions config/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ common:
facebook_scopes: "offline_access,read_stream,email"
heroku_app_url: "http://voto-como-vamos.herokuapp.com"
facebook_permission_request_url: "http://www.facebook.com/connect/uiserver.php"
email_sender: "sistema@votocomovamos.com.br"
exception_sender: "noreply@votocomovamos.com.br"
exception_recipient: "votocomovamos@thoughtworks.com"
fqdn: "www.votocomovamos.com.br"
mailtrap_io_user: "votocomovamos"
mailtrap_io_password: "7abaf1e52c5bc55d"

development:
facebook_app_id: 342716239136799
Expand All @@ -16,6 +22,7 @@ test:
staging:
facebook_app_id: 250842391695084
facebook_app_url: "http://apps.facebook.com/250842391695084"
fqdn: "teste.votocomovamos.com.br"

production:
facebook_app_id: 502204129793230
Expand Down
2 changes: 2 additions & 0 deletions config/environment.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Load the rails application
require File.expand_path('../application', __FILE__)

require File.expand_path('../settings', __FILE__)

# Initialize the rails application
VotoComoVamos::Application.initialize!
4 changes: 2 additions & 2 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@

ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:user_name => "votocomovamos",
:password => "7abaf1e52c5bc55d",
:user_name => Settings.mailtrap_io_user,
:password => Settings.mailtrap_io_password,
:address => "mailtrap.io",
:port => 2525,
:authentication => :plain
Expand Down
12 changes: 6 additions & 6 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,22 @@
# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL)
# config.active_record.auto_explain_threshold_in_seconds = 0.5
config.action_controller.asset_host = "http://www.votocomovamos.com.br"
config.action_mailer.asset_host = "http://www.votocomovamos.com.br"
config.action_controller.asset_host = "http://#{Settings.fqdn}"
config.action_mailer.asset_host = "http://#{Settings.fqdn}"
config.action_mailer.default_url_options = {
:host => "www.votocomovamos.com.br"
:host => Settings.fqdn
}
ActionMailer::Base.smtp_settings = {
:port => ENV['MAILGUN_SMTP_PORT'],
:address => ENV['MAILGUN_SMTP_SERVER'],
:user_name => ENV['MAILGUN_SMTP_LOGIN'],
:password => ENV['MAILGUN_SMTP_PASSWORD'],
:domain => 'www.votocomovamos.com.br',
:domain => Settings.fqdn,
:authentication => :plain,
}
ActionMailer::Base.delivery_method = :smtp

config.middleware.use ExceptionNotifier,
sender_address: 'noreply@votocomovamos.com.br',
exception_recipients: 'votocomovamos@thoughtworks.com'
sender_address: Settings.exception_sender
exception_recipients: Settings.exception_recipient
end
6 changes: 3 additions & 3 deletions config/environments/staging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,16 @@
# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL)
# config.active_record.auto_explain_threshold_in_seconds = 0.5
config.action_mailer.asset_host = "http://teste.votocomovamos.com.br"
config.action_mailer.asset_host = "http://#{Settings.fqdn}"
config.action_mailer.default_url_options = {
:host => "teste.votocomovamos.com.br"
:host => Settings.fqdn
}
ActionMailer::Base.smtp_settings = {
:port => ENV['MAILGUN_SMTP_PORT'],
:address => ENV['MAILGUN_SMTP_SERVER'],
:user_name => ENV['MAILGUN_SMTP_LOGIN'],
:password => ENV['MAILGUN_SMTP_PASSWORD'],
:domain => 'teste.votocomovamos.com.br',
:domain => Settings.fqdn,
:authentication => :plain,
}
ActionMailer::Base.delivery_method = :smtp
Expand Down
File renamed without changes.

0 comments on commit 1d47dff

Please sign in to comment.