Module: DeploYML::Servers::Thin
- Defined in:
- lib/deployml/servers/thin.rb
Overview
Provides methods for configuring, starting, stopping and restarting the Thin web server.
Instance Method Summary collapse
-
#initialize_server ⇒ Object
Initializes options used when calling
thin
. -
#server_config(shell) ⇒ Object
Configures Thin by calling
thin config
. -
#server_restart(shell) ⇒ Object
Restarts Thin by calling
thin restart
. -
#server_start(shell) ⇒ Object
Starts Thin by calling
thin start
. -
#server_stop(shell) ⇒ Object
Stops Thin by calling
thin stop
. -
#thin(shell, *arguments) ⇒ Object
Runs a command via the
thin
command.
Instance Method Details
#initialize_server ⇒ Object
Initializes options used when calling thin
.
14 15 16 17 |
# File 'lib/deployml/servers/thin.rb', line 14 def initialize_server @thin = Options::Thin.new(@server_options) @thin.environment ||= @name end |
#server_config(shell) ⇒ Object
Configures Thin by calling thin config
.
44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/deployml/servers/thin.rb', line 44 def server_config(shell) unless @thin.config raise(MissingOption,"No 'config' option specified under the server options",caller) end shell.status "Configuring Thin ..." = ['-c', shell.uri.path] + @thin.arguments shell.ruby 'thin', 'config', * shell.status "Thin configured." end |
#server_restart(shell) ⇒ Object
Restarts Thin by calling thin restart
.
91 92 93 94 95 96 97 |
# File 'lib/deployml/servers/thin.rb', line 91 def server_restart(shell) shell.status "Restarting Thin ..." thin shell, 'restart' shell.status "Thin restarted." end |
#server_start(shell) ⇒ Object
Starts Thin by calling thin start
.
63 64 65 66 67 68 69 |
# File 'lib/deployml/servers/thin.rb', line 63 def server_start(shell) shell.status "Starting Thin ..." thin shell, 'start' shell.status "Thin started." end |
#server_stop(shell) ⇒ Object
Stops Thin by calling thin stop
.
77 78 79 80 81 82 83 |
# File 'lib/deployml/servers/thin.rb', line 77 def server_stop(shell) shell.status "Stopping Thin ..." thin shell, 'stop' shell.status "Thin stopped." end |
#thin(shell, *arguments) ⇒ Object
Runs a command via the thin
command.
28 29 30 31 32 |
# File 'lib/deployml/servers/thin.rb', line 28 def thin(shell,*arguments) = arguments + ['-C', @thin.config, '-s', @thin.servers] shell.ruby 'thin', * end |