Created
October 26, 2012 23:37
-
-
Save pierrevalade/3962224 to your computer and use it in GitHub Desktop.
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
# make a new app with foursquare inside | |
run "rm public/index.html" | |
if yes?('do you want to register a new app on Foursquare?') | |
app_name = "generator-app-" + rand(10000).to_s | |
puts "your app's name: #{app_name}" | |
puts "create a new app from: https://foursquare.com/developers/register" | |
puts "Download / welcome page url: http://#{app_name}.herokuapp.com" | |
puts "Callback url: http://#{app_name}.herokuapp.com/clients/foursquare/callback" | |
puts "Push url: https://#{app_name}.herokuapp.com/checkins" | |
end | |
client_id = ask("what is your client_id (https://foursquare.com/oauth) ?") | |
client_secret = ask("what is your client_secret?") | |
add_source 'http://gems.github.com' | |
gem('foursquare_rails_generators') | |
run "bundle install" | |
generate('foursquare:authentication', "client_id:#{client_id} client_secret:#{client_secret}") | |
generate('foursquare:push') | |
if yes?('do you want to push this to Heroku?') | |
app_name ||= "generator-app-" + rand(10000).to_s | |
run "git init ." | |
run "git add ." | |
run "git commit -m 'initial commit'" | |
run "heroku apps:create #{app_name}" | |
run "git push heroku master" | |
run "heroku run rake db:migrate" | |
run "heroku open" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment