yahoo / ycb

A multi-dimensional configuration library that builds bundles from resource files describing a variety of values.
BSD 3-Clause "New" or "Revised" License
67 stars 24 forks source link

The current README example is erroneous #47

Closed riddla closed 8 years ago

riddla commented 8 years ago

1

There is a comma missing between this two items:

{
    settings: ["environment:dev"],
    host: "dev.example.com"
}
{
    settings: ["environment:staging,test"],
    host: "stage.example.com"
},

2

After correcting that, the code breaks with ...

            this._dimensionHierarchies[name] = this._calculateHierarchy(DEFAULT_LOOKUP, this.dimensions[pos][name]);
                                                                                                            ^

TypeError: Cannot read property 'device' of undefined
    at Object.Ycb._calculateHierarchies (/Users/rose119/Sites/ycb-webpacked/node_modules/ycb/index.js:591:109)
    at Object.Ycb._processRawBundle (/Users/rose119/Sites/ycb-webpacked/node_modules/ycb/index.js:437:22)
    at Object.Ycb (/Users/rose119/Sites/ycb-webpacked/node_modules/ycb/index.js:76:10)
    at Object.<anonymous> (/Users/rose119/Sites/ycb-webpacked/index.js:41:14)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
    at startup (node.js:139:18)
mridgway commented 8 years ago

Thanks for letting me know. I pushed a change to fix the formatting in the example. Looks like the dimensions format was incorrect (I can never get it right...).

I will publish a patch version to update the npm.org description.