dshaw/env — Issue #1: Enumerate appropriate values? Validation rules?
Author: clintandrewhall
Created: 2011-11-28 22:10:09+00:00
State: open

I'm assuming the "1" values in the JSON file are just "truthy" values for now. What would you think of enumerating possible values? Perhaps even validation rules, (though that may be pushing it). For instance:

{
'ENVIRONMENT' : {
'values' : [ 'dev', 'prod', 'test' ]
},
'PORT' : {
'validate' : function(value) {
return value < 9999 && val > 1000;
}
}

I don't think this validating impl "feels" right; it probably belongs in the biz logic, but there's something to be said for having it in the env spec for clarity. You get the idea. Thoughts?