Ignore:
Timestamp:
Jul 17, 2012, 7:04:07 PM (12 years ago)
Author:
glasgall
Message:
Properly find the name of the application class for Rails apps

The previous method was a hack that broke on apps with hyphens in the
name. Actually read it out of config/application.rb now.
File:
1 edited

Legend:

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

    r2260 r2261  
    4343my $appdir = `basename $cwd`;
    4444chomp $appdir;
    45 my $appclass = ucfirst $appdir;
     45
     46open APPLICATION_RB, "config/application.rb";
     47my $appclass;
     48while(<APPLICATION_RB>) {
     49    if (/module (\w+)\n/) {
     50        $appclass = $1;
     51        last;
     52    }
     53}
     54close APPLICATION_RB;
     55if (!$appclass) {
     56    open FAILED, ">.failed";
     57    close FAILED;
     58    die "Couldn't find application class name - plase email scripts\@mit.edu with the names of your locker and the application you tried to create. Sorry!";
     59}
    4660
    4761open PUBLIC_HTACCESS, ">public/.htaccess";
Note: See TracChangeset for help on using the changeset viewer.