tepee 0.0.1 → 0.0.2
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 +4 -4
- data/README.md +13 -3
- data/lib/tepee.rb +1 -1
- data/lib/tepee/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0018ed23223a1b07a30efed76e265fb4aeac18ab
|
4
|
+
data.tar.gz: 3eb5103686c9f87c014bd03e365fc78f25c0aefe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d22023c8b76928aff661d102d2ddfdaee8ef0dc5b12dc3d2da7bceb2e924244eecbd35230ddaf49251dbbfbea67f089ad2444d0c41748884c83fe52267ad138
|
7
|
+
data.tar.gz: 49625ecd98b9773f52874b5a76ec94887aab2393166d747d214010bfc18d5353ea3b5ec6d579a614777ad38bc57c525255dff7d3ce87155db907b38393685c04
|
data/README.md
CHANGED
@@ -10,7 +10,17 @@ This gem aims to make your rails app (or lib, script, ...) by making your enviro
|
|
10
10
|
|
11
11
|
### Setup
|
12
12
|
|
13
|
-
|
13
|
+
#### Gemfile
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
# ...
|
17
|
+
gem 'tepee'
|
18
|
+
# ...
|
19
|
+
```
|
20
|
+
|
21
|
+
#### Code
|
22
|
+
|
23
|
+
Your configuration class must inherit from Tepee.
|
14
24
|
|
15
25
|
```ruby
|
16
26
|
class MyApp::Configuration < Tepee
|
@@ -61,11 +71,11 @@ That value is either:
|
|
61
71
|
```ruby
|
62
72
|
class MyApp::Configuration < Tepee
|
63
73
|
section(:foo) do
|
64
|
-
# Can be
|
74
|
+
# Can be overridden by the FOO_VALUE environment variable.
|
65
75
|
# Accessible via MyApp::Configuration.foo.value
|
66
76
|
add :value, "I'm a foo value"
|
67
77
|
section(:bar) do
|
68
|
-
# Can be
|
78
|
+
# Can be overridden by the FOO_BAR_VALUE environment variable.
|
69
79
|
# Accessible via Appaloosa::Configuration.foo.bar.value
|
70
80
|
add :value, "I'm a bar value"
|
71
81
|
end
|
data/lib/tepee.rb
CHANGED
@@ -10,7 +10,7 @@ class Tepee
|
|
10
10
|
|
11
11
|
protected
|
12
12
|
|
13
|
-
def add(name, default, env_var: "#{env_var_prefix}#{name}")
|
13
|
+
def add(name, default = nil, env_var: "#{env_var_prefix}#{name}")
|
14
14
|
value = ENV[String(env_var).upcase] || default
|
15
15
|
const_set(String(name).upcase, value)
|
16
16
|
define_singleton_method(name) { value }
|
data/lib/tepee/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tepee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexandre Ignjatovic
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2016-06-
|
14
|
+
date: 2016-06-23 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rspec
|