nevir/groc — pull request #101 by sjorek (2013-08-27 17:05:14+00:00)
Title: Feature: Make path to language definition file configurable

These commits adds a new commandline-switch **--languages**, **but not a project-field (!)**, to override the otherwise hard-coded path to the `groc/lib/languages.coffee` file via command line.

- The commandline's default value `groc/lib/languages` includes the same file as before.
- If groc is included via `require 'groc'` it will always load groc's language definition file.
- If the utils are required via `require 'groc/lib/utils'` the static `Utils.getLanguage` method provides a new parameter
`languageDefinitions` to override the path to the language-defintion file (once). Its default value points to groc's
language definition file.

I use it in a `Cakefile`-task like this:

task 'doc', 'rebuild the documentation', ->
opts = ['--languages', '/absolute/path/to/languages']
child_process.spawn 'groc', opts, stdio: 'inherit', cwd: '.'