Permalink
Browse files

Updated #in_dir usages to #cd.

  • Loading branch information...
1 parent ef05513 commit eaeee27dbde8f578beb81537ba5353865ddc1959 @benhoskings committed Apr 3, 2011
Showing with 20 additions and 20 deletions.
  1. +2 −2 bundler.rb
  2. +4 −4 git.rb
  3. +1 −1 homebrew.rb
  4. +2 −2 hudson.rb
  5. +3 −3 mirroring.rb
  6. +2 −2 nginx.rb
  7. +2 −2 packages.rb
  8. +1 −1 rvm.rb
  9. +3 −3 sbt.rb
View
@@ -1,8 +1,8 @@
dep 'app bundled' do
requires 'Gemfile', 'bundler.gem'
requires_when_unmet Dep('current dir:packages')
- met? { in_dir(var(:rails_root)) { shell 'bundle check', :log => true } }
- meet { in_dir(var(:rails_root)) {
+ met? { cd(var(:rails_root)) { shell 'bundle check', :log => true } }
+ meet { cd(var(:rails_root)) {
install_args = var(:rails_env) != 'production' ? '' : "--deployment --without 'development test'"
unless shell("bundle install #{install_args}", :log => true)
confirm("Try a `bundle update`") {
View
8 git.rb
@@ -23,8 +23,8 @@
dep 'web repo always receives' do
requires 'web repo exists'
- met? { in_dir(var(:web_repo_root)) { shell("git config receive.denyCurrentBranch") == 'ignore' } }
- meet { in_dir(var(:web_repo_root)) { shell("git config receive.denyCurrentBranch ignore") } }
+ met? { cd(var(:web_repo_root)) { shell("git config receive.denyCurrentBranch") == 'ignore' } }
+ meet { cd(var(:web_repo_root)) { shell("git config receive.denyCurrentBranch ignore") } }
end
dep 'web repo hooks' do
@@ -36,7 +36,7 @@
}
}
meet {
- in_dir var(:web_repo_root), :create => true do
+ cd var(:web_repo_root), :create => true do
%w[pre-receive post-receive].each {|hook_name|
render_erb "git/deploy-repo-#{hook_name}", :to => ".git/hooks/#{hook_name}"
shell "chmod +x .git/hooks/#{hook_name}"
@@ -50,7 +50,7 @@
define_var :web_repo_root, :default => "~/current"
met? { (var(:web_repo_root) / '.git').dir? }
meet {
- in_dir var(:web_repo_root), :create => true do
+ cd var(:web_repo_root), :create => true do
shell "git init"
end
}
View
@@ -42,7 +42,7 @@ def missing_urls
end
met? { missing_urls.empty? }
meet {
- in_dir var(:homebrew_downloads) do
+ cd var(:homebrew_downloads) do
missing_urls.each {|url|
begin
Babushka::Resource.download url
View
@@ -16,7 +16,7 @@ def path
requires 'tomcat.managed'
met? { (path / 'hudson.war').exists? }
meet {
- in_dir path, :create => true do
+ cd path, :create => true do
shell 'wget http://hudson-ci.org/latest/hudson.war'
end
}
@@ -25,7 +25,7 @@ def path
dep 'cli.hudson' do
met? { (path / 'hudson-cli.jar').exists? }
meet {
- in_dir path, :create => true do
+ cd path, :create => true do
shell 'jar -xf hudson.war WEB-INF/hudson-cli.jar'
shell 'mv WEB-INF/hudson-cli.jar .'
shell 'rmdir WEB-INF'
View
@@ -58,7 +58,7 @@ def missing_avatars
require 'rubygems'
require 'twitter'
client = Twitter::Base.new(Twitter::HTTPAuth.new(var(:twitter_username), var(:twitter_pass)))
- in_dir "~/Desktop/rc7/avatars", :create => true do
+ cd "~/Desktop/rc7/avatars", :create => true do
missing_avatars.each {|name|
begin
url = client.user(name)['profile_image_url'].sub(/_normal(\.[a-zA-Z]+)$/) { $1 }
@@ -103,7 +103,7 @@ def missing_avatars
met? { missing_avatars.empty? }
meet {
require 'digest/md5'
- in_dir "~/Desktop/rc7/gravatars", :create => true do
+ cd "~/Desktop/rc7/gravatars", :create => true do
missing_avatars.each {|email|
Babushka::Archive.download "http://gravatar.com/avatar/#{Digest::MD5.hexdigest(email)}.jpg?s=512&d=404", "#{email}.jpg"
}
@@ -140,7 +140,7 @@ def missing_urls
met? { missing_urls.empty? }
meet {
missing_urls.each {|url|
- in_dir var(:mirror_root) / url.path.p.dirname, :create => true do
+ cd var(:mirror_root) / url.path.p.dirname, :create => true do
Babushka::Archive.download url
end
}
View
@@ -62,7 +62,7 @@ def restart_nginx
requires 'webserver installed.src'
met? { %w[key csr crt].all? {|ext| (nginx_cert_path / "#{var :domain}.#{ext}").exists? } }
meet {
- in_dir nginx_cert_path, :create => "700", :sudo => true do
+ cd nginx_cert_path, :create => "700", :sudo => true do
log_shell("generating private key", "openssl genrsa -out #{var :domain}.key 2048", :sudo => true) and
log_shell("generating certificate", "openssl req -new -key #{var :domain}.key -out #{var :domain}.csr",
:sudo => true, :input => [
@@ -152,7 +152,7 @@ def restart_nginx
}
}
meet {
- in_dir Babushka::GemHelper.gem_path_for('passenger') do
+ cd Babushka::GemHelper.gem_path_for('passenger') do
log_shell "Building passenger", "rake clean nginx", :sudo => Babushka::GemHelper.should_sudo?
end
}
View
@@ -6,7 +6,7 @@
dep 'coreutils.managed', :for => :osx do
provides 'gecho'
after :on => :osx do
- in_dir pkg_manager.bin_path do
+ cd pkg_manager.bin_path do
sudo "ln -s gecho echo"
end
end
@@ -96,7 +96,7 @@
installs { via :macports, 'gsed' }
provides 'sed'
after {
- in_dir '/opt/local/bin' do
+ cd '/opt/local/bin' do
sudo "ln -s gsed sed"
end
}
View
2 rvm.rb
@@ -51,7 +51,7 @@ def missing_urls
met? { missing_urls.empty? }
meet {
missing_urls.each {|url|
- in_dir(var(:rvm_vhost_root) / File.dirname(url.sub(/^[a-z]+:\/\/[^\/]+\//, '')), :create => true) do
+ cd(var(:rvm_vhost_root) / File.dirname(url.sub(/^[a-z]+:\/\/[^\/]+\//, '')), :create => true) do
# begin
Babushka::Resource.download url
# rescue StandardError => ex
View
6 sbt.rb
@@ -3,12 +3,12 @@
merge :versions, :sbt => '0.5.4'
met? { which 'sbt' }
meet {
- in_dir var(:install_path, :default => '/usr/local') do
- in_dir 'lib/sbt', :create => true do
+ cd var(:install_path, :default => '/usr/local') do
+ cd 'lib/sbt', :create => true do
download "http://simple-build-tool.googlecode.com/files/sbt-launcher-#{var(:versions)[:sbt]}.jar"
shell "ln -sf sbt-launcher-#{var(:versions)[:sbt]}.jar sbt-launcher.jar"
end
- in_dir 'bin' do
+ cd 'bin' do
shell %Q{echo '#!/bin/bash\njava -Xmx512M -jar `dirname $0`/../lib/sbt/sbt-launcher.jar "$@"' > sbt}
shell 'chmod +x sbt'
end

0 comments on commit eaeee27

Please sign in to comment.