Skip to content

Instantly share code, notes, and snippets.

@rickmzp
Created July 20, 2009 19:18
Show Gist options
  • Save rickmzp/150556 to your computer and use it in GitHub Desktop.
Save rickmzp/150556 to your computer and use it in GitHub Desktop.
# Assume the app name is the current dir name
application = File.basename(Dir.pwd)
# Create the repository
run 'rm -rf .git' if File.exists?('.git') && yes?("This folder already has a git repository. Would you like to delete it?")
git :init
# Create the deploy file
file "config/deploy.rb", <<-FILE
set :application, "#{application}"
set :domain, "kyle.idreamofcode.com"
set :deploy_to, "/www/\#{application}"
set :repository, "/"
namespace :vlad do
remote_task :setup do
run "mkdir -p \#{repository} && cd \#{repository} && git init --bare"
`git remote add origin \#{domain}:\#{repository}`
end
end
FILE
# Create the Rakefile
rakefile "vlad.rake" do
<<-FILE
require 'vlad'
begin
Vlad.load
rescue
# do nothing
end
FILE
end
# Create the application haml
file "app/views/layouts/application.html.haml" do
<<-FILE
!!!
%html
%head
= stylesheet_link_tag 'screen.css', :media => 'screen, projection'
= stylesheet_link_tag 'partials/_base.css'
= stylesheet_link_tag 'print.css', :media => 'print'
/[if lt IE 8]
= stylesheet_link_tag 'ie.css', :media => 'screen, projection'
%body
= yield
FILE
end
file "app/views/home/index.html.haml" do
"%h1 Hello, world!"
end
# Clean everything up
run 'rm public/index.html' if File.exists?('public/index.html')
run 'rm -rf public/javascripts/*'
run 'rm -rf public/stylesheets/*'
# Gems !
gem "haml"
gem "binarylogic-authlogic", :source => "http://gems.github.com", :lib => "authlogic"
gem "chriseppstein-compass", :source => "http://gems.github.com", :lib => "compass"
rake 'gems:install', :sudo => true
# Plugins !
plugin 'restful-authentication', :git => 'git://github.com/technoweenie/restful-authentication.git'
# Activate compass
run 'compass --rails -f blueprint --sass-dir app/stylesheets --css-dir public/stylesheets .'
# Create a "home" controller
generate :controller, 'home'
route "map.root :controller => 'home'"
# Set up the DB
rake 'db:migrate'
# Commit to the repository
git :add => '.'
git :commit => '-a -m "Initial Commit"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment