Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 7708

Show
Ignore:
Timestamp:
10/01/07 03:15:51 (1 year ago)
Author:
nzkoz
Message:

Add --prefix option to script/server when using mongrel. [dacat] Closes #9716

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/railties/CHANGELOG

    r7705 r7708  
    33* Removed calls to fixtures in generated tests as fixtures :all is now present by default in test_helper.rb [DHH] 
    44 
     5* Add --prefix option to script/server when using mongrel. [dacat] 
    56 
    67*2.0.0 [Preview Release]* (September 29th, 2007) [Includes duplicates of changes from 1.1.4 - 1.2.3] 
  • trunk/railties/lib/commands/process/spawner.rb

    r6531 r7708  
    6666      "-l #{OPTIONS[:rails_root]}/log/mongrel.log" 
    6767 
     68    # Add prefix functionality to spawner's call to mongrel_rails 
     69    # Digging through monrel's project subversion server, the earliest 
     70    # Tag that has prefix implemented in the bin/mongrel_rails file 
     71    # is 0.3.15 which also happens to be the earilest tag listed. 
     72    # References: http://mongrel.rubyforge.org/svn/tags 
     73    if Mongrel::Const::MONGREL_VERSION.to_f >=0.3 && !OPTIONS[:prefix].nil? 
     74      cmd = cmd + " --prefix #{OPTIONS[:prefix]}" 
     75    end 
    6876    system(cmd) 
    6977  end 
     
    122130  :address     => '0.0.0.0', 
    123131  :instances   => 3, 
    124   :repeat      => nil 
     132  :repeat      => nil, 
     133  :prefix      => nil 
    125134} 
    126135 
     
    183192  opts.on("-r", "--repeat=seconds",   Integer, "Repeat spawn attempts every n seconds (default: off)")             { |v| OPTIONS[:repeat] = v } 
    184193  opts.on("-e", "--environment=name", String,  "test|development|production (default: #{OPTIONS[:environment]})")  { |v| OPTIONS[:environment] = v } 
     194  opts.on("-P", "--prefix=path",      String,  "URL prefix for Rails app. [Used only with Mongrel > v0.3.15]: (default: #{OPTIONS[:prefix]})")         { |v| OPTIONS[:prefix] = v } 
    185195  opts.on("-n", "--process=name",     String,  "default: #{OPTIONS[:process]}")                                    { |v| OPTIONS[:process] = v } 
    186196  opts.on("-s", "--spawner=path",     String,  "default: #{OPTIONS[:spawner]}")                                    { |v| OPTIONS[:spawner] = v }