README.md in config_yml-0.0.5 vs README.md in config_yml-0.0.6
- old
+ new
@@ -1,8 +1,12 @@
config_yml
==========
+[![Build Status](https://travis-ci.org/vitork/config_yml.png?branch=master)](https://travis-ci.org/vitork/config_yml)
+[![Code Climate](https://codeclimate.com/github/vitork/config_yml.png)](https://codeclimate.com/github/vitork/config_yml)
+
+
Simplify your app configuration.
Description
-----------
@@ -36,10 +40,13 @@
```
Usage
-----
+Create any yaml file inside config/ directory and it will became a hash accessible
+through the class method with the same name of the file.
+
```yaml
# config/redis.yml
password: foo
host: localhost
port: 6379
@@ -56,13 +63,22 @@
```
You can also use the shorthand:
```ruby
-redis = Conf.redis
+redis = Conf.redis # => { :password => "foo", :host => "localhost", :port => 6379, :database => 1 }
```
+To see all available yaml files:
+
+```ruby
+Configuration.files # => ["config/redis.yml"]
+```
+
+Obs.: File names must match Ruby method name restrictions.
+E.g. don't use config/my-app.yml, use config/my_app.yml instead.
+
#### Environment based:
```yaml
# config/mysql.yml
development:
@@ -109,16 +125,18 @@
- :green
- :blue
```
```ruby
-Configuration.matryoshka[:foo][:bar][:baz] # => { :array => [:red, :green, :blue] }
+Configuration.matryoshka[:foo][:bar][:baz][:array] # => [:red, :green, :blue]
```
Manage yaml files
-----------------
-Avoid maintain .yml files in your repository since they very ofter cointain sensitive information. You can use .yml.sample or .yml.example file instead with fake data.
+Avoid maintain .yml files in your repository since they very ofter cointain
+sensitive information. You can use .yml.sample or .yml.example files with fake
+data instead.
To transform sample files in yaml files, you can use the following task:
```console
$ rake config_yml:generate