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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 065265e25bfcbc8023763bc148bfbdc82d30da98
4
- data.tar.gz: 11efd17d3984d61e1e831a465a19271bc5debaec
3
+ metadata.gz: 35e20c921dde30ee26b13058581b9f13ce860036
4
+ data.tar.gz: 46df7d7fb8a86cc409302074a89e1c830656fa87
5
5
  SHA512:
6
- metadata.gz: 91a12468f2419f6410c608b418b17f19689d3cf487603e2c51ee15fe1f8ca8d4660faf5c272aba94b4b4f2d04c15e41bcf6052078348a0881e08d24bcc36629c
7
- data.tar.gz: 3ecc1f03853c703090fc0ca863b8f3c3ed68b55b27e0cb77aad997aa005378b73022aaf8d4d15b82a372a0f35d542eaac72704fff28a2942494a778cd8e85a74
6
+ metadata.gz: e936da26915752080fac7dba9ad2624ff1d8f59bda92239cae500eba8646b1846a12b9cf9187786bd88ec2bc747b93f53e933444903f5c367398dbfe570f9088
7
+ data.tar.gz: 74d0d6509e136288f65eb327da4bf362f90df73831401923f3bed134299dd39d7d00f5ca8633a2f0867e0cf0e93d39a5dc5c369f0645e809cb6f811371290aec
data/.travis.yml CHANGED
@@ -1,5 +1,3 @@
1
- sudo: false
2
1
  language: ruby
3
2
  rvm:
4
- - 2.4.1
5
- before_install: gem install bundler -v 1.15.4
3
+ - 2.2
data/README.md CHANGED
@@ -1,9 +1,13 @@
1
1
  # SimpleFeatures
2
2
 
3
- This gem was design to 1 thing and it well. (me thinks)
3
+ [![Gem Version](https://badge.fury.io/rb/simple_features.svg)](https://badge.fury.io/rb/simple_features)
4
4
 
5
- The reason for why I started to write this gem is that of all the feautre gems, it was
6
- quicker to write this gem than learn how they work And thats why this gem is overly darn so simple
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
- None. its simple... ok you got me I should write some. %TODO%
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
- define_singleton_method("#{feature}?") do
28
- feature_value
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
@@ -1,3 +1,3 @@
1
1
  module SimpleFeatures
2
- VERSION = "0.9.99"
2
+ VERSION = "0.9.100"
3
3
  end
@@ -1,4 +1,5 @@
1
1
  require "simple_features/version"
2
+ require "simple_features/features"
2
3
 
3
4
  module SimpleFeatures
4
5
  # Your code goes here...
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_features
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.99
4
+ version: 0.9.100
5
5
  platform: ruby
6
6
  authors:
7
7
  - Freibuis