feature_flag 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +32 -0
- data/.travis.yml +2 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +18 -1
- data/README.md +12 -3
- data/lib/feature_flag/lookup.rb +1 -2
- data/lib/feature_flag/version.rb +1 -1
- data/spec/feature_flag/lookup_spec.rb +6 -0
- data/spec/spec_helper.rb +3 -0
- metadata +4 -3
data/.gitignore
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
|
2
|
+
#
|
|
3
|
+
# If you find yourself ignoring temporary files generated by your text editor
|
|
4
|
+
# or operating system, you probably want to add a global ignore instead:
|
|
5
|
+
# git config --global core.excludesfile ~/.gitignore_global
|
|
6
|
+
|
|
7
|
+
# Ignore bundler config
|
|
8
|
+
/.bundle
|
|
9
|
+
|
|
10
|
+
# Ignore gem files
|
|
11
|
+
pkg
|
|
12
|
+
|
|
13
|
+
# Ignore coverage files
|
|
14
|
+
/coverage
|
|
15
|
+
|
|
16
|
+
# Ignore the default SQLite database.
|
|
17
|
+
/db/*.sqlite3
|
|
18
|
+
|
|
19
|
+
# Ignore all logfiles and tempfiles.
|
|
20
|
+
/log/*.log
|
|
21
|
+
/tmp
|
|
22
|
+
|
|
23
|
+
# Ignore rails config
|
|
24
|
+
config/database.yml
|
|
25
|
+
config/email.yml
|
|
26
|
+
|
|
27
|
+
# Ignore generic files
|
|
28
|
+
*.DS_Store
|
|
29
|
+
*.tags*
|
|
30
|
+
|
|
31
|
+
# Ignore heroku files
|
|
32
|
+
/.anvil
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
feature_flag (0.0.
|
|
4
|
+
feature_flag (0.0.2)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
8
8
|
specs:
|
|
9
|
+
colorize (0.5.8)
|
|
10
|
+
coveralls (0.6.7)
|
|
11
|
+
colorize
|
|
12
|
+
multi_json (~> 1.3)
|
|
13
|
+
rest-client
|
|
14
|
+
simplecov (>= 0.7)
|
|
15
|
+
thor
|
|
9
16
|
diff-lcs (1.2.4)
|
|
17
|
+
mime-types (1.23)
|
|
18
|
+
multi_json (1.7.3)
|
|
10
19
|
rake (10.0.4)
|
|
20
|
+
rest-client (1.6.7)
|
|
21
|
+
mime-types (>= 1.16)
|
|
11
22
|
rspec (2.13.0)
|
|
12
23
|
rspec-core (~> 2.13.0)
|
|
13
24
|
rspec-expectations (~> 2.13.0)
|
|
@@ -16,12 +27,18 @@ GEM
|
|
|
16
27
|
rspec-expectations (2.13.0)
|
|
17
28
|
diff-lcs (>= 1.1.3, < 2.0)
|
|
18
29
|
rspec-mocks (2.13.1)
|
|
30
|
+
simplecov (0.7.1)
|
|
31
|
+
multi_json (~> 1.0)
|
|
32
|
+
simplecov-html (~> 0.7.1)
|
|
33
|
+
simplecov-html (0.7.1)
|
|
34
|
+
thor (0.18.1)
|
|
19
35
|
|
|
20
36
|
PLATFORMS
|
|
21
37
|
ruby
|
|
22
38
|
|
|
23
39
|
DEPENDENCIES
|
|
24
40
|
bundler (~> 1.3)
|
|
41
|
+
coveralls
|
|
25
42
|
feature_flag!
|
|
26
43
|
rake
|
|
27
44
|
rspec
|
data/README.md
CHANGED
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Ruby gem for tying feature flags to environment variables
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Status
|
|
6
|
+
[](http://badge.fury.io/rb/feature_flag)
|
|
6
7
|
[](http://travis-ci.org/tylermercier/feature_flag)
|
|
8
|
+
[](https://codeclimate.com/github/tylermercier/feature_flag)
|
|
9
|
+
[](https://coveralls.io/r/tylermercier/feature_flag)
|
|
7
10
|
|
|
8
11
|
## Installation
|
|
9
12
|
|
|
@@ -19,9 +22,15 @@ Or install it yourself as:
|
|
|
19
22
|
|
|
20
23
|
$ gem install feature_flag
|
|
21
24
|
|
|
22
|
-
##
|
|
25
|
+
## How to use
|
|
23
26
|
|
|
24
|
-
|
|
27
|
+
Add an environment variable for your feature (FEATURE=true)
|
|
28
|
+
|
|
29
|
+
[dotenv](https://github.com/bkeepers/dotenv) is a great gem for managing environment variables
|
|
30
|
+
|
|
31
|
+
Check if the feature is enabled
|
|
32
|
+
|
|
33
|
+
return 'feature enabled' if FeatureFlag::FEATURE
|
|
25
34
|
|
|
26
35
|
## Contributing
|
|
27
36
|
|
data/lib/feature_flag/lookup.rb
CHANGED
data/lib/feature_flag/version.rb
CHANGED
|
@@ -29,6 +29,12 @@ describe Lookup do
|
|
|
29
29
|
end
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
+
it 'should not have false positive matches to non-true values' do
|
|
33
|
+
%w(untrue not eyes silly unenabled 101).each do |value|
|
|
34
|
+
Lookup.enabled(value).should == false
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
32
38
|
it 'should match false values' do
|
|
33
39
|
%w(false f no n disabled 0).each do |value|
|
|
34
40
|
Lookup.enabled(value).should == false
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: feature_flag
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -50,6 +50,7 @@ executables: []
|
|
|
50
50
|
extensions: []
|
|
51
51
|
extra_rdoc_files: []
|
|
52
52
|
files:
|
|
53
|
+
- .gitignore
|
|
53
54
|
- .rspec
|
|
54
55
|
- .rvmrc
|
|
55
56
|
- .travis.yml
|
|
@@ -80,7 +81,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
80
81
|
version: '0'
|
|
81
82
|
segments:
|
|
82
83
|
- 0
|
|
83
|
-
hash:
|
|
84
|
+
hash: -2853581192479140521
|
|
84
85
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
86
|
none: false
|
|
86
87
|
requirements:
|
|
@@ -89,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
89
90
|
version: '0'
|
|
90
91
|
segments:
|
|
91
92
|
- 0
|
|
92
|
-
hash:
|
|
93
|
+
hash: -2853581192479140521
|
|
93
94
|
requirements: []
|
|
94
95
|
rubyforge_project:
|
|
95
96
|
rubygems_version: 1.8.25
|