about summary refs log tree commit homepage
path: root/projects
diff options
context:
space:
mode:
Diffstat (limited to 'projects')
-rw-r--r--projects/gem_plugin/CHANGELOG2
-rw-r--r--projects/gem_plugin/lib/gem_plugin.rb11
-rw-r--r--projects/mongrel_cluster/lib/mongrel_cluster/init.rb6
-rw-r--r--projects/mongrel_cluster/lib/mongrel_cluster/recipes_2.rb3
4 files changed, 15 insertions, 7 deletions
diff --git a/projects/gem_plugin/CHANGELOG b/projects/gem_plugin/CHANGELOG
index 7e1103d..cf39b5b 100644
--- a/projects/gem_plugin/CHANGELOG
+++ b/projects/gem_plugin/CHANGELOG
@@ -1,2 +1,4 @@
 
+v0.3. Use Gem.path, not Gem.dir, so that local gem repositories work (rooster).
+
 v0.2.3. Signed gem.
diff --git a/projects/gem_plugin/lib/gem_plugin.rb b/projects/gem_plugin/lib/gem_plugin.rb
index 1996a61..4664aa1 100644
--- a/projects/gem_plugin/lib/gem_plugin.rb
+++ b/projects/gem_plugin/lib/gem_plugin.rb
@@ -105,8 +105,8 @@ module GemPlugin
     # To prevent this load requires the full path to the "init.rb" file, which
     # avoids the RubyGems autorequire magic.
     def load(needs = {})
-      sdir = File.join(Gem.dir, "specifications")
-      gems = Gem::SourceIndex.from_installed_gems(sdir)
+      sdirs = Gem::SourceIndex.installed_spec_directories
+      gems = Gem::SourceIndex.from_gems_in(sdirs)
       needs = needs.merge({"gem_plugin" => INCLUDE})
       
       gems.each do |path, gem|
@@ -128,8 +128,11 @@ module GemPlugin
           # looks like no needs were set to false, so it's good
           
           # Previously was set wrong, we already have the correct gem path!
-          #gem_dir = File.join(Gem.dir, "gems", "#{gem.name}-#{gem.version}")
-          gem_dir = File.join(Gem.dir, "gems", path)
+          gem_dir = ""
+          Gem.path.each do |gem_path|
+            gem_dir = File.join(gem_path, "gems", path)
+            break if File.exists?(gem_dir)
+          end
           
           require File.join(gem_dir, "lib", gem.name, "init.rb")
           @gems[gem.name] = gem_dir
diff --git a/projects/mongrel_cluster/lib/mongrel_cluster/init.rb b/projects/mongrel_cluster/lib/mongrel_cluster/init.rb
index 1c3a613..0f18fe9 100644
--- a/projects/mongrel_cluster/lib/mongrel_cluster/init.rb
+++ b/projects/mongrel_cluster/lib/mongrel_cluster/init.rb
@@ -59,7 +59,7 @@ module Cluster
     def start
       read_options
       
-      argv = [ "mongrel_rails" ]
+      argv = @options['mongrel_rails']
       argv << "start"
       argv << "-d"
       argv << "-e #{@options['environment']}" if @options['environment']
@@ -103,7 +103,7 @@ module Cluster
     def stop
       read_options
     
-      argv = [ "mongrel_rails" ]
+      argv = @options['mongrel_rails']
       argv << "stop"
       argv << "-c #{@options["cwd"]}" if @options["cwd"]
       argv << "-f" if @force
@@ -300,6 +300,7 @@ module Cluster
         ['-C', '--config PATH', "Path to cluster configuration file", :@config_file, "config/mongrel_cluster.yml"],
         ['', '--user USER', "User to run as", :@user, nil],
         ['', '--group GROUP', "Group to run as", :@group, nil],
+        ['', '--mongrel_rails PATH', "Full path to mongrel_rails script", :@mongrel_rails, "mongrel_rails"],
         ['', '--prefix PREFIX', "Rails prefix to use", :@prefix, nil]
       ]
     end
@@ -334,6 +335,7 @@ module Cluster
       @options["user"] = @user if @user
       @options["group"] = @group if @group
       @options["prefix"] = @prefix if @prefix
+      @options["mongrel_rails"] = @mongrel_rails if @mongrel_rails
       
       log "Writing configuration file to #{@config_file}."
       File.open(@config_file,"w") {|f| f.write(@options.to_yaml)}
diff --git a/projects/mongrel_cluster/lib/mongrel_cluster/recipes_2.rb b/projects/mongrel_cluster/lib/mongrel_cluster/recipes_2.rb
index a82c424..312ef5c 100644
--- a/projects/mongrel_cluster/lib/mongrel_cluster/recipes_2.rb
+++ b/projects/mongrel_cluster/lib/mongrel_cluster/recipes_2.rb
@@ -7,7 +7,7 @@ Capistrano::Configuration.instance.load do
   set :mongrel_user, nil
   set :mongrel_group, nil
   set :mongrel_prefix, nil
-  set :mongrel_rails, 'mongrel_rails'
+  set :mongrel_rails, "mongrel_rails"
   set :mongrel_clean, false
   set :mongrel_pid_file, nil
   set :mongrel_log_file, nil
@@ -37,6 +37,7 @@ Capistrano::Configuration.instance.load do
         argv << "--group #{mongrel_group}" if mongrel_group
         argv << "--prefix #{mongrel_prefix}" if mongrel_prefix
         argv << "-S #{mongrel_config_script}" if mongrel_config_script
+        argv << "--mongrel_rails #{mongrel_rails}" if mongrel_rails        
         cmd = argv.join " "
         send(run_method, cmd)
       end