diff options
-rw-r--r-- | bin/mongrel_rails | 12 | ||||
-rw-r--r-- | lib/mongrel/command.rb | 4 | ||||
-rw-r--r-- | lib/mongrel/plugins.rb | 15 | ||||
-rw-r--r-- | test/test_plugins.rb | 3 |
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}" |