about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorzedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9>2006-03-05 19:28:52 +0000
committerzedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9>2006-03-05 19:28:52 +0000
commita4a2f19a0c94e72641d3b43c66d7817d2b9c30a9 (patch)
tree6fd9f080cb8ad9281db629163441bd331739ffa8
parent89719a8b28f728c0ce4891cc5d6a70e63dd0d700 (diff)
downloadunicorn-a4a2f19a0c94e72641d3b43c66d7817d2b9c30a9.tar.gz
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@82 19e92222-5c0b-0410-8929-a290d50e31e9
-rw-r--r--bin/mongrel_rails12
-rw-r--r--lib/mongrel/command.rb4
-rw-r--r--lib/mongrel/plugins.rb15
-rw-r--r--test/test_plugins.rb3
4 files changed, 7 insertions, 27 deletions
diff --git a/bin/mongrel_rails b/bin/mongrel_rails
index 059c782..1cb339b 100644
--- a/bin/mongrel_rails
+++ b/bin/mongrel_rails
@@ -111,7 +111,7 @@ class Start < Mongrel::Plugin "/commands"
     end
 
     # hook up any rails specific plugins
-    Mongrel::PluginManager.instance.load(MONGREL_PLUGINS_DIR)
+    Mongrel::PluginManager.instance.load
 
     begin
       STDERR.puts "Server ready."
@@ -214,13 +214,5 @@ class Restart < Mongrel::Plugin "/commands"
   end
 end
 
-if ARGV[0] == "-L" || ARGV[0] == "--load"
-  ARGV.shift # drop the -L
-  MONGREL_PLUGINS_DIR=ARGV.shift
-else
-  MONGREL_PLUGINS_DIR=nil
-end
-
-
-Mongrel::PluginManager.instance.load(MONGREL_PLUGINS_DIR, ["rails"])
+Mongrel::PluginManager.instance.load ["rails"]
 Mongrel::Command::Registry.instance.run ARGV
diff --git a/lib/mongrel/command.rb b/lib/mongrel/command.rb
index db54e1d..f8737f0 100644
--- a/lib/mongrel/command.rb
+++ b/lib/mongrel/command.rb
@@ -32,7 +32,7 @@ module Mongrel
       # Called by the subclass to setup the command and parse the argv arguments.
       # The call is destructive on argv since it uses the OptionParser#parse! function.
       def initialize(options={})
-        argv = options[:argv]
+        argv = options[:argv] || []
         @opt = OptionParser.new
         @valid = true
         # this is retarded, but it has to be done this way because -h and -v exit
@@ -55,7 +55,7 @@ module Mongrel
           end
         end
         
-        @opt.parse! options[:argv]
+        @opt.parse! argv
       end
       
       # Returns true/false depending on whether the command is configured properly.
diff --git a/lib/mongrel/plugins.rb b/lib/mongrel/plugins.rb
index e82977c..3a42547 100644
--- a/lib/mongrel/plugins.rb
+++ b/lib/mongrel/plugins.rb
@@ -57,21 +57,11 @@ module Mongrel
     # Since only plugins will configure themselves as plugins then
     # everything is safe.
     #
-    # You can also specify an alternative load path from the official
-    # system gems location.  For example you can do the following:
-    #
-    #  mkdir mygems
-    #  gem install -i mygems fancy_plugin
-    #  mongrel_rails -L mygems start
-    #
-    # Which installs the fancy_plugin to your mygems directory and then
-    # tells mongrel_rails to load from mygems instead.
-    #
     # The excludes list is used to prevent mongrel from loading gem plugins
     # that aren't ready yet.  In the mongrel_rails script this is used to
     # load gems that might need rails configured after rails is ready.
-    def load(load_path = nil, excludes=[])
-      sdir = File.join(load_path || Gem.dir, "specifications")
+    def load(excludes=[])
+      sdir = File.join(Gem.dir, "specifications")
       gems = Gem::SourceIndex.from_installed_gems(sdir)
       
       gems.each do |path, gem|
@@ -87,7 +77,6 @@ module Mongrel
         end
 
         if found_one
-          STDERR.puts "loading #{gem.name}"
           require_gem gem.name
           @loaded_gems << gem.name
         end
diff --git a/test/test_plugins.rb b/test/test_plugins.rb
index 8658793..82132b1 100644
--- a/test/test_plugins.rb
+++ b/test/test_plugins.rb
@@ -34,8 +34,6 @@ class PluginTest < Test::Unit::TestCase
   end
 
   def test_load_plugins
-    @pmgr.load
-
     puts "#{@pmgr.available.inspect}"
     @pmgr.available.each {|cat,plugins|
       plugins.each do |p|
@@ -44,6 +42,7 @@ class PluginTest < Test::Unit::TestCase
       end
     }
 
+    @pmgr.load
     @pmgr.available.each do |cat,plugins|
       plugins.each do |p|
         STDERR.puts "#{cat}#{p}"