Changeset 2280 for branches/locker-dev


Ignore:
Timestamp:
Aug 1, 2012, 12:43:11 AM (12 years ago)
Author:
glasgall
Message:
Set config.action_controller.asset_host for all environments so link generation for static assets works
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/locker-dev/locker/deploy/bin/rails

    r2279 r2280  
    127127untie @railswelcome;
    128128
     129# set config.action_controller.asset_host for all environments,
     130# so urls to static assets are generated correctly
     131# regardless of how the app is accessed
     132my $rails_assethost = "  config.action_controller.asset_host = \"//$USER.scripts.mit.edu/$appdir/public\"";
     133my @environments = ('development', 'production', 'test');
     134
     135for my $environment (@environments) {
     136    tie my @envfile, 'Tie::File', "config/environments/$environment.rb";
     137    my $i = 0;
     138    for (@envfile) {
     139        if (/^end$/) {
     140            last;
     141        }
     142        ++$i;
     143    }
     144    splice @envfile, $i, 1, ($rails_assethost, 'end');
     145    untie @envfile;
     146}
     147
     148
    129149tie my @railsfcgi, 'Tie::File', 'public/dispatch.fcgi';
    130150for (@railsfcgi) {
Note: See TracChangeset for help on using the changeset viewer.