Permalink
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...
1 parent d8325fb commit 4acea20bebc0e142a410ad21c9538e69398e2937 @leehambley leehambley committed Apr 2, 2013
View
@@ -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
@@ -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
@@ -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'
@@ -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])
@@ -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
@@ -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.
@@ -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
@@ -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
@@ -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
@@ -1,19 +1,19 @@
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
ConnectionError = Class.new(Capistrano::RemoteError)
TransferError = Class.new(Capistrano::RemoteError)
CommandError = Class.new(Capistrano::RemoteError)
-
+
LocalArgumentError = Class.new(Capistrano::Error)
-
+
end
@@ -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."
@@ -18,7 +18,7 @@ def check
yield self
self
end
-
+
def remote
dep = RemoteDependency.new(configuration)
@dependencies << dep
@@ -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)
@@ -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)
@@ -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,15 +109,15 @@ 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
return :date if rev =~ /^\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}$/ # i.e 2007-05-15 08:13:25
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)
@@ -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
@@ -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?
@@ -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) ||
@@ -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
@@ -113,7 +113,7 @@ def p4user
def p4passwd
variable(:p4passwd) || variable(:scm_password)
end
-
+
def p4charset
variable(:p4charset)
end
View
@@ -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
@@ -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!
Oops, something went wrong.

0 comments on commit 4acea20

Please sign in to comment.