<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>test/extensions_test.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,5 @@
 module Capistrano
-  class ExtensionProxy
+  class ExtensionProxy #:nodoc:
     def initialize(config, mod)
       @config = config
       extend(mod)
@@ -10,11 +10,25 @@ module Capistrano
     end
   end
 
+  # Holds the set of registered plugins, keyed by name (where the name is a
+  # symbol).
   EXTENSIONS = {}
 
+  # Register the given module as a plugin with the given name. It will henceforth
+  # be available via a proxy object on Configuration instances, accessible by
+  # a method with the given name.
   def self.plugin(name, mod)
+    name = name.to_sym
     return false if EXTENSIONS.has_key?(name)
 
+    methods = Capistrano::Configuration.public_instance_methods +
+      Capistrano::Configuration.protected_instance_methods +
+      Capistrano::Configuration.private_instance_methods
+
+    if methods.include?(name.to_s)
+      raise Capistrano::Error, &quot;registering a plugin named `#{name}' would shadow a method on Capistrano::Configuration with the same name&quot;
+    end
+
     Capistrano::Configuration.class_eval &lt;&lt;-STR, __FILE__, __LINE__+1
       def #{name}
         @__#{name}_proxy ||= Capistrano::ExtensionProxy.new(self, Capistrano::EXTENSIONS[#{name.inspect}])
@@ -25,7 +39,9 @@ module Capistrano
     return true
   end
 
+  # Unregister the plugin with the given name.
   def self.remove_plugin(name)
+    name = name.to_sym
     if EXTENSIONS.delete(name)
       Capistrano::Configuration.send(:remove_method, name)
       return true
@@ -34,7 +50,7 @@ module Capistrano
     return false
   end
 
-  def self.configuration(*args)
+  def self.configuration(*args) #:nodoc:
     warn &quot;[DEPRECATION] Capistrano.configuration is deprecated. Use Capistrano::Configuration.instance instead&quot;
     Capistrano::Configuration.instance(*args)
   end</diff>
      <filename>lib/capistrano/extensions.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>55e194c3f058615680602fa14df25710806c120c</id>
    </parent>
  </parents>
  <author>
    <name>Jamis Buck</name>
    <email>jamis@37signals.com</email>
  </author>
  <url>http://github.com/jamis/capistrano/commit/4c58afbe6ef7848c31a0c8b108de795be72dacf3</url>
  <id>4c58afbe6ef7848c31a0c8b108de795be72dacf3</id>
  <committed-date>2007-03-16T15:11:45-07:00</committed-date>
  <authored-date>2007-03-16T15:11:45-07:00</authored-date>
  <message>unit tests for extensions mechanism, and a bit more robustness


git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@6438 5ecf4fe2-1ee6-0310-87b1-e25e094e27de</message>
  <tree>f3dea0b507339df3ed4df96412ae3e2b2ab89d06</tree>
  <committer>
    <name>Jamis Buck</name>
    <email>jamis@37signals.com</email>
  </committer>
</commit>
