Skip to content

Commit 8148a4c

Browse files
author
magynhard
committed
update readme and dev dependencies
1 parent 5bb07b1 commit 8148a4c

3 files changed

Lines changed: 20 additions & 12 deletions

File tree

README.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,20 @@ Or install it yourself as:
2222

2323
## Common information
2424

25-
It is possible to build inheritance trees like
25+
It is possible to build inheritance trees like:
2626
```
27-
default.yml english.yml default.yml german.yml de.yml
28-
\ / \ / |
29-
uk.yml de.yml at.yml
27+
defaults.yml
28+
________\_________
29+
\ \ \
30+
dev.yml int.yml prod.yml
31+
```
32+
or like this:
33+
```
34+
default.yml english.yml default.yml german.yml
35+
\ / \ /
36+
uk.yml de.yml
37+
|
38+
at.yml
3039
```
3140

3241
A file can inherit from as many as you want. Trees can be nested as deep as you want.
@@ -71,7 +80,7 @@ data:
7180
When you then call #ext_load_file
7281
7382
```ruby
74-
YAML.ext_load_file 'start.yml'
83+
config = YAML.ext_load_file 'start.yml'
7584
```
7685

7786
the returned YAML value results in
@@ -113,14 +122,13 @@ foo: 'bar'
113122
##### 1. Specify by parameter
114123
You can specify the key by parameter, this is the way to go if you want to use the different key only once or you use the #ext_load_file method only once in your application.
115124
```ruby
116-
YAML.ext_load_file 'custom1.yml', 'inherit_from'
125+
config = YAML.ext_load_file 'custom1.yml', 'inherit_from'
117126
```
118127
##### 2. Global configuration of the key
119128
You can specify the key by configuration globally. So you only need to set the key once and not as parameter anymore
120129
```ruby
121130
YAML.ext_load_key = 'inherit_from'
122-
YAML.ext_load_file 'custom1.yml'
123-
YAML.ext_load_file 'custom2.yml'
131+
config = YAML.ext_load_file 'custom1.yml'
124132
```
125133
##### Reset the global key
126134
To reset the global inheritance key, you can either set it to nil or call the #reset_load_key method.
@@ -139,7 +147,7 @@ foo: 'bar'
139147
```
140148

141149
```ruby
142-
YAML.ext_load_file 'custom2.yml', ['options','extend_file']
150+
config = YAML.ext_load_file 'custom2.yml', ['options','extend_file']
143151
```
144152

145153
## Documentation

lib/yaml_extend/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module YamlExtend
2-
VERSION = '0.2.4'.freeze
2+
VERSION = '0.2.5'.freeze
33
end

yaml_extend.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ Gem::Specification.new do |spec|
3232
spec.add_dependency 'deep_merge', '~> 1.1'
3333

3434
spec.add_development_dependency 'bundler', '>= 1.14'
35-
spec.add_development_dependency 'rake', '~> 10.0'
36-
spec.add_development_dependency 'rspec', '~> 3.0'
35+
spec.add_development_dependency 'rake', '>= 10.0'
36+
spec.add_development_dependency 'rspec', '>= 3.0'
3737
end

0 commit comments

Comments
 (0)