Permalink
Browse files

Merge before and after blocks into meet throughout the deps.

  • Loading branch information...
1 parent 34637aa commit 22bba5295d8f8c71f7615939084ea4fc6ea602ba @benhoskings committed Feb 16, 2012
Showing with 3 additions and 7 deletions.
  1. +2 −2 babushka.me.rb
  2. +1 −5 ssl.rb
View
4 babushka.me.rb
@@ -44,8 +44,8 @@ def tarball
met? {
shell "tar -t -f #{tarball}"
}
- before { shell "mkdir -p #{tarball.parent}" }
meet {
+ shell "mkdir -p #{tarball.parent}"
shell "tar -zcv --exclude .git -f '#{tarball}' babushka/", :cd => Babushka::BuildPrefix
}
end
@@ -60,8 +60,8 @@ def db_dump
met? {
db_dump.exists? && (db_dump.mtime + 300 > Time.now) # less than 5 minutes old
}
- before { db_dump_path.mkdir }
meet {
+ db_dump_path.mkdir
shell "pg_dump babushka.me > '#{db_dump}.tmp' && mv '#{db_dump}.tmp' '#{db_dump}'"
}
end
View
6 ssl.rb
@@ -12,13 +12,9 @@ def sudo?
met? {
shell? "fgrep '#{key}' '#{ssh_dir / 'authorized_keys'}'", :sudo => sudo?
}
- before {
- shell "mkdir -p -m 700 '#{ssh_dir}'", :sudo => sudo?
- }
meet {
+ shell "mkdir -p -m 700 '#{ssh_dir}'", :sudo => sudo?
append_to_file key, (ssh_dir / 'authorized_keys'), :sudo => sudo?
- }
- after {
sudo "chown -R #{username}:#{group} '#{ssh_dir}'" unless ssh_dir.owner == username
shell "chmod 600 #{(ssh_dir / 'authorized_keys')}", :sudo => sudo?
}

0 comments on commit 22bba52

Please sign in to comment.