diff options
-rw-r--r-- | railties/bin/lighttpd | 11 | ||||
-rw-r--r-- | railties/lib/commands/lighttpd.rb | 16 |
2 files changed, 18 insertions, 9 deletions
diff --git a/railties/bin/lighttpd b/railties/bin/lighttpd index 3220b16925..b4cbe53d8a 100644 --- a/railties/bin/lighttpd +++ b/railties/bin/lighttpd @@ -1,10 +1,3 @@ #!/usr/local/bin/ruby - -if RUBY_PLATFORM !~ /mswin/ && `lighttpd -version 2>/dev/null`.size > 0 - puts "=> Rails application started on http://0.0.0.0:3000" - puts "=> Ctrl-C to shutdown server (see config/lighttpd.conf for options)" - - `lighttpd -D -f #{File.dirname(__FILE__) + "/../"}/config/lighttpd.conf` -else - puts "lighttpd is not available on your system" -end
\ No newline at end of file +require File.dirname(__FILE__) + '/../config/boot' +require 'commands/lighttpd'
\ No newline at end of file diff --git a/railties/lib/commands/lighttpd.rb b/railties/lib/commands/lighttpd.rb new file mode 100644 index 0000000000..612bd693ce --- /dev/null +++ b/railties/lib/commands/lighttpd.rb @@ -0,0 +1,16 @@ +if RUBY_PLATFORM !~ /mswin/ && `lighttpd -version 2>/dev/null`.size > 0 + puts "=> Rails application started on http://0.0.0.0:3000" + + if ARGV.first == "-d" + puts "=> Configure in config/lighttpd.conf" + detach = true + else + puts "=> Call with -d to detach; Configure in config/lighttpd.conf" + puts "=> Ctrl-C to shutdown server (see config/lighttpd.conf for options)" + detach = false + end + + `lighttpd -f #{File.dirname(__FILE__) + "/../"}/config/lighttpd.conf` +else + puts "lighttpd is not available on your system (or not in your path)" +end
\ No newline at end of file |