This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Right, now to rewrite this in Ruby :-) | |
<? | |
/* | |
* This example would probably work best if you're using | |
* an MVC framework, but it can be used standalone as well. | |
* | |
* This example also assumes you are using Predis, the excellent | |
* PHP Redis library available here: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sweet bro. | |
%w(rubygems sinatra haml sass dm-core dm-timestamps).each {|gem| require gem} | |
DataMapper.setup(:default, ENV['DATABASE_URL'] || "sqlite3://#{Dir.pwd}/dev.db") | |
DataMapper.auto_upgrade! | |
get '/' do | |
haml :index | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc "Deploy to Heroku" | |
task :deploy_heroku do | |
app = 'myappname' | |
temp_path = "/tmp/heroku-deploys/#{app}" | |
deploy_path = "~/heroku-deploys/#{app}" | |
system "mkdir -p #{temp_path}" | |
system "rm -rf #{temp_path}/*" | |
system "tar -C . -cf - . | tar -C #{temp_path}/ -xpf -" | |
system "cd #{temp_path} && find . -regex '.*git.*' -exec rm -rf {} \\;" |