phase2/grunt-drupal-tasks — pull request #41 by grayside (2014-11-10 05:17:52+00:00)
Title: Environment-injected Base URL [WIP; NO MERGE]

Submitting this early for concept review. This PR fixes #32.

This PR renames the configuration key `siteUrls.default` to `siteUrls.baseUrl` to be more in-line with the Drupal terminology. It preserves backwards compatibility with the origin name, deferring to the new baseUrl handling mechanism.

While baseUrl can be set via Gruntconfig.json, this is overridden in the presence of an environment-injected DRUPAL_GRUNT_BASEURL variable. This allows the project to ship with a primary CI value, but other environments can easily override.

Demonstrating a bit more of a use case, it also allows for a siteUrls.paths parameter to be set, and if present will be combined with the Base URL to form a series of absolute URLs. The intention is that this array of URLs can be leveraged easily by testing tasks. I especially have in mind the notion of performance and visual regression tests being run against the list of paths.

```js
{
siteUrls: {
baseUrl: "http://example.com/drupal",
paths: [
"/",
"/about",
"/node/1/edit"
]
}
}
```
This work is completely untested, but wanted to confirm we like this approach before carrying the concept forward.