Skip to content
Browse files

You can now specify extra mongrel options when executing herd.

Useful for using options that you need to execute just once, or aren't supported by all actions (such as '-f').
  • Loading branch information...
1 parent be98944 commit c2b618892969cac3c09ce6f02af46423917814e5 @FiXato committed Aug 25, 2008
Showing with 13 additions and 8 deletions.
  1. +5 −3 README.rdoc
  2. +8 −5 bin/herd
View
8 README.rdoc
@@ -34,10 +34,12 @@ to define your rails and/or merb directories and mongrel options:
- ~/projects/foobar/frontend
=== herd start | stop | restart
- herd start projectname
- herd stop projectname
- herd restart projectname
+ herd start projectname [extra mongrel options]
+ herd stop projectname [extra mongrel options]
+ herd restart projectname [extra mongrel options]
Send a command to the mongrel cluster of each rails directory in the project.
+You can optionally specify extra mongrel options that need to be added to
+the configured mongrel options for this call only.
=== herd list
herd list
View
13 bin/herd
@@ -2,10 +2,11 @@
require 'yaml'
class Herd
- attr_reader :project
+ attr_reader :project, :extra_mongrel_options
- def initialize(project=nil)
+ def initialize(project=nil,extra_mongrel_options=nil)
@project = project
+ @extra_mongrel_options = extra_mongrel_options
end
def init
@@ -89,7 +90,8 @@ class Herd
end
def mongrel(dir, cmd)
- sh(('cd %s' % dir), ('mongrel_rails cluster::%s %s' % [cmd, mongrel_options.join(' ')]))
+ merged_mongrel_options = (mongrel_options + extra_mongrel_options).uniq
+ sh(('cd %s' % dir), ('mongrel_rails cluster::%s %s' % [cmd, merged_mongrel_options.join(' ')]))
end
def merb(options, action)
@@ -169,12 +171,13 @@ Examples
mongrel_options:
- --clean
- herd <start | stop | restart> <projectname>
+ herd <start | stop | restart> <projectname> [extra mongrel options]
Send a command to the mongrel cluster of each rails directory in the project.
EOS
exit
end
project = ARGV.shift
-h = Herd.new project
+extra_mongrel_options = ARGV
+h = Herd.new(project,extra_mongrel_options)
h.send(cmd)

0 comments on commit c2b6188

Please sign in to comment.
Something went wrong with that request. Please try again.