cconfig 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/cconfig/hash_utils.rb +6 -0
- data/lib/cconfig/version.rb +1 -1
- data/spec/config_spec.rb +5 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99118dcdb7cbe21b54f559dd45bb67ea1d7ce435
|
4
|
+
data.tar.gz: ba1e90f4309e857b07475d582140d9408d83c8b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9978dcbd2a24382e8c0ce84b9bd88eb33356ca1f6a8ae34a6d8089098a0e2386e7fcc3af93c4a80ca5951dbc917b3c322b87a62d1589efcac7dba546a80f5f49
|
7
|
+
data.tar.gz: 9e560a472e040ed024af2031ed35981953fd77e6e58dbc7296f7ab2e972226299381607b79500a96963d18a94971c6a1a2c865d2d6415758643c1a26bad8031a
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/cconfig/hash_utils.rb
CHANGED
@@ -40,6 +40,12 @@ module CConfig
|
|
40
40
|
self[feature]["enabled"].eql?(true)
|
41
41
|
end
|
42
42
|
end
|
43
|
+
|
44
|
+
# Returns true if the given feature is disabled or doesn't exist. This is
|
45
|
+
# a shorthand for `!enabled?`.
|
46
|
+
def disabled?(feature)
|
47
|
+
!enabled?(feature)
|
48
|
+
end
|
43
49
|
end
|
44
50
|
|
45
51
|
protected
|
data/lib/cconfig/version.rb
CHANGED
data/spec/config_spec.rb
CHANGED
@@ -74,6 +74,11 @@ describe CConfig::Config do
|
|
74
74
|
expect(cfg.enabled?("email.smtp")).to be true
|
75
75
|
end
|
76
76
|
|
77
|
+
it "offers the #disabled? method" do
|
78
|
+
cfg = get_config("config.yml", "").fetch
|
79
|
+
expect(cfg.disabled?("ldap")).to be_truthy
|
80
|
+
end
|
81
|
+
|
77
82
|
it "selects the proper local file depending of the environment variable" do
|
78
83
|
# Instead of bad.yml (which will raise an error on `fetch`), we will pick up
|
79
84
|
# the local.yml file.
|