Skip to content

Commit 88e88d1

Browse files
authored
Merge pull request #59 from flippercloud/example-updates
New Example & Clean Up
2 parents fce61a2 + abe2447 commit 88e88d1

15 files changed

+387
-117
lines changed

Gemfile.lock

+69-69
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,71 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
actioncable (7.1.3)
5-
actionpack (= 7.1.3)
6-
activesupport (= 7.1.3)
4+
actioncable (7.1.3.2)
5+
actionpack (= 7.1.3.2)
6+
activesupport (= 7.1.3.2)
77
nio4r (~> 2.0)
88
websocket-driver (>= 0.6.1)
99
zeitwerk (~> 2.6)
10-
actionmailbox (7.1.3)
11-
actionpack (= 7.1.3)
12-
activejob (= 7.1.3)
13-
activerecord (= 7.1.3)
14-
activestorage (= 7.1.3)
15-
activesupport (= 7.1.3)
10+
actionmailbox (7.1.3.2)
11+
actionpack (= 7.1.3.2)
12+
activejob (= 7.1.3.2)
13+
activerecord (= 7.1.3.2)
14+
activestorage (= 7.1.3.2)
15+
activesupport (= 7.1.3.2)
1616
mail (>= 2.7.1)
1717
net-imap
1818
net-pop
1919
net-smtp
20-
actionmailer (7.1.3)
21-
actionpack (= 7.1.3)
22-
actionview (= 7.1.3)
23-
activejob (= 7.1.3)
24-
activesupport (= 7.1.3)
20+
actionmailer (7.1.3.2)
21+
actionpack (= 7.1.3.2)
22+
actionview (= 7.1.3.2)
23+
activejob (= 7.1.3.2)
24+
activesupport (= 7.1.3.2)
2525
mail (~> 2.5, >= 2.5.4)
2626
net-imap
2727
net-pop
2828
net-smtp
2929
rails-dom-testing (~> 2.2)
30-
actionpack (7.1.3)
31-
actionview (= 7.1.3)
32-
activesupport (= 7.1.3)
30+
actionpack (7.1.3.2)
31+
actionview (= 7.1.3.2)
32+
activesupport (= 7.1.3.2)
3333
nokogiri (>= 1.8.5)
3434
racc
3535
rack (>= 2.2.4)
3636
rack-session (>= 1.0.1)
3737
rack-test (>= 0.6.3)
3838
rails-dom-testing (~> 2.2)
3939
rails-html-sanitizer (~> 1.6)
40-
actiontext (7.1.3)
41-
actionpack (= 7.1.3)
42-
activerecord (= 7.1.3)
43-
activestorage (= 7.1.3)
44-
activesupport (= 7.1.3)
40+
actiontext (7.1.3.2)
41+
actionpack (= 7.1.3.2)
42+
activerecord (= 7.1.3.2)
43+
activestorage (= 7.1.3.2)
44+
activesupport (= 7.1.3.2)
4545
globalid (>= 0.6.0)
4646
nokogiri (>= 1.8.5)
47-
actionview (7.1.3)
48-
activesupport (= 7.1.3)
47+
actionview (7.1.3.2)
48+
activesupport (= 7.1.3.2)
4949
builder (~> 3.1)
5050
erubi (~> 1.11)
5151
rails-dom-testing (~> 2.2)
5252
rails-html-sanitizer (~> 1.6)
53-
activejob (7.1.3)
54-
activesupport (= 7.1.3)
53+
activejob (7.1.3.2)
54+
activesupport (= 7.1.3.2)
5555
globalid (>= 0.3.6)
56-
activemodel (7.1.3)
57-
activesupport (= 7.1.3)
58-
activerecord (7.1.3)
59-
activemodel (= 7.1.3)
60-
activesupport (= 7.1.3)
56+
activemodel (7.1.3.2)
57+
activesupport (= 7.1.3.2)
58+
activerecord (7.1.3.2)
59+
activemodel (= 7.1.3.2)
60+
activesupport (= 7.1.3.2)
6161
timeout (>= 0.4.0)
62-
activestorage (7.1.3)
63-
actionpack (= 7.1.3)
64-
activejob (= 7.1.3)
65-
activerecord (= 7.1.3)
66-
activesupport (= 7.1.3)
62+
activestorage (7.1.3.2)
63+
actionpack (= 7.1.3.2)
64+
activejob (= 7.1.3.2)
65+
activerecord (= 7.1.3.2)
66+
activesupport (= 7.1.3.2)
6767
marcel (~> 1.0)
68-
activesupport (7.1.3)
68+
activesupport (7.1.3.2)
6969
base64
7070
bigdecimal
7171
concurrent-ruby (~> 1.0, >= 1.0.2)
@@ -99,10 +99,10 @@ GEM
9999
rexml
100100
crass (1.0.6)
101101
date (3.3.4)
102-
dotenv (2.8.1)
103-
dotenv-rails (2.8.1)
104-
dotenv (= 2.8.1)
105-
railties (>= 3.2)
102+
dotenv (3.0.2)
103+
dotenv-rails (3.0.2)
104+
dotenv (= 3.0.2)
105+
railties (>= 6.1)
106106
drb (2.2.0)
107107
ruby2_keywords
108108
erubi (1.12.0)
@@ -128,10 +128,10 @@ GEM
128128
i18n (1.14.1)
129129
concurrent-ruby (~> 1.0)
130130
io-console (0.7.2)
131-
irb (1.11.1)
131+
irb (1.11.2)
132132
rdoc
133133
reline (>= 0.4.2)
134-
listen (3.8.0)
134+
listen (3.9.0)
135135
rb-fsevent (~> 0.10, >= 0.10.3)
136136
rb-inotify (~> 0.9, >= 0.9.10)
137137
loofah (2.22.0)
@@ -145,9 +145,9 @@ GEM
145145
marcel (1.0.2)
146146
matrix (0.4.2)
147147
mini_mime (1.1.5)
148-
minitest (5.21.2)
148+
minitest (5.22.2)
149149
mutex_m (0.2.0)
150-
net-imap (0.4.9.1)
150+
net-imap (0.4.10)
151151
date
152152
net-protocol
153153
net-pop (0.1.2)
@@ -157,19 +157,19 @@ GEM
157157
net-smtp (0.4.0.1)
158158
net-protocol
159159
nio4r (2.7.0)
160-
nokogiri (1.16.0-arm64-darwin)
160+
nokogiri (1.16.2-arm64-darwin)
161161
racc (~> 1.4)
162-
nokogiri (1.16.0-x86_64-darwin)
162+
nokogiri (1.16.2-x86_64-darwin)
163163
racc (~> 1.4)
164-
nokogiri (1.16.0-x86_64-linux)
164+
nokogiri (1.16.2-x86_64-linux)
165165
racc (~> 1.4)
166166
psych (5.1.2)
167167
stringio
168168
public_suffix (5.0.4)
169169
puma (6.4.2)
170170
nio4r (~> 2.0)
171171
racc (1.7.3)
172-
rack (3.0.8)
172+
rack (3.0.9.1)
173173
rack-protection (4.0.0)
174174
base64 (>= 0.1.0)
175175
rack (>= 3.0.0, < 4)
@@ -180,30 +180,30 @@ GEM
180180
rackup (2.1.0)
181181
rack (>= 3)
182182
webrick (~> 1.8)
183-
rails (7.1.3)
184-
actioncable (= 7.1.3)
185-
actionmailbox (= 7.1.3)
186-
actionmailer (= 7.1.3)
187-
actionpack (= 7.1.3)
188-
actiontext (= 7.1.3)
189-
actionview (= 7.1.3)
190-
activejob (= 7.1.3)
191-
activemodel (= 7.1.3)
192-
activerecord (= 7.1.3)
193-
activestorage (= 7.1.3)
194-
activesupport (= 7.1.3)
183+
rails (7.1.3.2)
184+
actioncable (= 7.1.3.2)
185+
actionmailbox (= 7.1.3.2)
186+
actionmailer (= 7.1.3.2)
187+
actionpack (= 7.1.3.2)
188+
actiontext (= 7.1.3.2)
189+
actionview (= 7.1.3.2)
190+
activejob (= 7.1.3.2)
191+
activemodel (= 7.1.3.2)
192+
activerecord (= 7.1.3.2)
193+
activestorage (= 7.1.3.2)
194+
activesupport (= 7.1.3.2)
195195
bundler (>= 1.15.0)
196-
railties (= 7.1.3)
196+
railties (= 7.1.3.2)
197197
rails-dom-testing (2.2.0)
198198
activesupport (>= 5.0.0)
199199
minitest
200200
nokogiri (>= 1.6)
201201
rails-html-sanitizer (1.6.0)
202202
loofah (~> 2.21)
203203
nokogiri (~> 1.14)
204-
railties (7.1.3)
205-
actionpack (= 7.1.3)
206-
activesupport (= 7.1.3)
204+
railties (7.1.3.2)
205+
actionpack (= 7.1.3.2)
206+
activesupport (= 7.1.3.2)
207207
irb
208208
rackup (>= 1.0.0)
209209
rake (>= 12.2)
@@ -216,15 +216,15 @@ GEM
216216
rdoc (6.6.2)
217217
psych (>= 4.0.0)
218218
regexp_parser (2.9.0)
219-
reline (0.4.2)
219+
reline (0.4.3)
220220
io-console (~> 0.5)
221221
rexml (3.2.6)
222222
ruby2_keywords (0.0.5)
223223
rubyzip (2.3.2)
224224
sanitize (6.1.0)
225225
crass (~> 1.0.2)
226226
nokogiri (>= 1.12.0)
227-
selenium-webdriver (4.17.0)
227+
selenium-webdriver (4.18.1)
228228
base64 (~> 0.2)
229229
rexml (~> 3.2, >= 3.2.5)
230230
rubyzip (>= 1.2.2, < 3.0)
@@ -246,7 +246,7 @@ GEM
246246
activemodel (>= 6.0.0)
247247
bindex (>= 0.4.0)
248248
railties (>= 6.0.0)
249-
webmock (3.20.0)
249+
webmock (3.23.0)
250250
addressable (>= 2.8.0)
251251
crack (>= 0.3.2)
252252
hashdiff (>= 0.4.0, < 2.0.0)
@@ -257,7 +257,7 @@ GEM
257257
websocket-extensions (0.1.5)
258258
xpath (3.2.0)
259259
nokogiri (~> 1.8)
260-
zeitwerk (2.6.12)
260+
zeitwerk (2.6.13)
261261

262262
PLATFORMS
263263
arm64-darwin-22

app/helpers/flag_state_helper.rb

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module FlagStateHelper
22
def binary?(feature)
3-
!feature.conditional?
3+
feature.enabled_gate_names == %i[boolean]
44
end
55

66
def actor_constrained?(feature)
@@ -12,7 +12,8 @@ def group_constrained?(feature)
1212
end
1313

1414
def percentage_of_time?(feature)
15-
feature.enabled_gate_names.include?(:percentage_of_time)
15+
feature.enabled_gate_names.include?(:percentage_of_time) &&
16+
feature.percentage_of_time_value < 100
1617
end
1718

1819
def percentage_of_actors?(feature)

app/models/example.rb

+7-6
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ def self.list
2424
custom_flag: :profiler,
2525
tags: [[:permanent, :success], [:internal, :secondary]]
2626
),
27-
# new(
28-
# title: "Managing Analytics/Telemetry",
29-
# desc: "A way to disable analytics and telemetry tools in development and test environments while being able to quickly enable them when necessary to re-configure or make adjustments in development.",
30-
# icon: "clipboard-data",
31-
# tags: [[:permanent, :success], [:internal, :secondary]]
32-
# )
27+
new(
28+
title: "Incremental Feature Releases",
29+
desc: "An example of gradually expanding the audience for a given feature in order to find problems before releasing it to more people.",
30+
icon: "circle-half",
31+
custom_flag: :reporting,
32+
tags: [[:temporary, :info], [:external, :warning]]
33+
)
3334
]
3435
end
3536

app/models/user.rb

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
class User < ApplicationRecord
22
enum beverage: { unspecified: 0, water: 1, tea: 2, coffee: 3 }
3+
enum category: { basic: 0, beta: 1, internal: 2 }
34

45
def paid?
56
# Anybody that has specified a beverage preference since only paying

0 commit comments

Comments
 (0)