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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d34eeff1f9b3a939cce56030ca7aba0b5022a07d
4
- data.tar.gz: db2d29338b32e2e894ba47e19043131cfa6bbc85
3
+ metadata.gz: 99118dcdb7cbe21b54f559dd45bb67ea1d7ce435
4
+ data.tar.gz: ba1e90f4309e857b07475d582140d9408d83c8b8
5
5
  SHA512:
6
- metadata.gz: 804648f17f89f9163055ea3c57074e0e1ceea6b437de26ada5292b3940a6db2fb25266ebe30c63be9609de22211e93e8411768c1a5fef2b2fa708a8b600fe637
7
- data.tar.gz: aab64e94ae3ca46a61a0b47680c2097b80c8b305571c1f2d963a2dabb4b4edd06522af13ec679847ea2a442266d64fe5f8e93ae9c0e89b975a6eecec33c1e9b9
6
+ metadata.gz: 9978dcbd2a24382e8c0ce84b9bd88eb33356ca1f6a8ae34a6d8089098a0e2386e7fcc3af93c4a80ca5951dbc917b3c322b87a62d1589efcac7dba546a80f5f49
7
+ data.tar.gz: 9e560a472e040ed024af2031ed35981953fd77e6e58dbc7296f7ab2e972226299381607b79500a96963d18a94971c6a1a2c865d2d6415758643c1a26bad8031a
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.1.0
4
+
5
+ - Added the `disabled?` method, which is a shorthand for `enabled?`.
6
+
3
7
  ## 1.0.0
4
8
 
5
9
  - First release which includes the following features:
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cconfig (1.0.0rc1)
4
+ cconfig (1.0.0)
5
5
  safe_yaml (~> 1.0.0, >= 1.0.0)
6
6
 
7
7
  GEM
@@ -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
@@ -19,5 +19,5 @@
19
19
 
20
20
  module CConfig
21
21
  # The current version of CConfig.
22
- VERSION = "1.0.0".freeze
22
+ VERSION = "1.1.0".freeze
23
23
  end
@@ -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.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cconfig
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - mssola