Created
August 20, 2009 23:44
-
-
Save eric/171518 to your computer and use it in GitHub Desktop.
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
diff -urN /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/CHANGELOG.rdoc /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/CHANGELOG.rdoc | |
--- /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/CHANGELOG.rdoc 2009-01-14 11:51:46.000000000 -0800 | |
+++ /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/CHANGELOG.rdoc 2009-08-20 16:23:05.000000000 -0700 | |
@@ -1,3 +1,36 @@ | |
+== 2.5.8 / July 2009 | |
+ | |
+* Fixes a problem in 2.5.7 where deploy:finalize_update had been badly merged. | |
+ | |
+== 2.5.6 & 2.5.7 / July 2009 | |
+ | |
+* 2.5.7 masks a broken 2.5.6 release that was accidentally mirrored via Rubyforge. | |
+* Clean the cached git repository [Graeme Mathieson] | |
+* Fixes perforce issues reported at http://bit.ly/wt0es [Scott Johnson] | |
+* Improved back-tick handling code in relation to the above. | |
+* Fixes a Git issue when submodules update upstream. (via mailing list) [sneakin] | |
+* Capify now creates the config directory in directories without one. | |
+ | |
+== 2.5.5 / 24 Feb 2009 | |
+ | |
+* Make sure role(:foo) actually declares an (empty) role for :foo, even without server arguments [Jamis Buck] | |
+ | |
+ | |
+== 2.5.4 / 4 Feb 2009 | |
+ | |
+* When using rsync with the remote_cache strategy include -t switch to preserve file times [Kevin McCarthy] | |
+ | |
+* Bump Net::SSH dependency to version 2.0.10 [Jamis Buck] | |
+ | |
+* Use 'user' from .ssh/config appropriately [Jamis Buck] | |
+ | |
+* Allow respond_to?() method to accept optional second parameter (include_priv) [Matthias Marschall] | |
+ | |
+* Make sure sudo prompts are retried correctly even if "try again" and the prompt appear in the same text chunk from the server [Jamis Buck] | |
+ | |
+* Add supported environment variables to -H output [François Beausoleil] | |
+ | |
+ | |
== 2.5.3 / December 6, 2008 | |
* Make previous_release return nil if there is no previous release [Mathias Meyer] | |
diff -urN /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/README.rdoc /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/README.rdoc | |
--- /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/README.rdoc 2009-01-14 11:51:46.000000000 -0800 | |
+++ /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/README.rdoc 2009-08-20 16:23:05.000000000 -0700 | |
@@ -5,6 +5,24 @@ | |
Capistrano was originally designed to simplify and automate deployment of web applications to distributed environments, and originally came bundled with a set of tasks designed for deploying Rails applications. The deployment tasks are now (as of Capistrano 2.0) opt-in and require clients to explicitly put | |
"load 'deploy'" in their recipes. | |
+== Documentation | |
+ | |
+We know that documentation is something that really lets us down, that's why there is a repository for a handbook below, please open an issue on it if you would like something documented: | |
+ | |
+* http://github.com/leehambley/capistrano-handbook | |
+ | |
+If you prefer the wiki style of documentation, then please see our wiki | |
+ | |
+* http://wiki.capify.org | |
+ | |
+Due to a failure of MySQL with PHP, searches shorter than three characters are all but ignored, we're going to rectify this, but in the meantime, please do what you can, tickets opened on the handbook for the wiki will be answered too, so please let us know if you don't find something you needed. | |
+ | |
+We take bug reports via lighthouse app, you can find that page here: | |
+ | |
+* http://capistrano.lighthouseapp.com | |
+ | |
+More documentation is on the way, if in doubt try opening the recipes that ship with capistrano. | |
+ | |
== DEPENDENCIES | |
* Net::SSH v2 (http://net-ssh.rubyforge.org) | |
@@ -40,6 +58,24 @@ | |
By default, the script will look for a file called one of +capfile+ or +Capfile+. The +someaction+ text indicates which task to execute. You can do "cap -h" to see all the available options and "cap -T" to see all the available tasks. | |
+== Capistrano Edge | |
+ | |
+If you want to try Capistrano code that hasn't been formerly released yet, this repository now includes a gemspec that should build what you need, here's how to get a copy: | |
+ | |
+ git clone git://github.com/capistrano/capistrano.git capistrano-capistrano | |
+ cd capistrano-capsitrano | |
+ gem build capistrano.gemspec | |
+ sudo gem install capistrano-*.gem | |
+ | |
+This will install the most recent version of capistrano and make it available for both cap, and capify. | |
+ | |
+We recommend that you capify a new test application, as the resulting files are different to previous versions. | |
+ | |
+If you have multiple versions of capistrano (or indeed any gem with a binary) installed, you can call `cap` like so to specify which version to use: | |
+ | |
+ cap _2.5.5_ deploy | |
+ cap _2.5.6_ deploy:setup | |
+ | |
== LICENSE: | |
(The MIT License) | |
diff -urN /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/Rakefile /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/Rakefile | |
--- /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/Rakefile 2009-01-14 11:51:46.000000000 -0800 | |
+++ /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/Rakefile 2009-08-20 16:23:05.000000000 -0700 | |
@@ -12,6 +12,7 @@ | |
end | |
Echoe.new('capistrano', version) do |p| | |
+ p.include_gemspec = true | |
p.changelog = "CHANGELOG.rdoc" | |
p.author = "Jamis Buck" | |
@@ -26,7 +27,7 @@ | |
p.need_zip = true | |
p.rdoc_pattern = /^(lib|README.rdoc|CHANGELOG.rdoc)/ | |
- p.dependencies = ["net-ssh >=2.0.0", | |
+ p.dependencies = ["net-ssh >=2.0.10", | |
"net-sftp >=2.0.0", | |
"net-scp >=1.0.0", | |
"net-ssh-gateway >=1.0.0", | |
diff -urN /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/bin/capify /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/bin/capify | |
--- /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/bin/capify 2009-01-14 11:51:46.000000000 -0800 | |
+++ /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/bin/capify 2009-08-20 16:23:05.000000000 -0700 | |
@@ -1,6 +1,7 @@ | |
#!/usr/bin/env ruby | |
require 'optparse' | |
+require 'fileutils' | |
OptionParser.new do |opts| | |
opts.banner = "Usage: #{File.basename($0)} [path]" | |
@@ -45,6 +46,24 @@ | |
set :application, "set your application name here" | |
set :repository, "set your repository location here" | |
+ # If you have previously been relying upon the code to start, stop | |
+ # and restart your mongrel application, or if you rely on the database | |
+ # migration code, please uncomment the lines you require below | |
+ | |
+ # If you are deploying a rails app you probably need these: | |
+ | |
+ # load 'ext/rails-database-migrations.rb' | |
+ # load 'ext/rails-shared-directories.rb' | |
+ | |
+ # There are also new utility libaries shipped with the core these | |
+ # include the following, please see individual files for more | |
+ # documentation, or run `cap -vT` with the following lines commented | |
+ # out to see what they make available. | |
+ | |
+ # load 'ext/spinner.rb' # Designed for use with script/spin | |
+ # load 'ext/passenger-mod-rails.rb' # Restart task for use with mod_rails | |
+ # load 'ext/web-disable-enable.rb' # Gives you web:disable and web:enable | |
+ | |
# If you aren't deploying to /u/apps/\#{application} on the target | |
# servers (which is the default), you can specify the actual location | |
# via the :deploy_to variable: | |
@@ -53,10 +72,10 @@ | |
# If you aren't using Subversion to manage your source code, specify | |
# your SCM below: | |
# set :scm, :subversion | |
+ # see a full list by running "gem contents capistrano | grep 'scm/'" | |
- role :app, "your app-server here" | |
role :web, "your web-server here" | |
- role :db, "your db-server here", :primary => true | |
+ | |
FILE | |
} | |
@@ -68,7 +87,9 @@ | |
elsif File.exists?(file.downcase) | |
warn "[skip] `#{file.downcase}' exists, which could conflict with `#{file}'" | |
elsif !File.exists?(File.dirname(file)) | |
- warn "[skip] directory `#{File.dirname(file)}' does not exist" | |
+ FileUtils.mkdir(File.dirname(file)) | |
+ retry | |
+ warn "[skip] directory `#{File.dirname(file)}' did not exist, created." | |
else | |
puts "[add] writing `#{file}'" | |
File.open(file, "w") { |f| f.write(content) } | |
diff -urN /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/capistrano.gemspec /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/capistrano.gemspec | |
--- /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/capistrano.gemspec 2009-01-14 11:51:46.000000000 -0800 | |
+++ /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/capistrano.gemspec 1969-12-31 16:00:00.000000000 -0800 | |
@@ -1,49 +0,0 @@ | |
-Gem::Specification.new do |s| | |
- s.name = %q{capistrano} | |
- s.version = "2.5.3" | |
- | |
- s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version= | |
- s.authors = ["Jamis Buck"] | |
- s.date = %q{2008-12-06} | |
- s.description = %q{Capistrano is a utility and framework for executing commands in parallel on multiple remote machines, via SSH.} | |
- s.email = %q{[email protected]} | |
- s.executables = ["cap", "capify"] | |
- s.extra_rdoc_files = ["CHANGELOG.rdoc", "lib/capistrano/callback.rb", "lib/capistrano/cli/execute.rb", "lib/capistrano/cli/help.rb", "lib/capistrano/cli/help.txt", "lib/capistrano/cli/options.rb", "lib/capistrano/cli/ui.rb", "lib/capistrano/cli.rb", "lib/capistrano/command.rb", "lib/capistrano/configuration/actions/file_transfer.rb", "lib/capistrano/configuration/actions/inspect.rb", "lib/capistrano/configuration/actions/invocation.rb", "lib/capistrano/configuration/callbacks.rb", "lib/capistrano/configuration/connections.rb", "lib/capistrano/configuration/execution.rb", "lib/capistrano/configuration/loading.rb", "lib/capistrano/configuration/namespaces.rb", "lib/capistrano/configuration/roles.rb", "lib/capistrano/configuration/servers.rb", "lib/capistrano/configuration/variables.rb", "lib/capistrano/configuration.rb", "lib/capistrano/errors.rb", "lib/capistrano/extensions.rb", "lib/capistrano/logger.rb", "lib/capistrano/processable.rb", "lib/capistrano/recipes/compat.rb", "lib/capistrano/recipes/deploy/dependencies.rb", "lib/capistrano/recipes/deploy/local_dependency.rb", "lib/capistrano/recipes/deploy/remote_dependency.rb", "lib/capistrano/recipes/deploy/scm/accurev.rb", "lib/capistrano/recipes/deploy/scm/base.rb", "lib/capistrano/recipes/deploy/scm/bzr.rb", "lib/capistrano/recipes/deploy/scm/cvs.rb", "lib/capistrano/recipes/deploy/scm/darcs.rb", "lib/capistrano/recipes/deploy/scm/git.rb", "lib/capistrano/recipes/deploy/scm/mercurial.rb", "lib/capistrano/recipes/deploy/scm/none.rb", "lib/capistrano/recipes/deploy/scm/perforce.rb", "lib/capistrano/recipes/deploy/scm/subversion.rb", "lib/capistrano/recipes/deploy/scm.rb", "lib/capistrano/recipes/deploy/strategy/base.rb", "lib/capistrano/recipes/deploy/strategy/checkout.rb", "lib/capistrano/recipes/deploy/strategy/copy.rb", "lib/capistrano/recipes/deploy/strategy/export.rb", "lib/capistrano/recipes/deploy/strategy/remote.rb", "lib/capistrano/recipes/deploy/strategy/remote_cache.rb", "lib/capistrano/recipes/deploy/strategy.rb", "lib/capistrano/recipes/deploy/templates/maintenance.rhtml", "lib/capistrano/recipes/deploy.rb", "lib/capistrano/recipes/standard.rb", "lib/capistrano/recipes/templates/maintenance.rhtml", "lib/capistrano/recipes/upgrade.rb", "lib/capistrano/role.rb", "lib/capistrano/server_definition.rb", "lib/capistrano/shell.rb", "lib/capistrano/ssh.rb", "lib/capistrano/task_definition.rb", "lib/capistrano/transfer.rb", "lib/capistrano/version.rb", "lib/capistrano.rb", "README.rdoc"] | |
- s.files = ["bin/cap", "bin/capify", "CHANGELOG.rdoc", "examples/sample.rb", "lib/capistrano/callback.rb", "lib/capistrano/cli/execute.rb", "lib/capistrano/cli/help.rb", "lib/capistrano/cli/help.txt", "lib/capistrano/cli/options.rb", "lib/capistrano/cli/ui.rb", "lib/capistrano/cli.rb", "lib/capistrano/command.rb", "lib/capistrano/configuration/actions/file_transfer.rb", "lib/capistrano/configuration/actions/inspect.rb", "lib/capistrano/configuration/actions/invocation.rb", "lib/capistrano/configuration/callbacks.rb", "lib/capistrano/configuration/connections.rb", "lib/capistrano/configuration/execution.rb", "lib/capistrano/configuration/loading.rb", "lib/capistrano/configuration/namespaces.rb", "lib/capistrano/configuration/roles.rb", "lib/capistrano/configuration/servers.rb", "lib/capistrano/configuration/variables.rb", "lib/capistrano/configuration.rb", "lib/capistrano/errors.rb", "lib/capistrano/extensions.rb", "lib/capistrano/logger.rb", "lib/capistrano/processable.rb", "lib/capistrano/recipes/compat.rb", "lib/capistrano/recipes/deploy/dependencies.rb", "lib/capistrano/recipes/deploy/local_dependency.rb", "lib/capistrano/recipes/deploy/remote_dependency.rb", "lib/capistrano/recipes/deploy/scm/accurev.rb", "lib/capistrano/recipes/deploy/scm/base.rb", "lib/capistrano/recipes/deploy/scm/bzr.rb", "lib/capistrano/recipes/deploy/scm/cvs.rb", "lib/capistrano/recipes/deploy/scm/darcs.rb", "lib/capistrano/recipes/deploy/scm/git.rb", "lib/capistrano/recipes/deploy/scm/mercurial.rb", "lib/capistrano/recipes/deploy/scm/none.rb", "lib/capistrano/recipes/deploy/scm/perforce.rb", "lib/capistrano/recipes/deploy/scm/subversion.rb", "lib/capistrano/recipes/deploy/scm.rb", "lib/capistrano/recipes/deploy/strategy/base.rb", "lib/capistrano/recipes/deploy/strategy/checkout.rb", "lib/capistrano/recipes/deploy/strategy/copy.rb", "lib/capistrano/recipes/deploy/strategy/export.rb", "lib/capistrano/recipes/deploy/strategy/remote.rb", "lib/capistrano/recipes/deploy/strategy/remote_cache.rb", "lib/capistrano/recipes/deploy/strategy.rb", "lib/capistrano/recipes/deploy/templates/maintenance.rhtml", "lib/capistrano/recipes/deploy.rb", "lib/capistrano/recipes/standard.rb", "lib/capistrano/recipes/templates/maintenance.rhtml", "lib/capistrano/recipes/upgrade.rb", "lib/capistrano/role.rb", "lib/capistrano/server_definition.rb", "lib/capistrano/shell.rb", "lib/capistrano/ssh.rb", "lib/capistrano/task_definition.rb", "lib/capistrano/transfer.rb", "lib/capistrano/version.rb", "lib/capistrano.rb", "Rakefile", "README.rdoc", "setup.rb", "test/cli/execute_test.rb", "test/cli/help_test.rb", "test/cli/options_test.rb", "test/cli/ui_test.rb", "test/cli_test.rb", "test/command_test.rb", "test/configuration/actions/file_transfer_test.rb", "test/configuration/actions/inspect_test.rb", "test/configuration/actions/invocation_test.rb", "test/configuration/callbacks_test.rb", "test/configuration/connections_test.rb", "test/configuration/execution_test.rb", "test/configuration/loading_test.rb", "test/configuration/namespace_dsl_test.rb", "test/configuration/roles_test.rb", "test/configuration/servers_test.rb", "test/configuration/variables_test.rb", "test/configuration_test.rb", "test/deploy/local_dependency_test.rb", "test/deploy/remote_dependency_test.rb", "test/deploy/scm/accurev_test.rb", "test/deploy/scm/base_test.rb", "test/deploy/scm/git_test.rb", "test/deploy/scm/mercurial_test.rb", "test/deploy/strategy/copy_test.rb", "test/extensions_test.rb", "test/fixtures/cli_integration.rb", "test/fixtures/config.rb", "test/fixtures/custom.rb", "test/logger_test.rb", "test/role_test.rb", "test/server_definition_test.rb", "test/shell_test.rb", "test/ssh_test.rb", "test/task_definition_test.rb", "test/transfer_test.rb", "test/utils.rb", "Manifest", "capistrano.gemspec", "test/deploy/scm/none_test.rb"] | |
- s.has_rdoc = true | |
- s.homepage = %q{http://www.capify.org} | |
- s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Capistrano", "--main", "README.rdoc"] | |
- s.require_paths = ["lib"] | |
- s.rubyforge_project = %q{capistrano} | |
- s.rubygems_version = %q{1.2.0} | |
- s.summary = %q{Capistrano is a utility and framework for executing commands in parallel on multiple remote machines, via SSH.} | |
- s.test_files = ["test/cli/execute_test.rb", "test/cli/help_test.rb", "test/cli/options_test.rb", "test/cli/ui_test.rb", "test/cli_test.rb", "test/command_test.rb", "test/configuration/actions/file_transfer_test.rb", "test/configuration/actions/inspect_test.rb", "test/configuration/actions/invocation_test.rb", "test/configuration/callbacks_test.rb", "test/configuration/connections_test.rb", "test/configuration/execution_test.rb", "test/configuration/loading_test.rb", "test/configuration/namespace_dsl_test.rb", "test/configuration/roles_test.rb", "test/configuration/servers_test.rb", "test/configuration/variables_test.rb", "test/configuration_test.rb", "test/deploy/local_dependency_test.rb", "test/deploy/remote_dependency_test.rb", "test/deploy/scm/accurev_test.rb", "test/deploy/scm/base_test.rb", "test/deploy/scm/git_test.rb", "test/deploy/scm/mercurial_test.rb", "test/deploy/scm/none_test.rb", "test/deploy/strategy/copy_test.rb", "test/extensions_test.rb", "test/logger_test.rb", "test/role_test.rb", "test/server_definition_test.rb", "test/shell_test.rb", "test/ssh_test.rb", "test/task_definition_test.rb", "test/transfer_test.rb"] | |
- | |
- if s.respond_to? :specification_version then | |
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION | |
- s.specification_version = 2 | |
- | |
- if current_version >= 3 then | |
- s.add_runtime_dependency(%q<net-ssh>, [">= 2.0.0"]) | |
- s.add_runtime_dependency(%q<net-sftp>, [">= 2.0.0"]) | |
- s.add_runtime_dependency(%q<net-scp>, [">= 1.0.0"]) | |
- s.add_runtime_dependency(%q<net-ssh-gateway>, [">= 1.0.0"]) | |
- s.add_runtime_dependency(%q<highline>, [">= 0"]) | |
- s.add_development_dependency(%q<echoe>, [">= 0"]) | |
- else | |
- s.add_dependency(%q<net-ssh>, [">= 2.0.0"]) | |
- s.add_dependency(%q<net-sftp>, [">= 2.0.0"]) | |
- s.add_dependency(%q<net-scp>, [">= 1.0.0"]) | |
- s.add_dependency(%q<net-ssh-gateway>, [">= 1.0.0"]) | |
- s.add_dependency(%q<highline>, [">= 0"]) | |
- s.add_dependency(%q<echoe>, [">= 0"]) | |
- end | |
- else | |
- s.add_dependency(%q<net-ssh>, [">= 2.0.0"]) | |
- s.add_dependency(%q<net-sftp>, [">= 2.0.0"]) | |
- s.add_dependency(%q<net-scp>, [">= 1.0.0"]) | |
- s.add_dependency(%q<net-ssh-gateway>, [">= 1.0.0"]) | |
- s.add_dependency(%q<highline>, [">= 0"]) | |
- s.add_dependency(%q<echoe>, [">= 0"]) | |
- end | |
-end | |
diff -urN /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/cli/help.txt /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/cli/help.txt | |
--- /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/cli/help.txt 2009-01-14 11:51:46.000000000 -0800 | |
+++ /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/cli/help.txt 2009-08-20 16:23:05.000000000 -0700 | |
@@ -60,3 +60,16 @@ | |
<%= color '-x, --skip-user-config', :bold %> | |
By default, cap will look for and (if it exists) load the user-specific configuration file located in $HOME/.caprc. If you don't want cap to load that file, give this option. | |
+ | |
+----------------------------- | |
+<%= color('Environment Variables', :bold) %> | |
+----------------------------- | |
+ | |
+ <%= color 'HOSTS', :bold %> | |
+ Execute the tasks against this comma-separated list of hosts. Effectively, this makes the host(s) part of every roles. | |
+ | |
+ <%= color 'HOSTFILTER', :bold %> | |
+ Execute tasks against this comma-separated list of host, but only if the host has the proper role for the task. | |
+ | |
+ <%= color 'ROLES', :bold %> | |
+ Execute tasks against this comma-separated list of roles. Hosts which do not have the right roles will be skipped. | |
\ No newline at end of file | |
diff -urN /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/cli/options.rb /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/cli/options.rb | |
--- /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/cli/options.rb 2009-01-14 11:51:46.000000000 -0800 | |
+++ /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/cli/options.rb 2009-08-20 16:23:05.000000000 -0700 | |
@@ -24,6 +24,7 @@ | |
# line switches for Capistrano, and what their corresponding behaviors | |
# are. | |
def option_parser #:nodoc: | |
+ @logger = Logger.new | |
@option_parser ||= OptionParser.new do |opts| | |
opts.banner = "Usage: #{File.basename($0)} [options] action ..." | |
@@ -43,7 +44,7 @@ | |
"A recipe file to load. May be given more than once." | |
) { |value| options[:recipes] << value } | |
- opts.on("-H", "--long-help", "Explain these options.") do | |
+ opts.on("-H", "--long-help", "Explain these options and environment variables.") do | |
long_help | |
exit | |
end | |
@@ -167,6 +168,7 @@ | |
%w(Capfile capfile).each do |file| | |
if File.file?(file) | |
options[:recipes] << file | |
+ @logger.info "Using recipes from #{File.join(current,file)}" | |
return | |
end | |
end | |
diff -urN /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/command.rb /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/command.rb | |
--- /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/command.rb 2009-01-14 11:51:46.000000000 -0800 | |
+++ /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/command.rb 2009-08-20 16:23:05.000000000 -0700 | |
@@ -209,8 +209,8 @@ | |
shell = nil | |
else | |
shell = "#{options[:shell] || "sh"} -c" | |
- cmd = cmd.gsub(/[$\\`"]/) { |m| "\\#{m}" } | |
- cmd = "\"#{cmd}\"" | |
+ cmd = cmd.gsub(/'/) { |m| "'\\''" } | |
+ cmd = "'#{cmd}'" | |
end | |
command_line = [environment, shell, cmd].compact.join(" ") | |
diff -urN /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/configuration/actions/invocation.rb /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/actions/invocation.rb | |
--- /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/configuration/actions/invocation.rb 2009-01-14 11:51:46.000000000 -0800 | |
+++ /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/actions/invocation.rb 2009-08-20 16:23:05.000000000 -0700 | |
@@ -26,10 +26,57 @@ | |
set :default_run_options, {} | |
end | |
+ # Executes different commands in parallel. This is useful for commands | |
+ # that need to be different on different hosts, but which could be | |
+ # otherwise run in parallel. | |
+ # | |
+ # The +options+ parameter is currently unused. | |
+ # | |
+ # Example: | |
+ # | |
+ # task :restart_everything do | |
+ # parallel do |session| | |
+ # session.when "in?(:app)", "/path/to/restart/mongrel" | |
+ # session.when "in?(:web)", "/path/to/restart/apache" | |
+ # session.when "in?(:db)", "/path/to/restart/mysql" | |
+ # end | |
+ # end | |
+ # | |
+ # Each command may have its own callback block, for capturing and | |
+ # responding to output, with semantics identical to #run: | |
+ # | |
+ # session.when "in?(:app)", "/path/to/restart/mongrel" do |ch, stream, data| | |
+ # # ch is the SSH channel for this command, used to send data | |
+ # # back to the command (e.g. ch.send_data("password\n")) | |
+ # # stream is either :out or :err, for which stream the data arrived on | |
+ # # data is a string containing data sent from the remote command | |
+ # end | |
+ # | |
+ # Also, you can specify a fallback command, to use when none of the | |
+ # conditions match a server: | |
+ # | |
+ # session.else "/execute/something/else" | |
+ # | |
+ # The string specified as the first argument to +when+ may be any valid | |
+ # Ruby code. It has access to the following variables and methods: | |
+ # | |
+ # * +in?(role)+ returns true if the server participates in the given role | |
+ # * +server+ is the ServerDefinition object for the server. This can be | |
+ # used to get the host-name, etc. | |
+ # * +configuration+ is the current Capistrano::Configuration object, which | |
+ # you can use to get the value of variables, etc. | |
+ # | |
+ # For example: | |
+ # | |
+ # session.when "server.host =~ /app/", "/some/command" | |
+ # session.when "server.host == configuration[:some_var]", "/another/command" | |
+ # session.when "in?(:web) || in?(:app)", "/more/commands" | |
+ # | |
+ # See #run for a description of the valid +options+. | |
def parallel(options={}) | |
raise ArgumentError, "parallel() requires a block" unless block_given? | |
tree = Command::Tree.new(self) { |t| yield t } | |
- run_tree(tree) | |
+ run_tree(tree, options) | |
end | |
# Invokes the given command. If a +via+ key is given, it will be used | |
@@ -48,13 +95,58 @@ | |
# channel (which may be used to send data back to the remote process), | |
# the stream identifier (<tt>:err</tt> for stderr, and <tt>:out</tt> for | |
# stdout), and the data that was received. | |
+ # | |
+ # The +options+ hash may include any of the following keys: | |
+ # | |
+ # * :hosts - this is either a string (for a single target host) or an array | |
+ # of strings, indicating which hosts the command should run on. By default, | |
+ # the hosts are determined from the task definition. | |
+ # * :roles - this is either a string or symbol (for a single target role) or | |
+ # an array of strings or symbols, indicating which roles the command should | |
+ # run on. If :hosts is specified, :roles will be ignored. | |
+ # * :only - specifies a condition limiting which hosts will be selected to | |
+ # run the command. This should refer to values set in the role definition. | |
+ # For example, if a role is defined with :primary => true, then you could | |
+ # select only hosts with :primary true by setting :only => { :primary => true }. | |
+ # * :except - specifies a condition limiting which hosts will be selected to | |
+ # run the command. This is the inverse of :only (hosts that do _not_ match | |
+ # the condition will be selected). | |
+ # * :once - if true, only the first matching server will be selected. The default | |
+ # is false (all matching servers will be selected). | |
+ # * :max_hosts - specifies the maximum number of hosts that should be selected | |
+ # at a time. If this value is less than the number of hosts that are selected | |
+ # to run, then the hosts will be run in groups of max_hosts. The default is nil, | |
+ # which indicates that there is no maximum host limit. | |
+ # * :shell - says which shell should be used to invoke commands. This | |
+ # defaults to "sh". Setting this to false causes Capistrano to invoke | |
+ # the commands directly, without wrapping them in a shell invocation. | |
+ # * :data - if not nil (the default), this should be a string that will | |
+ # be passed to the command's stdin stream. | |
+ # * :pty - if true, a pseudo-tty will be allocated for each command. The | |
+ # default is false. Note that there are benefits and drawbacks both ways. | |
+ # Empirically, it appears that if a pty is allocated, the SSH server daemon | |
+ # will _not_ read user shell start-up scripts (e.g. bashrc, etc.). However, | |
+ # if a pty is _not_ allocated, some commands will refuse to run in | |
+ # interactive mode and will not prompt for (e.g.) passwords. | |
+ # * :env - a hash of environment variable mappings that should be made | |
+ # available to the command. The keys should be environment variable names, | |
+ # and the values should be their corresponding values. The default is | |
+ # empty, but may be modified by changing the +default_environment+ | |
+ # Capistrano variable. | |
+ # | |
+ # Note that if you set these keys in the +default_run_options+ Capistrano | |
+ # variable, they will apply for all invocations of #run, #invoke_command, | |
+ # and #parallel. | |
def run(cmd, options={}, &block) | |
block ||= self.class.default_io_proc | |
tree = Command::Tree.new(self) { |t| t.else(cmd, &block) } | |
run_tree(tree, options) | |
end | |
- def run_tree(tree, options={}) | |
+ # Executes a Capistrano::Command::Tree object. This is not for direct | |
+ # use, but should instead be called indirectly, via #run or #parallel, | |
+ # or #invoke_command. | |
+ def run_tree(tree, options={}) #:nodoc: | |
if tree.branches.empty? && tree.fallback | |
logger.debug "executing #{tree.fallback}" | |
elsif tree.branches.any? | |
@@ -98,6 +190,12 @@ | |
# executable on the remote machine: | |
# | |
# set :sudo, "/opt/local/bin/sudo" | |
+ # | |
+ # If you know what you're doing, you can also set <tt>:sudo_prompt</tt>, | |
+ # which tells capistrano which prompt sudo should use when asking for | |
+ # a password. (This is so that capistrano knows what prompt to look for | |
+ # in the output.) If you set :sudo_prompt to an empty string, Capistrano | |
+ # will not send a preferred prompt. | |
def sudo(*parameters, &block) | |
options = parameters.last.is_a?(Hash) ? parameters.pop.dup : {} | |
command = parameters.first | |
@@ -125,14 +223,16 @@ | |
prompt_host = nil | |
Proc.new do |ch, stream, out| | |
- if out =~ /^#{Regexp.escape(sudo_prompt)}/ | |
- ch.send_data "#{self[:password]}\n" | |
- elsif out =~ /^Sorry, try again/ | |
+ if out =~ /^Sorry, try again/ | |
if prompt_host.nil? || prompt_host == ch[:server] | |
prompt_host = ch[:server] | |
logger.important out, "#{stream} :: #{ch[:server]}" | |
reset! :password | |
end | |
+ end | |
+ | |
+ if out =~ /^#{Regexp.escape(sudo_prompt)}/ | |
+ ch.send_data "#{self[:password]}\n" | |
elsif fallback | |
fallback.call(ch, stream, out) | |
end | |
diff -urN /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/configuration/connections.rb /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/connections.rb | |
--- /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/configuration/connections.rb 2009-01-14 11:51:46.000000000 -0800 | |
+++ /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/connections.rb 2009-08-20 16:23:05.000000000 -0700 | |
@@ -51,24 +51,26 @@ | |
# A hash of the SSH sessions that are currently open and available. | |
# Because sessions are constructed lazily, this will only contain | |
# connections to those servers that have been the targets of one or more | |
- # executed tasks. | |
- attr_reader :sessions | |
+ # executed tasks. Stored on a per-thread basis to improve thread-safety. | |
+ def sessions | |
+ Thread.current[:sessions] ||= {} | |
+ end | |
def initialize_with_connections(*args) #:nodoc: | |
initialize_without_connections(*args) | |
- @sessions = {} | |
- @failed_sessions = [] | |
+ Thread.current[:sessions] = {} | |
+ Thread.current[:failed_sessions] = [] | |
end | |
# Indicate that the given server could not be connected to. | |
def failed!(server) | |
- @failed_sessions << server | |
+ Thread.current[:failed_sessions] << server | |
end | |
# Query whether previous connection attempts to the given server have | |
# failed. | |
def has_failed?(server) | |
- @failed_sessions.include?(server) | |
+ Thread.current[:failed_sessions].include?(server) | |
end | |
# Used to force connections to be made to the current task's servers. | |
@@ -116,9 +118,9 @@ | |
# Destroys sessions for each server in the list. | |
def teardown_connections_to(servers) | |
servers.each do |server| | |
- @sessions[server].close | |
- @sessions.delete(server) | |
- end | |
+ sessions[server].close | |
+ sessions.delete(server) | |
+ end | |
end | |
# Determines the set of servers within the current task's scope and | |
@@ -186,11 +188,13 @@ | |
# prevents problems with the thread's scope seeing the wrong 'server' | |
# variable if the thread just happens to take too long to start up. | |
def establish_connection_to(server, failures=nil) | |
- Thread.new { safely_establish_connection_to(server, failures) } | |
+ current_thread = Thread.current | |
+ Thread.new { safely_establish_connection_to(server, current_thread, failures) } | |
end | |
- def safely_establish_connection_to(server, failures=nil) | |
- sessions[server] ||= connection_factory.connect_to(server) | |
+ def safely_establish_connection_to(server, thread, failures=nil) | |
+ thread[:sessions] ||= {} | |
+ thread[:sessions][server] ||= connection_factory.connect_to(server) | |
rescue Exception => err | |
raise unless failures | |
failures << { :server => server, :error => err } | |
diff -urN /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/configuration/execution.rb /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/execution.rb | |
--- /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/configuration/execution.rb 2009-01-14 11:51:46.000000000 -0800 | |
+++ /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/execution.rb 2009-08-20 16:23:05.000000000 -0700 | |
@@ -8,22 +8,11 @@ | |
base.send :alias_method, :initialize, :initialize_with_execution | |
end | |
- # The call stack of the tasks. The currently executing task may inspect | |
- # this to see who its caller was. The current task is always the last | |
- # element of this stack. | |
- attr_reader :task_call_frames | |
- | |
- # The stack of tasks that have registered rollback handlers within the | |
- # current transaction. If this is nil, then there is no transaction | |
- # that is currently active. | |
- attr_reader :rollback_requests | |
- | |
# A struct for representing a single instance of an invoked task. | |
TaskCallFrame = Struct.new(:task, :rollback) | |
def initialize_with_execution(*args) #:nodoc: | |
initialize_without_execution(*args) | |
- @task_call_frames = [] | |
end | |
private :initialize_with_execution | |
@@ -32,6 +21,25 @@ | |
!rollback_requests.nil? | |
end | |
+ # The call stack of the tasks. The currently executing task may inspect | |
+ # this to see who its caller was. The current task is always the last | |
+ # element of this stack. | |
+ def task_call_frames | |
+ Thread.current[:task_call_frames] ||= [] | |
+ end | |
+ | |
+ | |
+ # The stack of tasks that have registered rollback handlers within the | |
+ # current transaction. If this is nil, then there is no transaction | |
+ # that is currently active. | |
+ def rollback_requests | |
+ Thread.current[:rollback_requests] | |
+ end | |
+ | |
+ def rollback_requests=(rollback_requests) | |
+ Thread.current[:rollback_requests] = rollback_requests | |
+ end | |
+ | |
# Invoke a set of tasks in a transaction. If any task fails (raises an | |
# exception), all tasks executed within the transaction are inspected to | |
# see if they have an associated on_rollback hook, and if so, that hook | |
@@ -44,14 +52,14 @@ | |
logger.info "transaction: start" | |
begin | |
- @rollback_requests = [] | |
+ self.rollback_requests = [] | |
yield | |
logger.info "transaction: commit" | |
rescue Object => e | |
rollback! | |
raise | |
ensure | |
- @rollback_requests = nil | |
+ self.rollback_requests = nil if Thread.main == Thread.current | |
end | |
end | |
@@ -99,6 +107,9 @@ | |
protected | |
def rollback! | |
+ return if Thread.current[:rollback_requests].nil? | |
+ Thread.current[:rolled_back] = true | |
+ | |
# throw the task back on the stack so that roles are properly | |
# interpreted in the scope of the task in question. | |
rollback_requests.reverse.each do |frame| | |
diff -urN /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/configuration/namespaces.rb /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/namespaces.rb | |
--- /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/configuration/namespaces.rb 2009-01-14 11:51:46.000000000 -0800 | |
+++ /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/namespaces.rb 2009-08-20 16:23:05.000000000 -0700 | |
@@ -177,8 +177,8 @@ | |
raise NotImplementedError, "roles cannot be defined in a namespace" | |
end | |
- def respond_to?(sym) | |
- super || parent.respond_to?(sym) | |
+ def respond_to?(sym, include_priv=false) | |
+ super || parent.respond_to?(sym, include_priv) | |
end | |
def method_missing(sym, *args, &block) | |
diff -urN /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/configuration/roles.rb /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/roles.rb | |
--- /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/configuration/roles.rb 2009-01-14 11:51:46.000000000 -0800 | |
+++ /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/roles.rb 2009-08-20 16:23:05.000000000 -0700 | |
@@ -45,6 +45,14 @@ | |
def role(which, *args, &block) | |
options = args.last.is_a?(Hash) ? args.pop : {} | |
which = which.to_sym | |
+ | |
+ # The roles Hash is defined so that unrecognized keys always auto-initialize | |
+ # to a new Role instance (see the assignment in the initialize_with_roles method, | |
+ # above). However, we explicitly assign here so that role declarations will | |
+ # vivify the role object even if there are no server arguments. (Otherwise, | |
+ # role(:app) won't actually instantiate a Role object for :app.) | |
+ roles[which] ||= Role.new | |
+ | |
roles[which].push(block, options) if block_given? | |
args.each { |host| roles[which] << ServerDefinition.new(host, options) } | |
end | |
diff -urN /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/configuration/variables.rb /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/variables.rb | |
--- /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/configuration/variables.rb 2009-01-14 11:51:46.000000000 -0800 | |
+++ /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/variables.rb 2009-08-20 16:23:05.000000000 -0700 | |
@@ -111,8 +111,8 @@ | |
end | |
private :protect | |
- def respond_to_with_variables?(sym) #:nodoc: | |
- @variables.has_key?(sym) || respond_to_without_variables?(sym) | |
+ def respond_to_with_variables?(sym, include_priv=false) #:nodoc: | |
+ @variables.has_key?(sym) || respond_to_without_variables?(sym, include_priv) | |
end | |
def method_missing_with_variables(sym, *args, &block) #:nodoc: | |
diff -urN /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/recipes/deploy/scm/git.rb /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/recipes/deploy/scm/git.rb | |
--- /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/recipes/deploy/scm/git.rb 2009-01-14 11:51:46.000000000 -0800 | |
+++ /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/recipes/deploy/scm/git.rb 2009-08-20 16:23:05.000000000 -0700 | |
@@ -151,6 +151,7 @@ | |
if configuration[:git_enable_submodules] | |
execute << "#{git} submodule #{verbose} init" | |
+ execute << "#{git} submodule #{verbose} sync" | |
execute << "#{git} submodule #{verbose} update" | |
end | |
@@ -188,9 +189,15 @@ | |
if configuration[:git_enable_submodules] | |
execute << "#{git} submodule #{verbose} init" | |
+ execute << "for mod in `#{git} submodule status | awk '{ print $2 }'`; do #{git} config -f .git/config submodule.${mod}.url `#{git} config -f .gitmodules --get submodule.${mod}.url` && echo Synced $mod; done" | |
+ execute << "#{git} submodule #{verbose} sync" | |
execute << "#{git} submodule #{verbose} update" | |
end | |
+ # Make sure there's nothing else lying around in the repository (for | |
+ # example, a submodule that has subsequently been removed). | |
+ execute << "#{git} clean #{verbose} -d -x -f" | |
+ | |
execute.join(" && ") | |
end | |
@@ -208,7 +215,7 @@ | |
# Getting the actual commit id, in case we were passed a tag | |
# or partial sha or something - it will return the sha if you pass a sha, too | |
def query_revision(revision) | |
- raise ArgumentError, "Deploying remote branches has been deprecated. Specify the remote branch as a local branch for the git repository you're deploying from (ie: '#{revision.gsub('origin/', '')}' rather than '#{revision}')." if revision =~ /^origin\// | |
+ raise ArgumentError, "Deploying remote branches is no longer supported. Specify the remote branch as a local branch for the git repository you're deploying from (ie: '#{revision.gsub('origin/', '')}' rather than '#{revision}')." if revision =~ /^origin\// | |
return revision if revision =~ /^[0-9a-f]{40}$/ | |
command = scm('ls-remote', repository, revision) | |
result = yield(command) | |
diff -urN /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/recipes/deploy/scm/mercurial.rb /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/recipes/deploy/scm/mercurial.rb | |
--- /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/recipes/deploy/scm/mercurial.rb 2009-01-14 11:51:46.000000000 -0800 | |
+++ /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/recipes/deploy/scm/mercurial.rb 2009-08-20 16:23:05.000000000 -0700 | |
@@ -18,7 +18,7 @@ | |
# For mercurial HEAD == tip except that it bases this assumption on what | |
# tip is in the current repository (so push before you deploy) | |
def head | |
- "tip" | |
+ configuration[:branch] || "tip" | |
end | |
# Clone the repository and update to the specified changeset. | |
@@ -134,4 +134,4 @@ | |
end | |
end | |
end | |
-end | |
\ No newline at end of file | |
+end | |
diff -urN /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/recipes/deploy/scm/perforce.rb /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/recipes/deploy/scm/perforce.rb | |
--- /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/recipes/deploy/scm/perforce.rb 2009-01-14 11:51:46.000000000 -0800 | |
+++ /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/recipes/deploy/scm/perforce.rb 2009-08-20 16:23:05.000000000 -0700 | |
@@ -49,7 +49,7 @@ | |
# Returns a "p4 changes" command for the two revisions. | |
def log(from=1, to=head) | |
- scm authentication, :changes, "-s submitted", "//#{p4client}/...#{rev_no(from)},#(rev_no(to)}" | |
+ scm authentication, :changes, "-s submitted", "//#{p4client}/...#{rev_no(from)},#{rev_no(to)}" | |
end | |
def query_revision(revision) | |
@@ -58,6 +58,11 @@ | |
yield(command)[/Change (\d+) on/, 1] | |
end | |
+ # Increments the given revision number and returns it. | |
+ def next_revision(revision) | |
+ revision.to_i + 1 | |
+ end | |
+ | |
# Determines what the response should be for a particular bit of text | |
# from the SCM. Password prompts, connection requests, passphrases, | |
# etc. are handled here. | |
diff -urN /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/recipes/deploy/strategy/remote_cache.rb /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/recipes/deploy/strategy/remote_cache.rb | |
--- /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/recipes/deploy/strategy/remote_cache.rb 2009-01-14 11:51:46.000000000 -0800 | |
+++ /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/recipes/deploy/strategy/remote_cache.rb 2009-08-20 16:23:05.000000000 -0700 | |
@@ -42,7 +42,7 @@ | |
run "cp -RPp #{repository_cache} #{configuration[:release_path]} && #{mark}" | |
else | |
exclusions = copy_exclude.map { |e| "--exclude=\"#{e}\"" }.join(' ') | |
- run "rsync -lrp #{exclusions} #{repository_cache}/* #{configuration[:release_path]} && #{mark}" | |
+ run "rsync -lrpt #{exclusions} #{repository_cache}/* #{configuration[:release_path]} && #{mark}" | |
end | |
end | |
diff -urN /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/ssh.rb /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/ssh.rb | |
--- /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/ssh.rb 2009-01-14 11:51:46.000000000 -0800 | |
+++ /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/ssh.rb 2009-08-20 16:23:05.000000000 -0700 | |
@@ -1,6 +1,6 @@ | |
begin | |
require 'rubygems' | |
- gem 'net-ssh', ">= 1.99.1" | |
+ gem 'net-ssh', ">= 2.0.10" | |
rescue LoadError, NameError | |
end | |
@@ -55,12 +55,32 @@ | |
methods = [ %w(publickey hostbased), %w(password keyboard-interactive) ] | |
password_value = nil | |
- ssh_options = (server.options[:ssh_options] || {}).merge(options[:ssh_options] || {}) | |
- user = server.user || options[:user] || ssh_options[:username] || ServerDefinition.default_user | |
- port = server.port || options[:port] || ssh_options[:port] | |
+ # construct the hash of ssh options that should be passed more-or-less | |
+ # directly to Net::SSH. This will be the general ssh options, merged with | |
+ # the server-specific ssh-options. | |
+ ssh_options = (options[:ssh_options] || {}).merge(server.options[:ssh_options] || {}) | |
+ | |
+ # load any SSH configuration files that were specified in the SSH options. This | |
+ # will load from ~/.ssh/config and /etc/ssh_config by default (see Net::SSH | |
+ # for details). Merge the explicitly given ssh_options over the top of the info | |
+ # from the config file. | |
+ ssh_options = Net::SSH.configuration_for(server.host, ssh_options.fetch(:config, true)).merge(ssh_options) | |
+ | |
+ # Once we've loaded the config, we don't need Net::SSH to do it again. | |
+ ssh_options[:config] = false | |
+ | |
+ user = server.user || options[:user] || ssh_options[:username] || | |
+ ssh_options[:user] || ServerDefinition.default_user | |
+ port = server.port || options[:port] || ssh_options[:port] | |
+ | |
+ # the .ssh/config file might have changed the host-name on us | |
+ host = ssh_options.fetch(:host_name, server.host) | |
ssh_options[:port] = port if port | |
+ | |
+ # delete these, since we've determined which username to use by this point | |
ssh_options.delete(:username) | |
+ ssh_options.delete(:user) | |
begin | |
connection_options = ssh_options.merge( | |
@@ -68,7 +88,7 @@ | |
:auth_methods => ssh_options[:auth_methods] || methods.shift | |
) | |
- yield server.host, user, connection_options | |
+ yield host, user, connection_options | |
rescue Net::SSH::AuthenticationFailed | |
raise if methods.empty? || ssh_options[:auth_methods] | |
password_value = options[:password] | |
diff -urN /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/version.rb /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/version.rb | |
--- /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/lib/capistrano/version.rb 2009-01-14 11:51:46.000000000 -0800 | |
+++ /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/version.rb 2009-08-20 16:23:05.000000000 -0700 | |
@@ -6,7 +6,7 @@ | |
class Version < Net::SSH::Version | |
MAJOR = 2 | |
MINOR = 5 | |
- TINY = 3 | |
+ TINY = 8 | |
# The current version, as a Version instance | |
CURRENT = new(MAJOR, MINOR, TINY) | |
diff -urN /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/test/command_test.rb /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/test/command_test.rb | |
--- /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/test/command_test.rb 2009-01-14 11:51:46.000000000 -0800 | |
+++ /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/test/command_test.rb 2009-08-20 16:23:05.000000000 -0700 | |
@@ -20,7 +20,7 @@ | |
def test_command_with_pty_should_request_pty_and_register_success_callback | |
session = setup_for_extracting_channel_action(:request_pty, true) do |ch| | |
- ch.expects(:exec).with(%(sh -c "ls")) | |
+ ch.expects(:exec).with(%(sh -c 'ls')) | |
end | |
Capistrano::Command.new("ls", [session], :pty => true) | |
end | |
@@ -28,35 +28,35 @@ | |
def test_command_with_env_key_should_have_environment_constructed_and_prepended | |
session = setup_for_extracting_channel_action do |ch| | |
ch.expects(:request_pty).never | |
- ch.expects(:exec).with(%(env FOO=bar sh -c "ls")) | |
+ ch.expects(:exec).with(%(env FOO=bar sh -c 'ls')) | |
end | |
Capistrano::Command.new("ls", [session], :env => { "FOO" => "bar" }) | |
end | |
def test_env_with_symbolic_key_should_be_accepted_as_a_string | |
session = setup_for_extracting_channel_action do |ch| | |
- ch.expects(:exec).with(%(env FOO=bar sh -c "ls")) | |
+ ch.expects(:exec).with(%(env FOO=bar sh -c 'ls')) | |
end | |
Capistrano::Command.new("ls", [session], :env => { :FOO => "bar" }) | |
end | |
def test_env_as_string_should_be_substituted_in_directly | |
session = setup_for_extracting_channel_action do |ch| | |
- ch.expects(:exec).with(%(env HOWDY=there sh -c "ls")) | |
+ ch.expects(:exec).with(%(env HOWDY=there sh -c 'ls')) | |
end | |
Capistrano::Command.new("ls", [session], :env => "HOWDY=there") | |
end | |
def test_env_with_symbolic_value_should_be_accepted_as_string | |
session = setup_for_extracting_channel_action do |ch| | |
- ch.expects(:exec).with(%(env FOO=bar sh -c "ls")) | |
+ ch.expects(:exec).with(%(env FOO=bar sh -c 'ls')) | |
end | |
Capistrano::Command.new("ls", [session], :env => { "FOO" => :bar }) | |
end | |
def test_env_value_should_be_escaped | |
session = setup_for_extracting_channel_action do |ch| | |
- ch.expects(:exec).with(%(env FOO=(\\ \\\"bar\\\"\\ ) sh -c "ls")) | |
+ ch.expects(:exec).with(%(env FOO=(\\ \\\"bar\\\"\\ ) sh -c 'ls')) | |
end | |
Capistrano::Command.new("ls", [session], :env => { "FOO" => '( "bar" )' }) | |
end | |
@@ -68,7 +68,7 @@ | |
command =~ /\ba=b\b/ && | |
command =~ /\bc=d\b/ && | |
command =~ /\be=f\b/ && | |
- command =~ / sh -c "ls"$/ | |
+ command =~ / sh -c 'ls'$/ | |
end | |
end | |
Capistrano::Command.new("ls", [session], :env => { :a => :b, :c => :d, :e => :f }) | |
@@ -90,14 +90,14 @@ | |
def test_successful_channel_should_send_command | |
session = setup_for_extracting_channel_action do |ch| | |
- ch.expects(:exec).with(%(sh -c "ls")) | |
+ ch.expects(:exec).with(%(sh -c 'ls')) | |
end | |
Capistrano::Command.new("ls", [session]) | |
end | |
def test_successful_channel_with_shell_option_should_send_command_via_specified_shell | |
session = setup_for_extracting_channel_action do |ch| | |
- ch.expects(:exec).with(%(/bin/bash -c "ls")) | |
+ ch.expects(:exec).with(%(/bin/bash -c 'ls')) | |
end | |
Capistrano::Command.new("ls", [session], :shell => "/bin/bash") | |
end | |
@@ -111,7 +111,7 @@ | |
def test_successful_channel_should_send_data_if_data_key_is_present | |
session = setup_for_extracting_channel_action do |ch| | |
- ch.expects(:exec).with(%(sh -c "ls")) | |
+ ch.expects(:exec).with(%(sh -c 'ls')) | |
ch.expects(:send_data).with("here we go") | |
end | |
Capistrano::Command.new("ls", [session], :data => "here we go") | |
@@ -225,14 +225,14 @@ | |
def test_process_with_host_placeholder_should_substitute_placeholder_with_each_host | |
session = setup_for_extracting_channel_action do |ch| | |
- ch.expects(:exec).with(%(sh -c "echo capistrano")) | |
+ ch.expects(:exec).with(%(sh -c 'echo capistrano')) | |
end | |
Capistrano::Command.new("echo $CAPISTRANO:HOST$", [session]) | |
end | |
def test_process_with_unknown_placeholder_should_not_replace_placeholder | |
session = setup_for_extracting_channel_action do |ch| | |
- ch.expects(:exec).with(%(sh -c "echo \\$CAPISTRANO:OTHER\\$")) | |
+ ch.expects(:exec).with(%(sh -c 'echo $CAPISTRANO:OTHER$')) | |
end | |
Capistrano::Command.new("echo $CAPISTRANO:OTHER$", [session]) | |
end | |
diff -urN /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/test/configuration/actions/invocation_test.rb /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/test/configuration/actions/invocation_test.rb | |
--- /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/test/configuration/actions/invocation_test.rb 2009-01-14 11:51:46.000000000 -0800 | |
+++ /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/test/configuration/actions/invocation_test.rb 2009-08-20 16:23:05.000000000 -0700 | |
@@ -166,6 +166,20 @@ | |
callback[ch, nil, "Sorry, try again."] | |
end | |
+ def test_sudo_behavior_callback_should_reset_password_and_prompt_again_if_output_includes_both_cues | |
+ ch = mock("channel") | |
+ ch.stubs(:[]).with(:host).returns("capistrano") | |
+ ch.stubs(:[]).with(:server).returns(server("capistrano")) | |
+ ch.expects(:send_data, "password!\n").times(2) | |
+ | |
+ @config.set(:password, "password!") | |
+ @config.expects(:reset!).with(:password) | |
+ | |
+ callback = @config.sudo_behavior_callback(nil) | |
+ callback[ch, :out, "sudo password: "] | |
+ callback[ch, :out, "Sorry, try again.\nsudo password: "] | |
+ end | |
+ | |
def test_sudo_behavior_callback_should_defer_to_fallback_for_other_output | |
callback = @config.sudo_behavior_callback(inspectable_proc) | |
diff -urN /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/test/configuration/connections_test.rb /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/test/configuration/connections_test.rb | |
--- /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/test/configuration/connections_test.rb 2009-01-14 11:51:46.000000000 -0800 | |
+++ /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/test/configuration/connections_test.rb 2009-08-20 16:23:05.000000000 -0700 | |
@@ -30,6 +30,7 @@ | |
def setup | |
@config = MockConfig.new | |
@config.stubs(:logger).returns(stub_everything) | |
+ Net::SSH.stubs(:configuration_for).returns({}) | |
@ssh_options = { | |
:user => "user", | |
:port => 8080, | |
@@ -60,29 +61,29 @@ | |
def test_should_connect_through_gateway_if_gateway_variable_is_set | |
@config.values[:gateway] = "j@gateway" | |
- Net::SSH::Gateway.expects(:new).with("gateway", "j", :password => nil, :auth_methods => %w(publickey hostbased)).returns(stub_everything) | |
+ Net::SSH::Gateway.expects(:new).with("gateway", "j", :password => nil, :auth_methods => %w(publickey hostbased), :config => false).returns(stub_everything) | |
assert_instance_of Capistrano::Configuration::Connections::GatewayConnectionFactory, @config.connection_factory | |
end | |
def test_connection_factory_as_gateway_should_honor_config_options | |
@config.values[:gateway] = "gateway" | |
@config.values.update(@ssh_options) | |
- Net::SSH::Gateway.expects(:new).with("gateway", "user", :debug => :verbose, :port => 8080, :password => nil, :auth_methods => %w(publickey hostbased)).returns(stub_everything) | |
+ Net::SSH::Gateway.expects(:new).with("gateway", "user", :debug => :verbose, :port => 8080, :password => nil, :auth_methods => %w(publickey hostbased), :config => false).returns(stub_everything) | |
assert_instance_of Capistrano::Configuration::Connections::GatewayConnectionFactory, @config.connection_factory | |
end | |
def test_connection_factory_as_gateway_should_chain_gateways_if_gateway_variable_is_an_array | |
@config.values[:gateway] = ["j@gateway1", "k@gateway2"] | |
gateway1 = mock | |
- Net::SSH::Gateway.expects(:new).with("gateway1", "j", :password => nil, :auth_methods => %w(publickey hostbased)).returns(gateway1) | |
+ Net::SSH::Gateway.expects(:new).with("gateway1", "j", :password => nil, :auth_methods => %w(publickey hostbased), :config => false).returns(gateway1) | |
gateway1.expects(:open).returns(65535) | |
- Net::SSH::Gateway.expects(:new).with("127.0.0.1", "k", :port => 65535, :password => nil, :auth_methods => %w(publickey hostbased)).returns(stub_everything) | |
+ Net::SSH::Gateway.expects(:new).with("127.0.0.1", "k", :port => 65535, :password => nil, :auth_methods => %w(publickey hostbased), :config => false).returns(stub_everything) | |
assert_instance_of Capistrano::Configuration::Connections::GatewayConnectionFactory, @config.connection_factory | |
end | |
def test_connection_factory_as_gateway_should_share_gateway_between_connections | |
@config.values[:gateway] = "j@gateway" | |
- Net::SSH::Gateway.expects(:new).once.with("gateway", "j", :password => nil, :auth_methods => %w(publickey hostbased)).returns(stub_everything) | |
+ Net::SSH::Gateway.expects(:new).once.with("gateway", "j", :password => nil, :auth_methods => %w(publickey hostbased), :config => false).returns(stub_everything) | |
Capistrano::SSH.stubs(:connect).returns(stub_everything) | |
assert_instance_of Capistrano::Configuration::Connections::GatewayConnectionFactory, @config.connection_factory | |
@config.establish_connections_to(server("capistrano")) | |
diff -urN /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/test/configuration/namespace_dsl_test.rb /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/test/configuration/namespace_dsl_test.rb | |
--- /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/test/configuration/namespace_dsl_test.rb 2009-01-14 11:51:46.000000000 -0800 | |
+++ /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/test/configuration/namespace_dsl_test.rb 2009-08-20 16:23:05.000000000 -0700 | |
@@ -238,6 +238,12 @@ | |
ns = @config.namespaces[:outer] | |
assert ns.respond_to?(:original_initialize_called) | |
end | |
+ | |
+ def test_namespace_should_accept_respond_to_with_include_priv_parameter | |
+ @config.namespace(:outer) {} | |
+ ns = @config.namespaces[:outer] | |
+ assert ns.respond_to?(:original_initialize_called, true) | |
+ end | |
def test_namespace_should_delegate_unknown_messages_to_its_parent | |
@config.namespace(:outer) {} | |
diff -urN /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/test/configuration/roles_test.rb /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/test/configuration/roles_test.rb | |
--- /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/test/configuration/roles_test.rb 2009-01-14 11:51:46.000000000 -0800 | |
+++ /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/test/configuration/roles_test.rb 2009-08-20 16:23:05.000000000 -0700 | |
@@ -24,6 +24,7 @@ | |
def test_role_should_allow_empty_list | |
@config.role :app | |
+ assert @config.roles.keys.include?(:app) | |
assert @config.roles[:app].empty? | |
end | |
diff -urN /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/test/configuration/variables_test.rb /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/test/configuration/variables_test.rb | |
--- /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/test/configuration/variables_test.rb 2009-01-14 11:51:46.000000000 -0800 | |
+++ /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/test/configuration/variables_test.rb 2009-08-20 16:23:05.000000000 -0700 | |
@@ -53,6 +53,10 @@ | |
@config[:sample] = :value | |
assert @config.respond_to?(:sample) | |
end | |
+ | |
+ def test_respond_to_with_include_priv_paramter | |
+ assert [email protected]_to?(:sample, true) | |
+ end | |
def test_set_should_require_value | |
assert_raises(ArgumentError) do | |
diff -urN /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/test/deploy/scm/git_test.rb /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/test/deploy/scm/git_test.rb | |
--- /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/test/deploy/scm/git_test.rb 2009-01-14 11:51:46.000000000 -0800 | |
+++ /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/test/deploy/scm/git_test.rb 2009-08-20 16:23:05.000000000 -0700 | |
@@ -37,6 +37,10 @@ | |
git = "/opt/local/bin/git" | |
@config[:scm_command] = git | |
assert_equal "#{git} clone -q [email protected]:project.git /var/www && cd /var/www && #{git} checkout -q -b deploy #{rev}", @source.checkout(rev, dest) | |
+ | |
+ # with submodules | |
+ @config[:git_enable_submodules] = true | |
+ assert_equal "#{git} clone -q [email protected]:project.git /var/www && cd /var/www && #{git} checkout -q -b deploy #{rev} && #{git} submodule -q init && #{git} submodule -q sync && #{git} submodule -q update", @source.checkout(rev, dest) | |
end | |
def test_checkout_with_verbose_should_not_use_q_switch | |
@@ -88,12 +92,16 @@ | |
def test_sync | |
dest = "/var/www" | |
rev = 'c2d9e79' | |
- assert_equal "cd #{dest} && git fetch -q origin && git reset -q --hard #{rev}", @source.sync(rev, dest) | |
+ assert_equal "cd #{dest} && git fetch -q origin && git reset -q --hard #{rev} && git clean -q -d -x -f", @source.sync(rev, dest) | |
# With :scm_command | |
git = "/opt/local/bin/git" | |
@config[:scm_command] = git | |
- assert_equal "cd #{dest} && #{git} fetch -q origin && #{git} reset -q --hard #{rev}", @source.sync(rev, dest) | |
+ assert_equal "cd #{dest} && #{git} fetch -q origin && #{git} reset -q --hard #{rev} && #{git} clean -q -d -x -f", @source.sync(rev, dest) | |
+ | |
+ # with submodules | |
+ @config[:git_enable_submodules] = true | |
+ assert_equal "cd #{dest} && #{git} fetch -q origin && #{git} reset -q --hard #{rev} && #{git} submodule -q init && for mod in `#{git} submodule status | awk '{ print $2 }'`; do #{git} config -f .git/config submodule.${mod}.url `#{git} config -f .gitmodules --get submodule.${mod}.url` && echo Synced $mod; done && #{git} submodule -q sync && #{git} submodule -q update && #{git} clean -q -d -x -f", @source.sync(rev, dest) | |
end | |
def test_sync_with_remote | |
@@ -105,7 +113,7 @@ | |
@config[:repository] = repository | |
@config[:remote] = remote | |
- assert_equal "cd #{dest} && git config remote.#{remote}.url #{repository} && git config remote.#{remote}.fetch +refs/heads/*:refs/remotes/#{remote}/* && git fetch -q #{remote} && git reset -q --hard #{rev}", @source.sync(rev, dest) | |
+ assert_equal "cd #{dest} && git config remote.#{remote}.url #{repository} && git config remote.#{remote}.fetch +refs/heads/*:refs/remotes/#{remote}/* && git fetch -q #{remote} && git reset -q --hard #{rev} && git clean -q -d -x -f", @source.sync(rev, dest) | |
end | |
def test_shallow_clone | |
@@ -124,6 +132,15 @@ | |
assert_equal "git clone -q -o username [email protected]:project.git /var/www && cd /var/www && git checkout -q -b deploy #{rev}", @source.checkout(rev, dest) | |
end | |
+ def test_remote_clone_with_submodules | |
+ @config[:repository] = "[email protected]:project.git" | |
+ @config[:remote] = "username" | |
+ @config[:git_enable_submodules] = true | |
+ dest = "/var/www" | |
+ rev = 'c2d9e79' | |
+ assert_equal "git clone -q -o username [email protected]:project.git /var/www && cd /var/www && git checkout -q -b deploy #{rev} && git submodule -q init && git submodule -q sync && git submodule -q update", @source.checkout(rev, dest) | |
+ end | |
+ | |
# Tests from base_test.rb, makin' sure we didn't break anything up there! | |
def test_command_should_default_to_default_command | |
assert_equal "git", @source.command | |
diff -urN /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/test/deploy/scm/mercurial_test.rb /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/test/deploy/scm/mercurial_test.rb | |
--- /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/test/deploy/scm/mercurial_test.rb 2009-01-14 11:51:46.000000000 -0800 | |
+++ /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/test/deploy/scm/mercurial_test.rb 2009-08-20 16:23:05.000000000 -0700 | |
@@ -17,6 +17,11 @@ | |
assert_equal "tip", @source.head | |
end | |
+ def test_different_head | |
+ @config[:branch] = "staging" | |
+ assert_equal "staging", @source.head | |
+ end | |
+ | |
def test_checkout | |
@config[:repository] = "http://example.com/project-hg" | |
dest = "/var/www" | |
diff -urN /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/test/ssh_test.rb /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/test/ssh_test.rb | |
--- /Library/Ruby/Gems/1.8/gems/capistrano-2.5.3/test/ssh_test.rb 2009-01-14 11:51:46.000000000 -0800 | |
+++ /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/test/ssh_test.rb 2009-08-20 16:23:05.000000000 -0700 | |
@@ -5,8 +5,10 @@ | |
def setup | |
Capistrano::ServerDefinition.stubs(:default_user).returns("default-user") | |
@options = { :password => nil, | |
- :auth_methods => %w(publickey hostbased) } | |
+ :auth_methods => %w(publickey hostbased), | |
+ :config => false } | |
@server = server("capistrano") | |
+ Net::SSH.stubs(:configuration_for).returns({}) | |
end | |
def test_connect_with_bare_server_without_options_or_config_with_public_key_succeeding_should_only_loop_once | |
@@ -69,8 +71,8 @@ | |
end | |
def test_connect_with_ssh_options_should_use_ssh_options | |
- ssh_options = { :username => "JamisMan", :port => 8125 } | |
- Net::SSH.expects(:start).with(@server.host, "JamisMan", @options.merge(:port => 8125)).returns(success = Object.new) | |
+ ssh_options = { :username => "JamisMan", :port => 8125, :config => false } | |
+ Net::SSH.expects(:start).with(@server.host, "JamisMan", @options.merge(:port => 8125, :config => false)).returns(success = Object.new) | |
assert_equal success, Capistrano::SSH.connect(@server, {:ssh_options => ssh_options}) | |
end | |
@@ -83,7 +85,7 @@ | |
def test_connect_with_ssh_options_should_see_server_options_override_ssh_options | |
ssh_options = { :username => "JamisMan", :port => 8125, :forward_agent => true } | |
server = server("jamis@capistrano:1235") | |
- Net::SSH.expects(:start).with(server.host, "jamis", @options.merge(:port => 1235, :forward_agent => true)).returns(success = Object.new) | |
+ Net::SSH.expects(:start).with(server.host, "jamis", @options.merge(:port => 1235, :forward_agent => true, :config => false)).returns(success = Object.new) | |
assert_equal success, Capistrano::SSH.connect(server, {:ssh_options => ssh_options}) | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment