Class: Bently::HerokuCleardb

Inherits:
RailsRecipe show all
Defined in:
lib/bently/recipe/heroku-cleardb.rb

Constant Summary

Constants inherited from RubyRecipe

RubyRecipe::GEMFILE

Instance Method Summary collapse

Methods inherited from RailsRecipe

#generate, #migrate

Methods inherited from RubyRecipe

#bundle, #gem, #gem_group

Methods inherited from Recipe

#append, breakdown, category, #code, #create, description, homepage, #insert, #modify, #operate, #operations, #prepend, #remove, #requirement, #run, #say, title, #todo, #usage, version, #warn

Constructor Details

#initializeHerokuCleardb

Returns a new instance of HerokuCleardb.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/bently/recipe/heroku-cleardb.rb', line 7

def initialize
  warn 'heroku commands may incur charges to your account'.upcase
  modify 'Gemfile', /gem 'sqlite3'/, ""
  gem 'mysql2'
  bundle

  run 'heroku addons:add cleardb:ignite'

  todo 'Retrieve your database URL by issuing the following command:'
  todo 'heroku config | grep CLEARDB_DATABASE_URL'
  todo 'Copy the value of the CLEARDB_DATABASE_URL config variable to DATABASE_URL (using mysql2:// instead of mysql://):'
  todo "heroku config:add DATABASE_URL='mysql2://...'"
  todo 'Add and commit Gemfile, Gemfile.lock'
  todo 'heroku run rake db:migrate'
end