public
Description: A very fast & simple Ruby web server
Homepage: http://code.macournoyer.com/thin/
Clone URL: git://github.com/macournoyer/thin.git
Search Repo:
Remove autoloading gem plugin crap, GemPlugin system causes weird problems 
in Mongrel, thx evan!

Revert "Add very basic plugin mechanism, all gems starting with 
'thin-' or 'thin_' will be loaded when Thin loads."

This reverts commit 90b15c362fc83243ad660437a43d10f62a601332.
macournoyer (author)
Fri Apr 04 06:47:28 -0700 2008
commit  f3c09c3075e413c48e076a52ea0016a0250a53da
tree    f00a5f8771386f5b8619b3c6aaec75bda48f2f77
parent  90b15c362fc83243ad660437a43d10f62a601332
...
1
2
3
4
5
6
...
1
 
 
2
3
4
0
@@ -1,6 +1,4 @@
0
 == 0.8.0 Dodgy Dentist release
0
- * Add very basic plugin mechanism, all gems starting with 'thin-' or 'thin_' will be loaded when
0
- Thin loads.
0
  * Allow disabling signal handling in Server with :signals => false
0
  * Make Server.new arguments more flexible, can now specify any of host, port, app or hash options.
0
  * Add --backend option to specified which backend to use, closes #55
...
47
48
49
50
51
52
53
...
47
48
49
 
 
 
 
0
@@ -47,8 +47,4 @@
0
     autoload :Rails, 'rack/adapter/rails'
0
   end
0
 end
0
-
0
-# Load plugins at last so we can reopen any stuff
0
-require 'thin/plugins'
0
-Thin::Plugins.load
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
@@ -1,27 +1 @@
0
-module Thin
0
- # Very basic plugin mechanism.
0
- # Loads all Gems which name starts with <tt>thin-</tt> or <tt>thin_</tt>.
0
- # Just reopen classes or define all you want in your gem.
0
- # No need for more really!
0
- class Plugins
0
- extend Logging
0
-
0
- GEM_PREFIX = "thin(-|_)"
0
-
0
- def self.gems
0
- sdir = File.join(Gem.dir, "specifications")
0
- Gem::SourceIndex.from_installed_gems(sdir).inject([]) do |plugins, (path, gem)|
0
- plugins << gem.name if gem.name =~ /^#{GEM_PREFIX}/
0
- plugins
0
- end.uniq
0
- end
0
-
0
- def self.load
0
- gems.each do |gem|
0
- log ">> Loading #{gem} gem"
0
- require gem
0
- end
0
- end
0
- end
0
-end
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
@@ -1,24 +1 @@
0
-require File.dirname(__FILE__) + '/spec_helper'
0
-
0
-describe Plugins do
0
- before do
0
- Gem::SourceIndex.should_receive(:from_installed_gems).and_return([
0
- ['rails-10.6.0', stub('rails-gemspec', :name => 'rails')],
0
- ['thin-1.0', stub('thin-gemspec', :name => 'thin')],
0
- ['thin-plugin-1.0', stub('thin-plugin-gemspec', :name => 'thin-plugin')],
0
- ['thin-plugin-0.5', stub('thin-plugin-gemspec', :name => 'thin-plugin')],
0
- ['thin_plugin-0.5', stub('thin_plugin-gemspec', :name => 'thin_plugin')]
0
- ])
0
- end
0
-
0
- it 'should return all gems that start with thin- or thin_' do
0
- Plugins.gems.should == ['thin-plugin', 'thin_plugin']
0
- end
0
-
0
- it "should load all gems" do
0
- Plugins.should_receive(:require).with('thin-plugin')
0
- Plugins.should_receive(:require).with('thin_plugin')
0
- Plugins.load
0
- end
0
-end

Comments

    No one has commented yet.