Class: Pah::Templates::CanonicalHost

Inherits:
Pah::Template
  • Object
show all
Defined in:
lib/pah/templates/canonical_host.rb

Instance Method Summary collapse

Methods inherited from Pah::Template

#ask_unless_test, #copy_static_file, #git_commit, #static_files, #will_you_like_to?

Instance Method Details

#callObject



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/pah/templates/canonical_host.rb', line 4

def call
  rack_canonical = <<CANONICAL

#Run heroku config:add CANONICAL_HOST=yourdomain.com
#For more information, see: https://github.com/tylerhunt/rack-canonical-host#usage
use Rack::CanonicalHost, ENV['CANONICAL_HOST'] if ENV['CANONICAL_HOST']
CANONICAL

  inject_into_file 'config.ru', rack_canonical, after: "require_relative 'config/environment'", verbose: false

  git add: 'config.ru'
  git_commit 'Add rack-canonical-host.'
end