forked from capistrano/capistrano
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
restore plugin extension mechanism, fix hostname problem for tunnelle…
…d connections git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@6436 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
- Loading branch information
Showing
11 changed files
with
116 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
require 'capistrano/configuration' | ||
require 'capistrano/extensions' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
#require 'capistrano/extensions' | ||
require 'capistrano/logger' | ||
|
||
require 'capistrano/configuration/connections' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,41 @@ | ||
# module Capistrano | ||
# class ExtensionProxy | ||
# def initialize(actor, mod) | ||
# @actor = actor | ||
# extend(mod) | ||
# end | ||
# | ||
# def method_missing(sym, *args, &block) | ||
# @actor.send(sym, *args, &block) | ||
# end | ||
# end | ||
# | ||
# EXTENSIONS = {} | ||
# | ||
# def self.plugin(name, mod) | ||
# return false if EXTENSIONS.has_key?(name) | ||
# | ||
# Capistrano::Actor.class_eval <<-STR, __FILE__, __LINE__+1 | ||
# def #{name} | ||
# @__#{name}_proxy ||= Capistrano::ExtensionProxy.new(self, Capistrano::EXTENSIONS[#{name.inspect}]) | ||
# end | ||
# STR | ||
# | ||
# EXTENSIONS[name] = mod | ||
# return true | ||
# end | ||
# | ||
# def self.remove_plugin(name) | ||
# if EXTENSIONS.delete(name) | ||
# Capistrano::Actor.send(:remove_method, name) | ||
# return true | ||
# end | ||
# | ||
# return false | ||
# end | ||
# end | ||
module Capistrano | ||
class ExtensionProxy | ||
def initialize(config, mod) | ||
@config = config | ||
extend(mod) | ||
end | ||
|
||
def method_missing(sym, *args, &block) | ||
@config.send(sym, *args, &block) | ||
end | ||
end | ||
|
||
EXTENSIONS = {} | ||
|
||
def self.plugin(name, mod) | ||
return false if EXTENSIONS.has_key?(name) | ||
|
||
Capistrano::Configuration.class_eval <<-STR, __FILE__, __LINE__+1 | ||
def #{name} | ||
@__#{name}_proxy ||= Capistrano::ExtensionProxy.new(self, Capistrano::EXTENSIONS[#{name.inspect}]) | ||
end | ||
STR | ||
|
||
EXTENSIONS[name] = mod | ||
return true | ||
end | ||
|
||
def self.remove_plugin(name) | ||
if EXTENSIONS.delete(name) | ||
Capistrano::Configuration.send(:remove_method, name) | ||
return true | ||
end | ||
|
||
return false | ||
end | ||
|
||
def self.configuration(*args) | ||
warn "[DEPRECATION] Capistrano.configuration is deprecated. Use Capistrano::Configuration.instance instead" | ||
Capistrano::Configuration.instance(*args) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters