Skip to content

Commit

Permalink
Allow component guide to render on Heroku
Browse files Browse the repository at this point in the history
* We don't want the component guide to render in production mode
* Heroku review apps have the production environment set
* Make a special case for including the guide when a HEROKU env
  variable has been set
* This allows us to link users to a PR's component guide or master’s
  • Loading branch information
fofr committed Jul 28, 2017
1 parent 06bd8fe commit 41553c7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -11,6 +11,7 @@ gem 'gds-api-adapters', '~> 43.0'
gem 'govuk_ab_testing', '~> 2.0'
gem 'govuk_elements_rails', '3.0.1'
gem 'govuk_frontend_toolkit', '5.1.0'
gem 'govuk_publishing_components', '~> 0.3.1', require: ENV['RAILS_ENV'] != "production" || ENV['HEROKU_APP_NAME'].to_s.length.positive?
gem 'htmlentities', '4.3.4'
gem 'logstasher', '0.6.1'
gem 'plek', '1.11'
Expand All @@ -29,7 +30,6 @@ gem 'govuk_navigation_helpers', '~> 6.3'

group :development, :test do
gem 'govuk-lint'
gem 'govuk_publishing_components', '~> 0.3.0'
gem 'govuk_schemas'
gem 'jasmine-rails', '~> 0.14.0'
gem 'pry-byebug'
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Expand Up @@ -111,7 +111,7 @@ GEM
sass (>= 3.2.0)
govuk_navigation_helpers (6.3.0)
gds-api-adapters (>= 43.0)
govuk_publishing_components (0.3.0)
govuk_publishing_components (0.3.1)
govspeak (~> 5.0.3)
govuk_frontend_toolkit
rails (~> 5.0.0, >= 5.0.0.1)
Expand Down Expand Up @@ -320,7 +320,7 @@ DEPENDENCIES
govuk_elements_rails (= 3.0.1)
govuk_frontend_toolkit (= 5.1.0)
govuk_navigation_helpers (~> 6.3)
govuk_publishing_components (~> 0.3.0)
govuk_publishing_components (~> 0.3.1)
govuk_schemas
htmlentities (= 4.3.4)
jasmine-rails (~> 0.14.0)
Expand Down
4 changes: 2 additions & 2 deletions config/routes.rb
Expand Up @@ -3,10 +3,10 @@
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
mount JasmineRails::Engine => "/specs" if defined?(JasmineRails)
get 'random/:schema' => 'randomly_generated_content_item#show'

mount GovukPublishingComponents::Engine, at: "/component-guide" if defined?(GovukPublishingComponents)
end

mount GovukPublishingComponents::Engine, at: "/component-guide" if defined?(GovukPublishingComponents)

get 'healthcheck', to: proc { [200, {}, ['']] }
get '*path/:variant' => 'content_items#show',
constraints: {
Expand Down

0 comments on commit 41553c7

Please sign in to comment.