Class: Thin::RailsServer

Inherits:
Server
  • Object
show all
Defined in:
lib/thin/rails.rb

Overview

Serve the Rails application in the current directory.

Instance Attribute Summary

Attributes inherited from Server

#handlers, #host, #port, #timeout

Attributes included from Daemonizable

#log_file, #pid_file

Attributes included from Logging

#silent

Instance Method Summary collapse

Methods inherited from Server

#listen!, #process, #start, #start!, #stop, #stop!

Methods included from Daemonizable

#change_privilege, #daemonize, included

Constructor Details

#initialize(address, port, environment = 'development', cwd = '.') ⇒ RailsServer

Returns a new instance of RailsServer.



36
37
38
39
40
41
42
# File 'lib/thin/rails.rb', line 36

def initialize(address, port, environment='development', cwd='.')
  super address, port,
        # Let Rails handle his thing and ignore files
        Thin::RailsHandler.new(cwd, environment),
        # Serve static files
        Thin::DirHandler.new(File.join(cwd, 'public'))
end