Skip to content

Commit

Permalink
Updated more #returning calls to #tap.
Browse files Browse the repository at this point in the history
  • Loading branch information
benhoskings committed Nov 25, 2010
1 parent cd9f303 commit 8b0415b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions postgres.rb
Expand Up @@ -25,13 +25,13 @@
requires 'postgres.managed'
met? { shell "test -x /etc/cron.hourly/postgres_offsite_backup" }
before {
returning sudo("ssh #{var :offsite_host} 'true'") do |result|
sudo("ssh #{var :offsite_host} 'true'").tap {|result|
if result
log_ok "publickey login to #{var :offsite_host}"
else
log_error "You need to add root's public key to #{var :offsite_host}:~/.ssh/authorized_keys."
end
end
}
}
meet {
render_erb 'postgres/offsite_backup.rb.erb', :to => '/usr/local/bin/postgres_offsite_backup', :perms => '755', :sudo => true
Expand Down
4 changes: 2 additions & 2 deletions rails.rb
Expand Up @@ -13,7 +13,7 @@
var(:rails_root) / 'db/migrate/*.rb'
].map {|f| File.basename f }.push('0').sort.last.split('_', 2).first

returning current_version.gsub(/^0+/, '') == latest_version.gsub(/^0+/, '') do |result|
(current_version.gsub(/^0+/, '') == latest_version.gsub(/^0+/, '')).tap {|result|
unless current_version.blank?
if latest_version == '0'
log_verbose "This app doesn't have any migrations yet."
Expand All @@ -23,7 +23,7 @@
log "DB needs migrating from #{current_version} to #{latest_version}"
end
end
end
}
}
meet { bundle_rake "db:migrate --trace" }
end
4 changes: 2 additions & 2 deletions system.rb
Expand Up @@ -27,9 +27,9 @@ def ssh_conf_path file
elsif (auth_methods = output.scan(/Permission denied \((.*)\)\./).join.split(/[^a-z]+/)).empty?
log_error "sshd returned unexpected output."
else
returning auth_methods == %w[publickey] do |result|
(auth_methods == %w[publickey]).tap {|result|
log_verbose "sshd #{'only ' if result}accepts #{auth_methods.to_list} logins.", :as => (result ? :ok : :error)
end
}
end
}
meet {
Expand Down

0 comments on commit 8b0415b

Please sign in to comment.