Skip to content

Instantly share code, notes, and snippets.

# A progression of Shoes (shoooes.net) applications, from empty to
# a canvas with drawing and buttons. Used in GetSET program curriculum.
# Note: if you run this file as-is, you'll get tons of open windows -
# I recommend running one Shoes.app block at a time.
# Empty application
Shoes.app do
end
cp ~/.profile ~/.profile.bak
echo 'export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"' > ~/.profile
. ~/.profile
echo 'Creating src directory'
mkdir ~/src
cd ~/src
echo 'Installing Git'
cd ~/src
generate("cucumber")
run("rm -rf features")
git(:clone => "http://github.com/ultrasaurus/workshop-features.git")
inside("features") { run("rm -rf .git") }
rake("db:migrate")
cp ~/.profile ~/.profile.bak
echo 'export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"' > ~/.profile
. ~/.profile
echo 'Creating src directory'
mkdir ~/src
cd ~/src
echo 'Installing Git'
cd ~/src
run("echo group :test, :development do >> Gemfile;")
run("echo gem \\'rspec-rails\\', \\'\\>\\= 2.0.0.beta.22\\' >> Gemfile;")
run("echo gem \\'capybara\\' >> Gemfile;")
run("echo gem \\'database_cleaner\\' >> Gemfile;")
run("echo gem \\'cucumber-rails\\' >> Gemfile;")
run("echo gem \\'cucumber\\' >> Gemfile;")
run("echo gem \\'spork\\' >> Gemfile;")
run("echo gem \\'launchy\\' >> Gemfile;")
run("echo end >> Gemfile;")
run("echo gem \'rake\' >> Gemfile")
run("echo group :test, :development do >> Gemfile")
run("echo gem \'rspec-rails\', \'2.0.0.beta.22\' >> Gemfile")
run("echo gem \'capybara\' >> Gemfile")
run("echo gem \'database_cleaner\' >> Gemfile")
run("echo gem \'cucumber-rails\' >> Gemfile")
run("echo gem \'cucumber\' >> Gemfile")
run("echo gem \'launchy\' >> Gemfile")
run("echo gem \'win32console\' >> Gemfile")
#run("echo gem \'sqlite3-ruby\', :require \=\">\" \'sqlite3\' >> Gemfile")
XVFB=/usr/bin/Xvfb
XVFBARGS=":99 -ac -screen 0 1024x768x16"
PIDFILE=/root/cucumber_xvfb_99.pid
case "$1" in
start)
echo -n "Starting virtual X frame buffer: Xvfb"
/sbin/start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --background --exec $XVFB -- $XVFBARGS
echo "."
;;
stop)
sudo aptitude install xubuntu-desktop
sudo aptitude install exaile
sudo aptitude install gconf2
sudo aptitude install xvfb
sudo aptitude install firefox
Xvfb :99 -ac -screen 0 1024x768x16
namespace :cruise do
desc "Run all specs and features"
task :cruise => :environment do
puts "Starting virtual display..."
`sh -e /etc/init.d/xvfb start`
puts "Starting specs..."
system('export DISPLAY=:99.0 && export SELENIUM_SERVER_PORT=53809 && bundle exec rake')
exit_status = $?.exitstatus
puts "Stopping virtual display..."
`sh -e /etc/init.d/xvfb stop`