summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authortyler-ball <tyleraball@gmail.com>2018-02-28 15:52:16 -0700
committertyler-ball <tyleraball@gmail.com>2018-02-28 15:55:22 -0700
commit6a9556d26fcdb151cee787327ab8a46556eaa269 (patch)
tree0a7b221637c1dc4579fe7c0b0e6c37cad4d4090e /README.md
parentd44561a9c8449bc898f050de343b7374911a7f5a (diff)
downloadmixlib-config-6a9556d26fcdb151cee787327ab8a46556eaa269.tar.gz
Adding support for reading from TOML files
Signed-off-by: Tyler Ball <tball@chef.io>
Diffstat (limited to 'README.md')
-rw-r--r--README.md11
1 files changed, 9 insertions, 2 deletions
diff --git a/README.md b/README.md
index d6afe57..2deb9d3 100644
--- a/README.md
+++ b/README.md
@@ -43,11 +43,12 @@ And you can modify configuration values with this syntax:
MyConfig[:first_value] = 'foobar' # sets first_value to 'foobar'
```
-If you prefer to allow your users to pass in configuration via YAML or JSON files, `mixlib-config` supports that too!
+If you prefer to allow your users to pass in configuration via YAML, JSON or TOML files, `mixlib-config` supports that too!
```ruby
MyConfig.from_file('~/.myconfig.yml')
MyConfig.from_file('~/.myconfig.json')
+ MyConfig.from_file('~/.myconfig.toml')
```
This way, a user could write a YAML config file that looked like this:
@@ -67,6 +68,13 @@ or a JSON file that looks like this:
}
```
+or a TOML file that looks like this:
+
+```toml
+first_value = "hi"
+second_value = "goodbye"
+```
+
Please note: There is an inherent limitation in the logic you can do with YAML and JSON file. At this time, `mixlib-config` does not support ERB or other logic in YAML or JSON config (read "static content only").
## Nested Configuration
@@ -294,4 +302,3 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-