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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/FFlags/version.rb +1 -1
- data/lib/fflags.rb +1 -1
- data/lib/fflags/api.rb +7 -2
- 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: a5268321d568d3ff52cecb10111988e1d0574901
|
4
|
+
data.tar.gz: b7f9586ecb6eafb4ba8492e1303dde0d6ec9803f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5482d73658767d5b23864b159bd44439c921510ba2c5d40931c5244297d4baadd93cf4a7dfd003f56217b73e80e22520da9cf93a182123f6bccd02470969a96b
|
7
|
+
data.tar.gz: df7018b9489c7bd55e6d9c11a70d597f8bee8a35b16506f6923307b561fa944235e61420c40dc8d58dcdd54c454ca3a86648bec673a9ca71c254057ffb48531b
|
data/Gemfile.lock
CHANGED
data/lib/FFlags/version.rb
CHANGED
data/lib/fflags.rb
CHANGED
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)
|
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
|
-
|
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
|