configatron 2.10.0 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.rvmrc +1 -1
- data/.travis.yml +0 -2
- data/README.md +10 -9
- data/lib/configatron/store.rb +8 -0
- data/lib/configatron/version.rb +1 -1
- metadata +9 -19
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 04b9056694b0e769316768fd1c635c150c0193ed
|
4
|
+
data.tar.gz: bc9506af875b3ad87c9f76c5ddc7bbc32c4086f5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 49bbd0375bd4f9c2fa2eae9568493e6c85a37a1d7a56ee9296d6c40c00961c20f03a57187d5b0bc4257de4143d53f5e92abae6c911688f829213ecef52389686
|
7
|
+
data.tar.gz: 00912c56e963c7f869c756a40669e96280dc4bed428eaa76d3eadc82e0e54ab3bb72ed07e3ff7bb393d094c53c6ac35c2fd73fb81e64faffd499a6f00f6a3f25
|
data/.rvmrc
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
# rvm use ruby-2.0.0-preview1
|
2
|
-
rvm use
|
2
|
+
rvm use 2.0.0
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -60,7 +60,7 @@ Notice how our other configuration parameters haven't changed? Cool, eh?
|
|
60
60
|
You can configure configatron from a hash as well (this is really only useful in testing or for data driven configurat, it's not recommended for actual configuration):
|
61
61
|
|
62
62
|
```ruby
|
63
|
-
configatron.configure_from_hash({:email => {:pop => {:address => 'pop.example.com', :port => 110}}, :smtp => {:address => 'smtp.example.com'}})####
|
63
|
+
configatron.configure_from_hash({:email => {:pop => {:address => 'pop.example.com', :port => 110}}, :smtp => {:address => 'smtp.example.com'}})####
|
64
64
|
configatron.email.pop.address # => 'pop.example.com'
|
65
65
|
configatron.email.pop.port # => 110
|
66
66
|
# and so on...
|
@@ -95,7 +95,7 @@ Of course you can update a single parameter n levels deep as well:
|
|
95
95
|
|
96
96
|
```ruby
|
97
97
|
configatron.email.pop.address = "pop2.example.com"
|
98
|
-
|
98
|
+
|
99
99
|
configatron.email.pop.address # => "pop2.example.com"
|
100
100
|
configatron.email.smtp.address # => "smtp.example.com"
|
101
101
|
```
|
@@ -160,11 +160,11 @@ There are times when you want to refer to one configuration setting in another c
|
|
160
160
|
end
|
161
161
|
```
|
162
162
|
|
163
|
-
Now, we could've written that slightly differently, but it helps to illustrate the point. With Configatron you can create `Delayed` and `Dynamic` settings.
|
163
|
+
Now, we could've written that slightly differently, but it helps to illustrate the point. With Configatron you can create `Delayed` and `Dynamic` settings.
|
164
164
|
|
165
165
|
#### Delayed
|
166
166
|
|
167
|
-
With `Delayed` settings execution of the setting doesn't happen until the first time it is executed.
|
167
|
+
With `Delayed` settings execution of the setting doesn't happen until the first time it is executed.
|
168
168
|
|
169
169
|
```ruby
|
170
170
|
configatron.memcached.servers = ['127.0.0.1:11211']
|
@@ -225,17 +225,18 @@ Enjoy!
|
|
225
225
|
* Rob Sanheim
|
226
226
|
* Cody Maggard
|
227
227
|
* Jean-Denis Vauguet
|
228
|
-
* Torsten Schönebaum
|
229
|
-
* Mat Brown
|
230
|
-
* Simon Menke
|
231
228
|
* chatgris
|
229
|
+
* Mat Brown
|
232
230
|
* Gleb Pomykalov
|
231
|
+
* Torsten Schönebaum
|
232
|
+
* Simon Menke
|
233
233
|
* Casper Gripenberg
|
234
234
|
* mattelacchiato
|
235
235
|
* Artiom Diomin
|
236
|
-
* Tim Riley
|
237
236
|
* Rick Fletcher
|
237
|
+
* Tim Riley
|
238
238
|
* joe miller
|
239
|
-
* Brandon Dimcheff
|
240
239
|
* Dan Pickett
|
240
|
+
* Brandon Dimcheff
|
241
|
+
* Greg Brockman
|
241
242
|
* Josh Nichols
|
data/lib/configatron/store.rb
CHANGED
@@ -17,6 +17,14 @@ class Configatron
|
|
17
17
|
@_locked = false
|
18
18
|
end
|
19
19
|
|
20
|
+
def [](key)
|
21
|
+
method_missing(key.to_sym)
|
22
|
+
end
|
23
|
+
|
24
|
+
def []=(key, value)
|
25
|
+
method_missing(:"#{key}=", value)
|
26
|
+
end
|
27
|
+
|
20
28
|
# Returns a Hash representing the configurations
|
21
29
|
def to_hash
|
22
30
|
h = Hash.new
|
data/lib/configatron/version.rb
CHANGED
metadata
CHANGED
@@ -1,30 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: configatron
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
5
|
-
prerelease:
|
4
|
+
version: 2.11.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Mark Bates
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-06-19 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: yamler
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 0.1.0
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 0.1.0
|
30
27
|
description: A powerful Ruby configuration system.
|
@@ -73,33 +70,26 @@ files:
|
|
73
70
|
- spec/support/rails.rb
|
74
71
|
homepage: http://www.metabates.com
|
75
72
|
licenses: []
|
73
|
+
metadata: {}
|
76
74
|
post_install_message:
|
77
75
|
rdoc_options: []
|
78
76
|
require_paths:
|
79
77
|
- lib
|
80
78
|
required_ruby_version: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
79
|
requirements:
|
83
|
-
- -
|
80
|
+
- - '>='
|
84
81
|
- !ruby/object:Gem::Version
|
85
82
|
version: '0'
|
86
|
-
segments:
|
87
|
-
- 0
|
88
|
-
hash: 1910409013164072675
|
89
83
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
|
-
none: false
|
91
84
|
requirements:
|
92
|
-
- -
|
85
|
+
- - '>='
|
93
86
|
- !ruby/object:Gem::Version
|
94
87
|
version: '0'
|
95
|
-
segments:
|
96
|
-
- 0
|
97
|
-
hash: 1910409013164072675
|
98
88
|
requirements: []
|
99
89
|
rubyforge_project:
|
100
|
-
rubygems_version:
|
90
|
+
rubygems_version: 2.0.3
|
101
91
|
signing_key:
|
102
|
-
specification_version:
|
92
|
+
specification_version: 4
|
103
93
|
summary: A powerful Ruby configuration system.
|
104
94
|
test_files:
|
105
95
|
- spec/configatron/proc_spec.rb
|