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

Ticket #10674: add_prefix_option_to_script_server_for_mongrel.patch

File add_prefix_option_to_script_server_for_mongrel.patch, 1.3 kB (added by Lytol, 8 months ago)
  • railties/lib/commands/servers/mongrel.rb

    old new  
    1313  :ip          => "0.0.0.0", 
    1414  :environment => (ENV['RAILS_ENV'] || "development").dup, 
    1515  :detach      => false, 
    16   :debugger    => false 
     16  :debugger    => false, 
     17  :prefix      => nil 
    1718} 
    1819 
    1920ARGV.clone.options do |opts| 
    2021  opts.on("-p", "--port=port", Integer, "Runs Rails on the specified port.", "Default: 3000") { |v| OPTIONS[:port] = v } 
    2122  opts.on("-b", "--binding=ip", String, "Binds Rails to the specified ip.", "Default: 0.0.0.0") { |v| OPTIONS[:ip] = v } 
     23  opts.on("-P", "--prefix=path", String, "Runs Rails app with a URL prefix (path).", "Default: none") { |v| OPTIONS[:prefix] = v } 
    2224  opts.on("-d", "--daemon", "Make server run as a Daemon.") { OPTIONS[:detach] = true } 
    2325  opts.on("-u", "--debugger", "Enable ruby-debugging for the server.") { OPTIONS[:debugger] = true } 
    2426  opts.on("-e", "--environment=name", String, 
     
    4143  "-e", OPTIONS[:environment], 
    4244  "-P", "#{RAILS_ROOT}/tmp/pids/mongrel.pid" 
    4345] 
     46parameters << "--prefix=#{OPTIONS[:prefix]}" unless OPTIONS[:prefix].blank? 
    4447 
    4548if OPTIONS[:detach] 
    4649  `mongrel_rails #{parameters.join(" ")} -d`