alphagov/plek — pull request #6 by philandstuff (2012-11-26 16:18:50+00:00)
Title: Get domain from GOVUK_APP_DOMAIN environment variable

This is a substantial change.

Plek currently holds a lot of implicit knowledge both about the structure of our URLs and about the number and nature of environments that we have. This causes pain in a few different ways -- for example, if we wanted to add a new environment, we'd have to change Plek to know about it.

This pull request substantially rewrites Plek to create application URLs by learning the domain from the GOVUK_APP_DOMAIN environment variable, which is defined in puppet. As a result, it has become much simpler and requires much less knowledge.

This is a breaking change. If you were previously calling Plek.current.environment, you won't be able to anymore. On the other hand, Plek.current.find('foo') should continue to work as normal. Details about migrating from old Plek to new Plek are detailed in the CHANGELOG.md in this pull request.

As this is such a big change, this pull request should probably remain open for a day or two gathering feedback before being merged.