Sha256: a20968acf6f13e7e0ba5cc5d75b915e4f4ffc161f8583b04cdc49dd50ba71dac

Contents?: true

Size: 533 Bytes

Versions: 13

Compression:

Stored size: 533 Bytes

Contents

# frozen_string_literal: true

say_git "Install rack-canonical-host"
install_gem "rack-canonical-host"

say_git "Use RAILS_HOSTNAME env var"
document_deploy_var "RAILS_HOSTNAME", "Redirect all requests to the specified canonical hostname"
insert_into_file "config.ru",
  %(use Rack::CanonicalHost, ENV.fetch("RAILS_HOSTNAME", nil) if ENV["RAILS_HOSTNAME"].present?\n),
  before: /^run Rails.application/

gsub_file "config/environments/production.rb",
  /\bhost: "example\.com"/,
  'host: ENV.fetch("RAILS_HOSTNAME", "example.com")'

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
nextgen-0.31.0 lib/nextgen/generators/rack_canonical_host.rb
nextgen-0.30.0 lib/nextgen/generators/rack_canonical_host.rb
nextgen-0.29.0 lib/nextgen/generators/rack_canonical_host.rb
nextgen-0.28.2 lib/nextgen/generators/rack_canonical_host.rb
nextgen-0.28.1 lib/nextgen/generators/rack_canonical_host.rb
nextgen-0.28.0 lib/nextgen/generators/rack_canonical_host.rb
nextgen-0.27.1 lib/nextgen/generators/rack_canonical_host.rb
nextgen-0.27.0 lib/nextgen/generators/rack_canonical_host.rb
nextgen-0.26.0 lib/nextgen/generators/rack_canonical_host.rb
nextgen-0.25.0 lib/nextgen/generators/rack_canonical_host.rb
nextgen-0.24.0 lib/nextgen/generators/rack_canonical_host.rb
nextgen-0.23.0 lib/nextgen/generators/rack_canonical_host.rb
nextgen-0.22.0 lib/nextgen/generators/rack_canonical_host.rb