Permalink
Browse files

replaced environment-dependent properties with ENV variables

  • Loading branch information...
1 parent 19ab920 commit b1d25359b28cceda2c89b1be4736978687bf1610 Tom Bostelmann committed Feb 8, 2010
View
50 app/controllers/application_controller.rb
@@ -33,31 +33,31 @@ class ApplicationController < ActionController::Base
PRODUCTION_LIKE_ENVIRONMENTS = [ 'production', 'demo' ]
- def rescue_action ( exception )
- deliverer = self.class.exception_data
- data = case deliverer
- when nil then
- {}
- when Symbol then
- send(deliverer)
- when Proc then
- deliverer.call(self)
- end
-
- logger.debug{" RESCUE : #{exception.inspect}"}
- ExceptionNotifier.deliver_exception_notification(exception, self,
- request, data)
-
- if PRODUCTION_LIKE_ENVIRONMENTS.include?(RAILS_ENV)
- # show only a pretty error page
- render :template => "common/general_error.html.erb" and return false
- else
- # show the normal stacktrace to aid in debugging
- super exception
- end
-
- return false
- end
+# def rescue_action ( exception )
+# deliverer = self.class.exception_data
+# data = case deliverer
+# when nil then
+# {}
+# when Symbol then
+# send(deliverer)
+# when Proc then
+# deliverer.call(self)
+# end
+#
+# logger.debug{" RESCUE : #{exception.inspect}"}
+# ExceptionNotifier.deliver_exception_notification(exception, self,
+# request, data)
+#
+# if PRODUCTION_LIKE_ENVIRONMENTS.include?(RAILS_ENV)
+# # show only a pretty error page
+# render :template => "common/general_error.html.erb" and return false
+# else
+# # show the normal stacktrace to aid in debugging
+# super exception
+# end
+#
+# return false
+# end
# --------------------------------------------------------------------------
# overide the base action to add logging set handy vars
View
2 app/controllers/pledges_controller.rb
@@ -143,7 +143,7 @@ def paypal_redirect_params(pledge)
:return => url_for(:only_path => false, :action => 'done'),
:invoice => @pledge.id,
:tax => "0.00",
- :business => AppConfig.paypal_account,
+ :business => ENV['PAYPAL_ACCOUNT'],
:address_override => "0",
:shipping => "0.00",
:no_note => "1",
View
8 app/views/pledges/invoice/_summary_row_to_pp.html.haml
@@ -3,19 +3,19 @@
%td{:valign => "top", :align => "right", :colspan => "2"}
= link_to((image_tag "#{image_path('buttons/more.gif')}", :alt => :add_more_savers.l), match_savers_path)
%td{:valign => "top", :align => "center"}
- %form{:action => AppConfig.paypal_url.to_s, :id => "payment-form", :method => "post", :class => "MainForm"}
+ %form{:action => ENV['PAYPAL_URL'], :id => "payment-form", :method => "post", :class => "MainForm"}
= hidden_field_tag :cancel_return, url_for(:only_path => false, :action => 'cancel')
= hidden_field_tag :bn, "ActiveMerchant"
= hidden_field_tag :redirect_cmd, "_cart"
= hidden_field_tag :cmd, "_cart"
= hidden_field_tag :upload, "1"
- = hidden_field_tag :notify_url, url_for(:only_path => false, :action => 'notify', :protocol => AppConfig.paypal_return_protocol.to_s)
+ = hidden_field_tag :notify_url, url_for(:only_path => false, :action => 'notify', :protocol => ENV['SECURE_PROTOCOL'])
= hidden_field_tag :charset, "utf-8"
- = hidden_field_tag :return, url_for(:only_path => false, :action => 'done', :protocol => AppConfig.paypal_return_protocol.to_s)
+ = hidden_field_tag :return, url_for(:only_path => false, :action => 'done', :protocol => ENV['SECURE_PROTOCOL'])
= hidden_field_tag :invoice, @pledge.id
= hidden_field_tag :tax, "0.00"
- = hidden_field_tag :business, AppConfig.paypal_account.to_s
+ = hidden_field_tag :business, ENV['PAYPAL_ACCOUNT']
= hidden_field_tag :address_override, "0"
= hidden_field_tag :shipping, "0.00"
= hidden_field_tag :no_note, "1"
View
2 app/views/user_notifier/reset_password.html.haml
@@ -6,7 +6,7 @@
=""
="Please go to the Sign In page (#{@url}#{login_path}) and sign in with your new password. Afterwards you may wish to reset your password to one of your own choosing at the My Profile page (#{@url}#{donor_path(@user)})."
=""
-="If you have any questions, please contact SaveTogether support at #{AppConfig.support_email}."
+="If you have any questions, please contact SaveTogether support at #{ENV['SUPPORT_EMAIL']}."
=""
="Thanks,"
="The SaveTogether Team"
View
27 config/database.yml.postgres
@@ -0,0 +1,27 @@
+# PostgreSQL. Versions 7.4 and 8.x are supported.
+#
+# Install the ruby-postgres driver:
+# gem install ruby-postgres
+# On Mac OS X:
+# gem install ruby-postgres -- --include=/usr/local/pgsql
+# On Windows:
+# gem install ruby-postgres
+# Choose the win32 build.
+# Install PostgreSQL and put its /bin directory on your path.
+development:
+ adapter: postgresql
+ encoding: unicode
+ database: st_development
+ pool: 5
+
+test:
+ adapter: postgresql
+ encoding: unicode
+ database: st_test
+ pool: 5
+
+production:
+ adapter: postgresql
+ encoding: unicode
+ database: st_production
+ pool: 5
View
6 config/database.yml.sample
@@ -4,7 +4,7 @@ development:
database: st_development
username: root
password: save.together
- socket: /var/lib/mysql/mysql.sock
+ socket: /var/run/mysqld/mysqld.sock
timeout: 5000
# Warning: The database defined as "test" will be erased and
@@ -16,7 +16,7 @@ test:
database: st_test
username: root
password: save.together
- socket: /var/lib/mysql/mysql.sock
+ socket: /var/run/mysqld/mysqld.sock
timeout: 5000
production:
@@ -25,6 +25,6 @@ production:
database: st_production
username: root
password: save.together
- socket: /var/lib/mysql/mysql.sock
+ socket: /var/run/mysqld/mysqld.sock
timeout: 5000
View
8 config/environment.rb
@@ -59,16 +59,16 @@
end# Include your application configuration below
require "#{RAILS_ROOT}/vendor/plugins/community_engine/config/boot.rb"
-APP_URL = AppConfig.app_url
+APP_URL = ENV['APP_URL']
-unless ENV['RAILS_ENV'] == 'production'
+if ENV['PAYPAL_ENV'] == 'test'
ActiveMerchant::Billing::Base.mode = :test
end
-PAYPAL_ACCOUNT = AppConfig.paypal_account
+PAYPAL_ACCOUNT = ENV['PAYPAL_ACCOUNT']
error_email = AppConfig.exception_notification_email
ExceptionNotifier.exception_recipients = error_email
-ExceptionNotifier.sender_address = AppConfig.support_email
+ExceptionNotifier.sender_address = ENV['SUPPORT_EMAIL']
I18n.reload!
require "ruport"

0 comments on commit b1d2535

Please sign in to comment.