Module: Locomotive

Defined in:
lib/locomotive/heroku.rb,
lib/locomotive/heroku/enabler.rb,
lib/locomotive/heroku/version.rb,
lib/locomotive/heroku/custom_domain.rb,
lib/locomotive/heroku/first_installation.rb

Defined Under Namespace

Modules: Heroku

Class Method Summary collapse

Class Method Details

.enable_herokuObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/locomotive/heroku/enabler.rb', line 3

def self.enable_heroku
  Locomotive.config.domain = 'herokuapp.com' unless Locomotive.config.multi_sites?

  # we can manage domains within Heroku no matter what the value of the multi_sites option is
  Locomotive.config.manage_domains    = true
  Locomotive.config.manage_subdomain  = false unless Locomotive.config.multi_sites?

  # rack_cache: disabled because of Varnish
  Locomotive.config.rack_cache = false

  # hooks
  Locomotive::Site.send :include, Locomotive::Heroku::CustomDomain
  Locomotive::Site.send :include, Locomotive::Heroku::FirstInstallation

  # initialize the API connection
  Locomotive::Heroku.connection

  # load all the domains
  Locomotive::Heroku.domains
end