green_flag 0.1.2 → 0.2.0
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.
- checksums.yaml +4 -4
- data/.codeclimate.yml +50 -0
- data/Gemfile.lock +6 -1
- data/app/assets/stylesheets/green_flag/admin/features.css.scss +4 -0
- data/app/controllers/green_flag/admin/features_controller.rb +1 -1
- data/app/models/green_flag/feature.rb +8 -0
- data/app/views/green_flag/admin/features/index.html.erb +13 -2
- data/green_flag.gemspec +2 -1
- data/lib/green_flag/version.rb +1 -1
- data/spec/dummy/app/controllers/{feature_check_controller.rb → feature_checks_controller.rb} +0 -0
- data/spec/dummy/config/initializers/green_flag.rb +14 -0
- data/spec/dummy/log/development.log +625 -0
- data/spec/dummy/log/test.log +6447 -0
- data/spec/dummy/tmp/cache/assets/CE7/FF0/sprockets%2Fe45f3a7675a8c5a5b064117792bf5e28 +0 -0
- data/spec/dummy/tmp/cache/assets/D07/670/sprockets%2F761d03a66b753d628feccd12072c814c +0 -0
- data/spec/dummy/tmp/cache/assets/D13/270/sprockets%2F701a30cd450ae3cfa114092bafc16004 +0 -0
- data/spec/dummy/tmp/cache/assets/D68/760/sprockets%2Fea24808c41a3dff75b995b0f090e1a6a +0 -0
- data/spec/dummy/tmp/cache/assets/DA9/2C0/sprockets%2Ff95d82b2bbb6db8ffe1a87f67b415291 +0 -0
- data/spec/dummy/tmp/cache/assets/DB2/0C0/sprockets%2F95cf35cd3e97774df3c41ee0ef564a8d +0 -0
- metadata +23 -6
- data/spec/dummy/tmp/pids/server.pid +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 366ef4d077f8895abd6f88ffd0f1701804380153
|
4
|
+
data.tar.gz: f2f7f937a13d53f4d0f7307ac96b364caf75c3d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a267fc407e2a75453e3ecb8434d113ba8c692d767ff71dfa9d30ce29b5207e9b97e8724c72105b9efa295d8135b6b05f48aa8b75bd286af292c27383630a063b
|
7
|
+
data.tar.gz: 8e3da9d2345fdbb2574245d8d5e34b6def57605dad8e90bfabf4fa17ab4096f3ba5d0ed9f68cbc878d263403b4f1f8598b3594bbfee7461e4e8e68fb9fb6fa95
|
data/.codeclimate.yml
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
# This is a sample .codeclimate.yml configured for Engine analysis on Code
|
2
|
+
# Climate Platform. For an overview of the Code Climate Platform, see here:
|
3
|
+
# http://docs.codeclimate.com/article/300-the-codeclimate-platform
|
4
|
+
|
5
|
+
# Under the engines key, you can configure which engines will analyze your repo.
|
6
|
+
# Each key is an engine name. For each value, you need to specify enabled: true
|
7
|
+
# to enable the engine as well as any other engines-specific configuration.
|
8
|
+
|
9
|
+
# For more details, see here:
|
10
|
+
# http://docs.codeclimate.com/article/289-configuring-your-repository-via-codeclimate-yml#platform
|
11
|
+
|
12
|
+
# For a list of all available engines, see here:
|
13
|
+
# http://docs.codeclimate.com/article/296-engines-available-engines
|
14
|
+
|
15
|
+
engines:
|
16
|
+
# to turn on an engine, add it here and set enabled to `true`
|
17
|
+
# to turn off an engine, set enabled to `false` or remove it
|
18
|
+
rubocop:
|
19
|
+
enabled: true
|
20
|
+
golint:
|
21
|
+
enabled: false
|
22
|
+
gofmt:
|
23
|
+
enabled: false
|
24
|
+
eslint:
|
25
|
+
enabled: true
|
26
|
+
csslint:
|
27
|
+
enabled: true
|
28
|
+
|
29
|
+
# Engines can analyze files and report issues on them, but you can separately
|
30
|
+
# decide which files will receive ratings based on those issues. This is
|
31
|
+
# specified by path patterns under the ratings key.
|
32
|
+
|
33
|
+
# For more details see here:
|
34
|
+
# http://docs.codeclimate.com/article/289-configuring-your-repository-via-codeclimate-yml#platform
|
35
|
+
|
36
|
+
# Note: If the ratings key is not specified, this will result in a 0.0 GPA on your dashboard.
|
37
|
+
|
38
|
+
# ratings:
|
39
|
+
# paths:
|
40
|
+
# - app/**
|
41
|
+
# - lib/**
|
42
|
+
# - "**.rb"
|
43
|
+
# - "**.go"
|
44
|
+
|
45
|
+
# You can globally exclude files from being analyzed by any engine using the
|
46
|
+
# exclude_paths key.
|
47
|
+
|
48
|
+
#exclude_paths:
|
49
|
+
#- spec/**/*
|
50
|
+
#- vendor/**/*
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
green_flag (0.
|
4
|
+
green_flag (0.2.0)
|
5
5
|
activerecord-concurrent-index
|
6
6
|
pg
|
7
7
|
rails (~> 3.2)
|
@@ -54,6 +54,7 @@ GEM
|
|
54
54
|
factory_girl_rails (4.1.0)
|
55
55
|
factory_girl (~> 4.1.0)
|
56
56
|
railties (>= 3.0.0)
|
57
|
+
gem-release (0.7.4)
|
57
58
|
hike (1.2.3)
|
58
59
|
i18n (0.7.0)
|
59
60
|
journey (1.0.4)
|
@@ -133,6 +134,10 @@ PLATFORMS
|
|
133
134
|
DEPENDENCIES
|
134
135
|
capybara
|
135
136
|
factory_girl_rails
|
137
|
+
gem-release
|
136
138
|
green_flag!
|
137
139
|
jquery-rails
|
138
140
|
rspec-rails
|
141
|
+
|
142
|
+
BUNDLED WITH
|
143
|
+
1.10.6
|
@@ -53,6 +53,14 @@ class GreenFlag::Feature < ActiveRecord::Base
|
|
53
53
|
|
54
54
|
last_rule.present? ? last_rule.version_number : version_number
|
55
55
|
end
|
56
|
+
|
57
|
+
def fully_enabled?
|
58
|
+
rules.count > 0 && rules.all? { |rule| rule.percentage == 100 }
|
59
|
+
end
|
60
|
+
|
61
|
+
def fully_disabled?
|
62
|
+
rules.count == 0 || rules.all? { |rule| rule.percentage == 0 }
|
63
|
+
end
|
56
64
|
|
57
65
|
private
|
58
66
|
|
@@ -6,8 +6,19 @@
|
|
6
6
|
<div class="row">
|
7
7
|
<% @features.each do |feature| %>
|
8
8
|
<div class="col-md-6">
|
9
|
-
<
|
10
|
-
|
9
|
+
<div class="well">
|
10
|
+
<h4>
|
11
|
+
<%= link_to feature.code, admin_feature_path(feature) %>
|
12
|
+
<% if feature.fully_enabled? %><span class="label label-success">100%</span><% end %>
|
13
|
+
<% if feature.fully_disabled? %><span class="label label-danger">0%</span><% end %>
|
14
|
+
</h4>
|
15
|
+
|
16
|
+
<div class="help-block">
|
17
|
+
<div>Created on <strong><%= feature.created_at.strftime("%d %b %Y") %></strong></div>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<p><%= feature.description %></p>
|
21
|
+
</div>
|
11
22
|
</div>
|
12
23
|
<% end %>
|
13
24
|
|
data/green_flag.gemspec
CHANGED
@@ -7,7 +7,7 @@ require "green_flag/version"
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "green_flag"
|
9
9
|
s.version = GreenFlag::VERSION
|
10
|
-
s.authors = ["Tim Morton"]
|
10
|
+
s.authors = ["Tim Morton", "Jason Nappier", "Adeel Raza"]
|
11
11
|
s.email = ["tim@timothymorton.com"]
|
12
12
|
s.homepage = "https://github.com/websdotcom/green_flag"
|
13
13
|
s.summary = "A feature-flag system."
|
@@ -31,4 +31,5 @@ Gem::Specification.new do |s|
|
|
31
31
|
s.add_development_dependency 'rspec-rails'
|
32
32
|
s.add_development_dependency 'factory_girl_rails'
|
33
33
|
s.add_development_dependency 'capybara'
|
34
|
+
s.add_development_dependency 'gem-release'
|
34
35
|
end
|
data/lib/green_flag/version.rb
CHANGED
data/spec/dummy/app/controllers/{feature_check_controller.rb → feature_checks_controller.rb}
RENAMED
File without changes
|
@@ -0,0 +1,14 @@
|
|
1
|
+
GreenFlag::VisitorGroup.define do
|
2
|
+
|
3
|
+
# Basic Groups
|
4
|
+
group "Everyone", "This is everyone!" do
|
5
|
+
true
|
6
|
+
end
|
7
|
+
group "New visitors", "These are visitors who have never logged in. (This does not include users who have signed out)" do |site_visitor|
|
8
|
+
!site_visitor.user
|
9
|
+
end
|
10
|
+
group "Pre-existing Visitors", "Visitors that were created before this feature was deployed. They might have seen the old version." do |visitor, rule|
|
11
|
+
visitor.first_visited_at < rule.created_at
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|