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