Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Strip trailing whitespace from all files

(That is [spaceliteraltab] to type a tab on the CLI do Ctrl+v, tab)

    git ls-files | xargs sed -i '' -e 's/[    ]*$//' ]'
  • Loading branch information...
commit 4acea20bebc0e142a410ad21c9538e69398e2937 1 parent d8325fb
@leehambley leehambley authored
Showing with 89 additions and 89 deletions.
  1. +1 −1  Gemfile
  2. +1 −1  capistrano.gemspec
  3. +1 −1  lib/capistrano/cli.rb
  4. +3 −3 lib/capistrano/cli/execute.rb
  5. +3 −3 lib/capistrano/cli/help.rb
  6. +2 −2 lib/capistrano/configuration/execution.rb
  7. +2 −2 lib/capistrano/configuration/loading.rb
  8. +1 −1  lib/capistrano/configuration/roles.rb
  9. +6 −6 lib/capistrano/configuration/servers.rb
  10. +4 −4 lib/capistrano/errors.rb
  11. +1 −1  lib/capistrano/ext/multistage.rb
  12. +1 −1  lib/capistrano/recipes/deploy/dependencies.rb
  13. +11 −11 lib/capistrano/recipes/deploy/remote_dependency.rb
  14. +6 −6 lib/capistrano/recipes/deploy/scm/accurev.rb
  15. +4 −4 lib/capistrano/recipes/deploy/scm/cvs.rb
  16. +3 −3 lib/capistrano/recipes/deploy/scm/darcs.rb
  17. +1 −1  lib/capistrano/recipes/deploy/scm/git.rb
  18. +3 −3 lib/capistrano/recipes/deploy/scm/mercurial.rb
  19. +4 −4 lib/capistrano/recipes/deploy/scm/none.rb
  20. +1 −1  lib/capistrano/recipes/deploy/scm/perforce.rb
  21. +1 −1  lib/capistrano/ssh.rb
  22. +1 −1  test/cli/options_test.rb
  23. +1 −1  test/configuration/callbacks_test.rb
  24. +6 −6 test/configuration/namespace_dsl_test.rb
  25. +2 −2 test/configuration/roles_test.rb
  26. +3 −3 test/configuration/servers_test.rb
  27. +2 −2 test/configuration/variables_test.rb
  28. +1 −1  test/deploy/scm/bzr_test.rb
  29. +2 −2 test/deploy/scm/darcs_test.rb
  30. +3 −3 test/deploy/scm/mercurial_test.rb
  31. +2 −2 test/server_definition_test.rb
  32. +6 −6 test/shell_test.rb
View
2  Gemfile
@@ -4,7 +4,7 @@ source "http://rubygems.org"
gemspec
#
-# Development Dependencies from the Gemfile
+# Development Dependencies from the Gemfile
# are merged here.
#
group :development do
View
2  capistrano.gemspec
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
]
s.specification_version = 3 if s.respond_to? :specification_version
-
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<highline>, [">= 0"])
s.add_runtime_dependency(%q<net-ssh>, [">= 2.0.14"])
View
2  lib/capistrano/cli.rb
@@ -20,7 +20,7 @@ class CLI
# Capistrano::CLI.parse(%W(-vvvv -f config/deploy update_code)).execute!
#
# Note that you can also embed cap directly by creating a new Configuration
- # instance and setting it up, The above snippet, redone using the
+ # instance and setting it up, The above snippet, redone using the
# Configuration class directly, would look like:
#
# require 'capistrano'
View
6 lib/capistrano/cli/execute.rb
@@ -55,10 +55,10 @@ def set_pre_vars(config) #:nodoc:
def load_recipes(config) #:nodoc:
# load the standard recipe definition
config.load "standard"
-
+
# load systemwide config/recipe definition
- config.load(options[:sysconf]) if options[:sysconf] && File.file?(options[:sysconf])
-
+ config.load(options[:sysconf]) if options[:sysconf] && File.file?(options[:sysconf])
+
# load user config/recipe definition
config.load(options[:dotfile]) if options[:dotfile] && File.file?(options[:dotfile])
View
6 lib/capistrano/cli/help.rb
@@ -111,14 +111,14 @@ def format_text(text) #:nodoc:
end
def output_columns #:nodoc:
- if ( @output_columns.nil? )
+ if ( @output_columns.nil? )
if ( self.class.ui.output_cols.nil? )
- @output_columns = 80
+ @output_columns = 80
else
@output_columns = self.class.ui.output_cols
end
end
- @output_columns
+ @output_columns
end
end
end
View
4 lib/capistrano/configuration/execution.rb
@@ -27,8 +27,8 @@ def transaction?
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.
View
4 lib/capistrano/configuration/loading.rb
@@ -141,9 +141,9 @@ def require(*args) #:nodoc:
# look to see if this specific configuration instance has ever seen
# these arguments to require before
if @loaded_features.include?(args)
- return false
+ return false
end
-
+
@loaded_features << args
begin
original_instance, self.class.instance = self.class.instance, self
View
2  lib/capistrano/configuration/roles.rb
@@ -68,7 +68,7 @@ def server(host, *roles)
raise ArgumentError, "you must associate a server with at least one role" if roles.empty?
roles.each { |name| role(name, host, options) }
end
-
+
def role_names_for_host(host)
roles.map {|role_name, role| role_name if role.include?(host) }.compact || []
end
View
12 lib/capistrano/configuration/servers.rb
@@ -13,8 +13,8 @@ def find_servers_for_task(task, options={})
# The options hash may include a :hosts option (which should specify
# an array of host names or ServerDefinition instances), a :roles
# option (specifying an array of roles), an :only option (specifying
- # a hash of key/value pairs that any matching server must match),
- # an :exception option (like :only, but the inverse), and a
+ # a hash of key/value pairs that any matching server must match),
+ # an :exception option (like :only, but the inverse), and a
# :skip_hostfilter option to ignore the HOSTFILTER environment variable
# described below.
#
@@ -27,7 +27,7 @@ def find_servers_for_task(task, options={})
# will limit the result to hosts found in that (comma-separated) list.
#
# If the HOSTROLEFILTER environment variable is set, it will limit the
- # result to hosts found in that (comma-separated) list of roles
+ # result to hosts found in that (comma-separated) list of roles
#
# Usage:
#
@@ -44,9 +44,9 @@ def find_servers_for_task(task, options={})
def find_servers(options={})
return [] if options.key?(:hosts) && (options[:hosts].nil? || [] == options[:hosts])
return [] if options.key?(:roles) && (options[:roles].nil? || [] == options[:roles])
-
+
hosts = server_list_from(ENV['HOSTS'] || options[:hosts])
-
+
if hosts.any?
if options[:skip_hostfilter]
hosts.uniq
@@ -59,7 +59,7 @@ def find_servers(options={})
only = options[:only] || {}
except = options[:except] || {}
-
+
# If we don't have a def for a role it means its bogus, skip it so higher level can handle
servers = roles.inject([]) { |list, role| list.concat(self.roles[role] || []) }
servers = servers.select { |server| only.all? { |key,value| server.options[key] == value } }
View
8 lib/capistrano/errors.rb
@@ -1,11 +1,11 @@
module Capistrano
-
+
Error = Class.new(RuntimeError)
CaptureError = Class.new(Capistrano::Error)
NoSuchTaskError = Class.new(Capistrano::Error)
NoMatchingServersError = Class.new(Capistrano::Error)
-
+
class RemoteError < Error
attr_accessor :hosts
end
@@ -13,7 +13,7 @@ class RemoteError < Error
ConnectionError = Class.new(Capistrano::RemoteError)
TransferError = Class.new(Capistrano::RemoteError)
CommandError = Class.new(Capistrano::RemoteError)
-
+
LocalArgumentError = Class.new(Capistrano::Error)
-
+
end
View
2  lib/capistrano/ext/multistage.rb
@@ -39,7 +39,7 @@
else
abort "No stage specified. Please specify one of: #{stages.join(', ')} (e.g. `cap #{stages.first} #{ARGV.last}')"
end
- end
+ end
end
desc "Stub out the staging config files."
View
2  lib/capistrano/recipes/deploy/dependencies.rb
@@ -18,7 +18,7 @@ def check
yield self
self
end
-
+
def remote
dep = RemoteDependency.new(configuration)
@dependencies << dep
View
22 lib/capistrano/recipes/deploy/remote_dependency.rb
@@ -58,31 +58,31 @@ def rpm(name, version, options={})
def match(command, expect, options={})
expect = Regexp.new(Regexp.escape(expect.to_s)) unless expect.is_a?(Regexp)
- output_per_server = {}
- try("#{command} ", options) do |ch, stream, out|
- output_per_server[ch[:server]] ||= ''
- output_per_server[ch[:server]] += out
- end
+ output_per_server = {}
+ try("#{command} ", options) do |ch, stream, out|
+ output_per_server[ch[:server]] ||= ''
+ output_per_server[ch[:server]] += out
+ end
# It is possible for some of these commands to return a status != 0
# (for example, rake --version exits with a 1). For this check we
# just care if the output matches, so we reset the success flag.
@success = true
- errored_hosts = []
- output_per_server.each_pair do |server, output|
+ errored_hosts = []
+ output_per_server.each_pair do |server, output|
next if output =~ expect
- errored_hosts << server
- end
+ errored_hosts << server
+ end
if errored_hosts.any?
@hosts = errored_hosts.join(', ')
output = output_per_server[errored_hosts.first]
@message = "the output #{output.inspect} from #{command.inspect} did not match #{expect.inspect}"
@success = false
- end
+ end
- self
+ self
end
def or(message)
View
12 lib/capistrano/recipes/deploy/scm/accurev.rb
@@ -14,9 +14,9 @@ module SCM
# * :repository - This should match the depot that code lives in. If your code
# exists in a subdirectory, you can append the path depot.
# eg. foo-depot/bar_dir
- # * :stream - The stream in the depot that code should be pulled from. If
+ # * :stream - The stream in the depot that code should be pulled from. If
# left blank, the depot stream will be used
- # * :revision - Should be in the form 'stream/transaction'.
+ # * :revision - Should be in the form 'stream/transaction'.
class Accurev < Base
include REXML
default_command 'accurev'
@@ -54,10 +54,10 @@ def query_revision(revision)
end
end
- # Pops a copy of the code for the specified Accurev revision identifier.
+ # Pops a copy of the code for the specified Accurev revision identifier.
# The revision identifier is represented as a stream & transaction ID combo.
# Accurev can only pop a particular transaction if a stream is created on the server
- # with a time basis of that transaction id. Therefore, we will create a stream with
+ # with a time basis of that transaction id. Therefore, we will create a stream with
# the required criteria and pop that.
def export(revision_id, destination)
revision = InternalRevision.parse(revision_id)
@@ -89,7 +89,7 @@ def log(from, to=head)
].join(' | ')
end
- # Returns the command needed to show the diff between what is deployed and what is
+ # Returns the command needed to show the diff between what is deployed and what is
# pending. Because Accurev can not do this task without creating some streams,
# two time basis streams will be created for the purposes of doing the diff.
def diff(from, to=head)
@@ -156,7 +156,7 @@ def psuedo_revision?
end
def to_s
- "#{stream}/#{transaction_id}"
+ "#{stream}/#{transaction_id}"
end
def ==(other)
View
8 lib/capistrano/recipes/deploy/scm/cvs.rb
@@ -63,7 +63,7 @@ def log(from, to=nil)
scm cvs_root, :log, range_arg
end
- # Unfortunately, cvs doesn't support the concept of a revision number like
+ # Unfortunately, cvs doesn't support the concept of a revision number like
# subversion and other SCM's do. For now, we'll rely on getting the timestamp
# of the latest checkin under the revision that's passed to us.
def query_revision(revision)
@@ -99,7 +99,7 @@ def cvs_root
root << "-d #{repository} " if repository
root
end
-
+
# Constructs the destination dir command-line option
def cvs_destination(destination)
dest = ""
@@ -109,7 +109,7 @@ def cvs_destination(destination)
end
dest
end
-
+
# attempts to guess what type of revision we're working with
def revision_type(rev)
return :date if rev =~ /^\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2} UTC$/ # i.e 2007-05-15 08:13:25 UTC
@@ -117,7 +117,7 @@ def revision_type(rev)
return :revision if rev =~ /^\d/ # i.e. 1.2.1
return :tag # i.e. RELEASE_1_2
end
-
+
# constructs the appropriate command-line switch for specifying a
# "revision" in CVS. This could be a tag, branch, revision (i.e. 1.3)
# or a date (to be used with -d)
View
6 lib/capistrano/recipes/deploy/scm/darcs.rb
@@ -25,13 +25,13 @@ def to_match(revision)
"--to-match='hash #{revision}'"
end
end
-
+
# Returns the command that will check out the given revision to the
# given destination. The 'revision' parameter must be the 'hash' value
# for the revision in question, as given by 'darcs changes --xml-output'.
def checkout(revision, destination)
- scm :get, *[verbose,
- "--repo-name=#{destination}",
+ scm :get, *[verbose,
+ "--repo-name=#{destination}",
to_match(revision),
repository].compact
end
View
2  lib/capistrano/recipes/deploy/scm/git.rb
@@ -133,7 +133,7 @@ def checkout(revision, destination)
git = command
remote = origin
- args = []
+ args = []
# Add an option for the branch name so :git_shallow_clone works with branches
args << "-b #{variable(:branch)}" unless variable(:branch).nil?
View
6 lib/capistrano/recipes/deploy/scm/mercurial.rb
@@ -89,11 +89,11 @@ def handle_data(state, stream, text)
"yes\n"
end
end
-
+
private
# Fine grained mercurial commands
- def clone(destination)
+ def clone(destination)
scm :clone,
verbose,
"--noupdate", # do not update to tip when cloning is done
@@ -124,7 +124,7 @@ def verbose
else "--verbose"
end
end
-
+
# honor Cap 2.1+'s :scm_prefer_prompt if present
def scm_password_or_prompt
@scm_password_or_prompt ||= variable(:scm_password) ||
View
8 lib/capistrano/recipes/deploy/scm/none.rb
@@ -19,7 +19,7 @@ module SCM
# set :scm, :none
# set :deploy_via, :copy
#
- # Dereference symbolic links. Copy files instead. Handy when you
+ # Dereference symbolic links. Copy files instead. Handy when you
# reference files and directory outside of your deployment root.
# set :copy_dereference_symlink, true
@@ -41,13 +41,13 @@ def checkout(revision, destination)
def query_revision(revision)
revision
end
-
+
# log: There's no log, so it just echos from and to.
-
+
def log(from="", to="")
"No SCM: #{from} - #{to}"
end
-
+
end
end
View
2  lib/capistrano/recipes/deploy/scm/perforce.rb
@@ -113,7 +113,7 @@ def p4user
def p4passwd
variable(:p4passwd) || variable(:scm_password)
end
-
+
def p4charset
variable(:p4charset)
end
View
2  lib/capistrano/ssh.rb
@@ -70,7 +70,7 @@ def self.connection_strategy(server, options={}, &block)
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)
+ host = ssh_options.fetch(:host_name, server.host)
ssh_options[:port] = port if port
View
2  test/cli/options_test.rb
@@ -23,7 +23,7 @@ def test_parse_options_should_require_non_empty_args_list
@cli.expects(:exit).raises(ExitException)
assert_raises(ExitException) { @cli.parse_options! }
end
-
+
def test_parse_options_with_d_should_set_debug_option
@cli.args << "-d"
@cli.parse_options!
View
2  test/configuration/callbacks_test.rb
@@ -126,7 +126,7 @@ def test_on_with_except_and_block_should_set_except_as_string_array
assert_equal 1, @config.callbacks[:before].length
assert_equal %w(primary), @config.callbacks[:before].first.except
end
-
+
def test_on_without_tasks_or_block_should_raise_error
assert_raises(ArgumentError) { @config.on(:before) }
end
View
12 test/configuration/namespace_dsl_test.rb
@@ -146,7 +146,7 @@ def test_fqn_for_namespace_should_be_the_name_of_the_namespace
def test_parent_for_namespace_should_be_the_top_level
@config.namespace(:outer) {}
- assert_equal @config, @config.namespaces[:outer].parent
+ assert_equal @config, @config.namespaces[:outer].parent
end
def test_fqn_for_nested_namespace_should_be_color_delimited
@@ -238,7 +238,7 @@ def test_namespace_should_respond_to_its_parents_methods
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]
@@ -308,16 +308,16 @@ def test_find_task_should_return_nil_when_empty_inner_task
end
assert_nil @config.find_task("outer::inner")
end
-
+
def test_kernel_method_clashing_should_not_affect_method_delegation_to_parent
@config.class.class_eval do
def some_weird_method() 'config' end
end
-
+
@config.namespace(:clash) {}
namespace = @config.namespaces[:clash]
assert_equal 'config', namespace.some_weird_method
-
+
Kernel.module_eval do
def some_weird_method() 'kernel' end
end
@@ -325,7 +325,7 @@ def some_weird_method() 'kernel' end
@config.namespace(:clash2) {}
namespace = @config.namespaces[:clash2]
assert_equal 'config', namespace.some_weird_method
-
+
Kernel.send :remove_method, :some_weird_method
@config.class.send :remove_method, :some_weird_method
end
View
4 test/configuration/roles_test.rb
@@ -21,14 +21,14 @@ def test_initialize_should_initialize_roles_collection
assert @config.original_initialize_called
assert @config.roles.empty?
end
-
+
def test_roles_for_host_with_one_role
@config.role :app, "app1.capistrano.test"
@config.role :not_app, "not-app.capistrano.test"
app_server = @config.roles[:app].servers.first
assert @config.role_names_for_host(app_server)==[ :app ]
end
-
+
def test_roles_for_host_with_multiple_roles
@config.server "www.capistrano.test", :db, :worker
db_server = @config.roles[:db].servers.first
View
6 test/configuration/servers_test.rb
@@ -163,7 +163,7 @@ def test_find_servers_with_lambda_for_roles_should_be_evaluated
assert_equal %w(app1 app2 app3), @config.find_servers(:roles => lambda { :app }).map { |s| s.host }.sort
assert_equal %w(app2 file), @config.find_servers(:roles => lambda { [:report, :file] }).map { |s| s.host }.sort
end
-
+
def test_find_servers_with_hosts_nil_or_empty
assert_equal [], @config.find_servers(:hosts => nil)
assert_equal [], @config.find_servers(:hosts => [])
@@ -172,12 +172,12 @@ def test_find_servers_with_hosts_nil_or_empty
result = @config.find_servers(:hosts => "app1")
assert_equal 1, result.size
end
-
+
def test_find_servers_with_rolees_nil_or_empty
assert_equal [], @config.find_servers(:roles => nil)
assert_equal [], @config.find_servers(:roles => [])
result = @config.find_servers(:roles => :report)
assert_equal 1, result.size
end
-
+
end
View
4 test/configuration/variables_test.rb
@@ -53,13 +53,13 @@ def test_respond_to_should_look_for_variables
@config[:sample] = :value
assert @config.respond_to?(:sample)
end
-
+
def test_respond_to_should_be_true_when_passed_a_string
assert !@config.respond_to?('sample')
@config[:sample] = :value
assert @config.respond_to?('sample')
end
-
+
def test_respond_to_with_include_priv_paramter
assert !@config.respond_to?(:sample, true)
end
View
2  test/deploy/scm/bzr_test.rb
@@ -41,7 +41,7 @@ def test_query_revision
'before:revid:aaaa@bbbb-1234567890',
'last:3',
nil, {}, [], true, false, 1.34, ]
-
+
revision_samples.each do |revivsion_spec|
assert_equal(revivsion_spec,
@source.query_revision(revivsion_spec),
View
4 test/deploy/scm/darcs_test.rb
@@ -15,7 +15,7 @@ def setup
# We should be able to pick a specific hash.
def test_checkout_hash
hsh = "*version_hash*"
- assert_match(%r{--to-match=.hash #{Regexp.quote(hsh)}},
+ assert_match(%r{--to-match=.hash #{Regexp.quote(hsh)}},
@source.checkout(hsh, "*foo_location*"),
"Specifying a revision hash got the --to-match option wrong.")
end
@@ -31,7 +31,7 @@ def test_checkout_head
# Leaving the revision as nil shouldn't break anything.
def test_checkout_nil
assert_no_match(%r{--to-match}, @source.checkout(nil, "*foo_location*"),
- "Leaving the revision as nil incorrectly produced a --to-match option.")
+ "Leaving the revision as nil incorrectly produced a --to-match option.")
end
end
View
6 test/deploy/scm/mercurial_test.rb
@@ -62,19 +62,19 @@ def test_sync
@config[:scm_command] = "/opt/local/bin/hg"
assert_equal "/opt/local/bin/hg pull --repository /var/www && /opt/local/bin/hg update --repository /var/www --clean 8a8e00b8f11b", @source.sync('8a8e00b8f11b', dest)
end
-
+
def test_export
dest = "/var/www"
assert_raise(NotImplementedError) { @source.export('8a8e00b8f11b', dest) }
end
-
+
def test_sends_password_if_set
require 'capistrano/logger'
text = "password:"
@config[:scm_password] = "opensesame"
assert_equal "opensesame\n", @source.handle_data(mock_state, :test_stream, text)
end
-
+
def test_prompts_for_password_if_preferred
require 'capistrano/logger'
require 'capistrano/cli'
View
4 test/server_definition_test.rb
@@ -62,11 +62,11 @@ def test_new_with_options_should_keep_options
server = Capistrano::ServerDefinition.new("www.capistrano.test", :primary => true)
assert_equal true, server.options[:primary]
end
-
+
def test_default_user_should_try_to_guess_username
ENV.stubs(:[]).returns(nil)
assert_equal "not-specified", Capistrano::ServerDefinition.default_user
-
+
ENV.stubs(:[]).returns(nil)
ENV.stubs(:[]).with("USERNAME").returns("ryan")
assert_equal "ryan", Capistrano::ServerDefinition.default_user
View
12 test/shell_test.rb
@@ -67,7 +67,7 @@ def test_text_with_on_gets_processed_with_on
@shell.expects(:process_command).with("on", "app,db", "hello world")
assert @shell.read_and_execute
end
-
+
def test_task_command_with_bang_gets_processed_by_exec_tasks
while_testing_post_exec_commands do
@shell.expects(:read_line).returns("!deploy")
@@ -75,7 +75,7 @@ def test_task_command_with_bang_gets_processed_by_exec_tasks
assert @shell.read_and_execute
end
end
-
+
def test_normal_command_gets_processed_by_exec_command
while_testing_post_exec_commands do
@shell.expects(:read_line).returns("uptime")
@@ -84,13 +84,13 @@ def test_normal_command_gets_processed_by_exec_command
assert @shell.read_and_execute
end
end
-
-
+
+
private
-
+
def while_testing_post_exec_commands(&block)
@shell.instance_variable_set(:@mutex,Mutex.new)
yield
end
-
+
end
Please sign in to comment.
Something went wrong with that request. Please try again.