mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
Fixed up unit tests and cleaned up more of the gem plugin code. Temporarily removed the alternative directory since rubygems doesn't support it too well.
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@82 19e92222-5c0b-0410-8929-a290d50e31e9
This commit is contained in:
parent
89719a8b28
commit
a4a2f19a0c
4 changed files with 7 additions and 27 deletions
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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}"
|
||||
|
|
Loading…
Add table
Reference in a new issue