simple_features 0.9.99 → 0.9.100
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -3
- data/README.md +9 -5
- data/lib/simple_features/features.rb +16 -2
- data/lib/simple_features/version.rb +1 -1
- data/lib/simple_features.rb +1 -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: 35e20c921dde30ee26b13058581b9f13ce860036
|
4
|
+
data.tar.gz: 46df7d7fb8a86cc409302074a89e1c830656fa87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e936da26915752080fac7dba9ad2624ff1d8f59bda92239cae500eba8646b1846a12b9cf9187786bd88ec2bc747b93f53e933444903f5c367398dbfe570f9088
|
7
|
+
data.tar.gz: 74d0d6509e136288f65eb327da4bf362f90df73831401923f3bed134299dd39d7d00f5ca8633a2f0867e0cf0e93d39a5dc5c369f0645e809cb6f811371290aec
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,9 +1,13 @@
|
|
1
1
|
# SimpleFeatures
|
2
2
|
|
3
|
-
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/simple_features.svg)](https://badge.fury.io/rb/simple_features)
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
[![Build Status](https://travis-ci.org/freibuis/simple_features.svg?branch=master)](https://travis-ci.org/freibuis/simple_features)
|
6
|
+
|
7
|
+
This gem was design to just one thing and do it well. (me thinks)
|
8
|
+
|
9
|
+
This gem is an overly simple implementation of feature flagging. The reason for that was, I found it easier to write
|
10
|
+
a gem and learn how feature flagging works as opposed to learning from one of the existing feature gems.
|
7
11
|
|
8
12
|
## Installation
|
9
13
|
|
@@ -94,7 +98,7 @@ puts features.new_idea?
|
|
94
98
|
<%= link_to 'New Feature', new_feature_path if features.new_feature? %>
|
95
99
|
</body>
|
96
100
|
```
|
97
|
-
|
101
|
+
“it’s simple”
|
98
102
|
using simple features wrap around debugging coding (dont do this , its an example )
|
99
103
|
|
100
104
|
```ruby
|
@@ -104,4 +108,4 @@ logger.debug "some aweomse words!" if features.debugging?
|
|
104
108
|
|
105
109
|
## Tests
|
106
110
|
|
107
|
-
|
111
|
+
Some!. “it’s simple...” ok you got me I should write MOAR! tests.
|
@@ -24,8 +24,17 @@ module SimpleFeatures
|
|
24
24
|
|
25
25
|
def make_features
|
26
26
|
@features.each do |feature, feature_value|
|
27
|
-
|
28
|
-
|
27
|
+
|
28
|
+
unless is_boolean? feature_value
|
29
|
+
begin
|
30
|
+
raise ArgumentError.new("Value must be true or false for key #{feature}")
|
31
|
+
rescue ArgumentError => e
|
32
|
+
puts e.message
|
33
|
+
end
|
34
|
+
else
|
35
|
+
define_singleton_method("#{feature}?") do
|
36
|
+
feature_value
|
37
|
+
end
|
29
38
|
end
|
30
39
|
end
|
31
40
|
end
|
@@ -37,5 +46,10 @@ module SimpleFeatures
|
|
37
46
|
:production
|
38
47
|
end
|
39
48
|
end
|
49
|
+
|
50
|
+
def is_boolean?(value)
|
51
|
+
value = "#{value}".downcase
|
52
|
+
['true', 'false'].include? value
|
53
|
+
end
|
40
54
|
end
|
41
55
|
end
|
data/lib/simple_features.rb
CHANGED