fflags 0.3.0 → 0.3.1

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: 72f65fe5ec5b36c7fff0bc23ea874aa82063ee4a
4
- data.tar.gz: 64d8caa37df5953669231a67b126668627b9a154
3
+ metadata.gz: a5268321d568d3ff52cecb10111988e1d0574901
4
+ data.tar.gz: b7f9586ecb6eafb4ba8492e1303dde0d6ec9803f
5
5
  SHA512:
6
- metadata.gz: 85de7e1a2994de1979f2c66273e01b251b3f5ff0427de0564147f003be17d72297cdf06a661f7967873405d6228d4437f26b736b4ee81547898686480f84943e
7
- data.tar.gz: cf5404220fb29854eef0fb2c02f2f99748554121aa57aef406f6e342e2fc2bc9841a6219c9f03026da5e719f20edcb649b7e893b6995c334858d5394c8ba764e
6
+ metadata.gz: 5482d73658767d5b23864b159bd44439c921510ba2c5d40931c5244297d4baadd93cf4a7dfd003f56217b73e80e22520da9cf93a182123f6bccd02470969a96b
7
+ data.tar.gz: df7018b9489c7bd55e6d9c11a70d597f8bee8a35b16506f6923307b561fa944235e61420c40dc8d58dcdd54c454ca3a86648bec673a9ca71c254057ffb48531b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fflags (0.3.0)
4
+ fflags (0.3.1)
5
5
  redis (>= 3.0.0)
6
6
 
7
7
  GEM
@@ -1,3 +1,3 @@
1
1
  module FFlags
2
- VERSION = '0.3.0'.freeze
2
+ VERSION = '0.3.1'.freeze
3
3
  end
data/lib/fflags.rb CHANGED
@@ -45,7 +45,7 @@ module FFlags
45
45
  return super
46
46
  end
47
47
 
48
- api.get_flag(flag_name)
48
+ api.enabled?(flag_name)
49
49
  end
50
50
 
51
51
  def respond_to_missing?(method_name, include_private = false)
data/lib/fflags/api.rb CHANGED
@@ -10,7 +10,7 @@ module FFlags
10
10
  end
11
11
 
12
12
  def enabled?(flag_name)
13
- get_flag(flag_name) == true
13
+ truthy?(get_flag(flag_name))
14
14
  end
15
15
 
16
16
  def set_flag(flag_name, bool)
@@ -18,7 +18,7 @@ module FFlags
18
18
  end
19
19
 
20
20
  def get_flag(flag_name)
21
- truthy?(client.get(key, flag_name))
21
+ client.get(key, flag_name)
22
22
  end
23
23
 
24
24
  def toggle_flag(flag_name)
@@ -30,8 +30,13 @@ module FFlags
30
30
  load_flags
31
31
  end
32
32
 
33
+ def flag_exist?(flag_name)
34
+ !get_flag(flag_name).nil?
35
+ end
36
+
33
37
  def load_flags
34
38
  default_flags.each do |flag, bool|
39
+ next if flag_exist?(flag)
35
40
  set_flag(flag, bool)
36
41
  end
37
42
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fflags
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Faizal Zakaria