Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

replaced environment-dependent properties with ENV variables

  • Loading branch information...
commit b1d25359b28cceda2c89b1be4736978687bf1610 1 parent 19ab920
authored February 08, 2010
50  app/controllers/application_controller.rb
@@ -33,31 +33,31 @@ class ApplicationController < ActionController::Base
33 33
 
34 34
   PRODUCTION_LIKE_ENVIRONMENTS = [ 'production', 'demo' ]
35 35
 
36  
-  def rescue_action ( exception )
37  
-    deliverer = self.class.exception_data
38  
-    data = case deliverer
39  
-      when nil then
40  
-        {}
41  
-      when Symbol then
42  
-        send(deliverer)
43  
-      when Proc then
44  
-        deliverer.call(self)
45  
-    end
46  
-
47  
-    logger.debug{" RESCUE : #{exception.inspect}"}
48  
-    ExceptionNotifier.deliver_exception_notification(exception, self,
49  
-                                                     request, data)
50  
-
51  
-    if PRODUCTION_LIKE_ENVIRONMENTS.include?(RAILS_ENV)
52  
-      # show only a pretty error page
53  
-      render :template => "common/general_error.html.erb" and return false
54  
-    else
55  
-      # show the normal stacktrace to aid in debugging
56  
-      super exception
57  
-    end
58  
-
59  
-    return false
60  
-  end
  36
+#  def rescue_action ( exception )
  37
+#    deliverer = self.class.exception_data
  38
+#    data = case deliverer
  39
+#      when nil then
  40
+#        {}
  41
+#      when Symbol then
  42
+#        send(deliverer)
  43
+#      when Proc then
  44
+#        deliverer.call(self)
  45
+#    end
  46
+#
  47
+#    logger.debug{" RESCUE : #{exception.inspect}"}
  48
+#    ExceptionNotifier.deliver_exception_notification(exception, self,
  49
+#                                                     request, data)
  50
+#
  51
+#    if PRODUCTION_LIKE_ENVIRONMENTS.include?(RAILS_ENV)
  52
+#      # show only a pretty error page
  53
+#      render :template => "common/general_error.html.erb" and return false
  54
+#    else
  55
+#      # show the normal stacktrace to aid in debugging
  56
+#      super exception
  57
+#    end
  58
+#
  59
+#    return false
  60
+#  end
61 61
 
62 62
   # --------------------------------------------------------------------------
63 63
   # overide the base action to add logging set handy vars
2  app/controllers/pledges_controller.rb
@@ -143,7 +143,7 @@ def paypal_redirect_params(pledge)
143 143
       :return => url_for(:only_path => false, :action => 'done'),
144 144
       :invoice => @pledge.id,
145 145
       :tax => "0.00",
146  
-      :business => AppConfig.paypal_account,
  146
+      :business => ENV['PAYPAL_ACCOUNT'],
147 147
       :address_override => "0",
148 148
       :shipping => "0.00",
149 149
       :no_note => "1",
8  app/views/pledges/invoice/_summary_row_to_pp.html.haml
@@ -3,19 +3,19 @@
3 3
   %td{:valign => "top", :align => "right", :colspan => "2"}
4 4
     = link_to((image_tag "#{image_path('buttons/more.gif')}", :alt => :add_more_savers.l), match_savers_path)
5 5
   %td{:valign => "top", :align => "center"}
6  
-    %form{:action => AppConfig.paypal_url.to_s, :id => "payment-form", :method => "post", :class => "MainForm"}
  6
+    %form{:action => ENV['PAYPAL_URL'], :id => "payment-form", :method => "post", :class => "MainForm"}
7 7
       = hidden_field_tag :cancel_return, url_for(:only_path => false, :action => 'cancel')
8 8
       = hidden_field_tag :bn, "ActiveMerchant"
9 9
       = hidden_field_tag :redirect_cmd, "_cart"
10 10
       = hidden_field_tag :cmd, "_cart"
11 11
       = hidden_field_tag :upload, "1"
12  
-      = hidden_field_tag :notify_url, url_for(:only_path => false, :action => 'notify', :protocol => AppConfig.paypal_return_protocol.to_s)
  12
+      = hidden_field_tag :notify_url, url_for(:only_path => false, :action => 'notify', :protocol => ENV['SECURE_PROTOCOL'])
13 13
       = hidden_field_tag :charset, "utf-8"
14  
-      = hidden_field_tag :return, url_for(:only_path => false, :action => 'done', :protocol => AppConfig.paypal_return_protocol.to_s)
  14
+      = hidden_field_tag :return, url_for(:only_path => false, :action => 'done', :protocol => ENV['SECURE_PROTOCOL'])
15 15
       = hidden_field_tag :invoice, @pledge.id
16 16
 
17 17
       = hidden_field_tag :tax, "0.00"
18  
-      = hidden_field_tag :business, AppConfig.paypal_account.to_s
  18
+      = hidden_field_tag :business, ENV['PAYPAL_ACCOUNT']
19 19
       = hidden_field_tag :address_override, "0"
20 20
       = hidden_field_tag :shipping, "0.00"
21 21
       = hidden_field_tag :no_note, "1"
2  app/views/user_notifier/reset_password.html.haml
@@ -6,7 +6,7 @@
6 6
 =""
7 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)})."
8 8
 =""
9  
-="If you have any questions, please contact SaveTogether support at #{AppConfig.support_email}."
  9
+="If you have any questions, please contact SaveTogether support at #{ENV['SUPPORT_EMAIL']}."
10 10
 =""
11 11
 ="Thanks,"
12 12
 ="The SaveTogether Team"
27  config/database.yml.postgres
... ...
@@ -0,0 +1,27 @@
  1
+# PostgreSQL. Versions 7.4 and 8.x are supported.
  2
+#
  3
+# Install the ruby-postgres driver:
  4
+#   gem install ruby-postgres
  5
+# On Mac OS X:
  6
+#   gem install ruby-postgres -- --include=/usr/local/pgsql
  7
+# On Windows:
  8
+#   gem install ruby-postgres
  9
+#       Choose the win32 build.
  10
+#       Install PostgreSQL and put its /bin directory on your path.
  11
+development:
  12
+  adapter: postgresql
  13
+  encoding: unicode
  14
+  database: st_development
  15
+  pool: 5
  16
+
  17
+test:
  18
+  adapter: postgresql
  19
+  encoding: unicode
  20
+  database: st_test
  21
+  pool: 5
  22
+
  23
+production:
  24
+  adapter: postgresql
  25
+  encoding: unicode
  26
+  database: st_production
  27
+  pool: 5
6  config/database.yml.sample
@@ -4,7 +4,7 @@ development:
4 4
   database: st_development
5 5
   username: root
6 6
   password: save.together
7  
-  socket: /var/lib/mysql/mysql.sock
  7
+  socket: /var/run/mysqld/mysqld.sock
8 8
   timeout: 5000
9 9
 
10 10
 # Warning: The database defined as "test" will be erased and
@@ -16,7 +16,7 @@ test:
16 16
   database: st_test
17 17
   username: root
18 18
   password: save.together
19  
-  socket: /var/lib/mysql/mysql.sock
  19
+  socket: /var/run/mysqld/mysqld.sock
20 20
   timeout: 5000
21 21
 
22 22
 production:
@@ -25,6 +25,6 @@ production:
25 25
   database: st_production
26 26
   username: root
27 27
   password: save.together
28  
-  socket: /var/lib/mysql/mysql.sock
  28
+  socket: /var/run/mysqld/mysqld.sock
29 29
   timeout: 5000
30 30
 
8  config/environment.rb
@@ -59,16 +59,16 @@
59 59
 end# Include your application configuration below
60 60
 require "#{RAILS_ROOT}/vendor/plugins/community_engine/config/boot.rb"
61 61
 
62  
-APP_URL = AppConfig.app_url
  62
+APP_URL = ENV['APP_URL']
63 63
 
64  
-unless ENV['RAILS_ENV'] == 'production'
  64
+if ENV['PAYPAL_ENV'] == 'test'
65 65
   ActiveMerchant::Billing::Base.mode = :test
66 66
 end
67  
-PAYPAL_ACCOUNT = AppConfig.paypal_account
  67
+PAYPAL_ACCOUNT = ENV['PAYPAL_ACCOUNT']
68 68
 
69 69
 error_email = AppConfig.exception_notification_email
70 70
 ExceptionNotifier.exception_recipients = error_email
71  
-ExceptionNotifier.sender_address = AppConfig.support_email
  71
+ExceptionNotifier.sender_address = ENV['SUPPORT_EMAIL']
72 72
 
73 73
 I18n.reload!
74 74
 require "ruport"

0 notes on commit b1d2535

Please sign in to comment.
Something went wrong with that request. Please try again.