Skip to content

Commit 8bd30b1

Browse files
committed
upgrading examples
1 parent ad5155f commit 8bd30b1

15 files changed

+389
-118
lines changed

Gemfile.lock

+71-70
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)
@@ -94,14 +94,15 @@ GEM
9494
xpath (~> 3.2)
9595
concurrent-ruby (1.2.3)
9696
connection_pool (2.4.1)
97-
crack (0.4.5)
97+
crack (1.0.0)
98+
bigdecimal
9899
rexml
99100
crass (1.0.6)
100101
date (3.3.4)
101-
dotenv (2.8.1)
102-
dotenv-rails (2.8.1)
103-
dotenv (= 2.8.1)
104-
railties (>= 3.2)
102+
dotenv (3.0.2)
103+
dotenv-rails (3.0.2)
104+
dotenv (= 3.0.2)
105+
railties (>= 6.1)
105106
drb (2.2.0)
106107
ruby2_keywords
107108
erubi (1.12.0)
@@ -127,10 +128,10 @@ GEM
127128
i18n (1.14.1)
128129
concurrent-ruby (~> 1.0)
129130
io-console (0.7.2)
130-
irb (1.11.1)
131+
irb (1.11.2)
131132
rdoc
132133
reline (>= 0.4.2)
133-
listen (3.8.0)
134+
listen (3.9.0)
134135
rb-fsevent (~> 0.10, >= 0.10.3)
135136
rb-inotify (~> 0.9, >= 0.9.10)
136137
loofah (2.22.0)
@@ -144,9 +145,9 @@ GEM
144145
marcel (1.0.2)
145146
matrix (0.4.2)
146147
mini_mime (1.1.5)
147-
minitest (5.21.2)
148+
minitest (5.22.2)
148149
mutex_m (0.2.0)
149-
net-imap (0.4.9.1)
150+
net-imap (0.4.10)
150151
date
151152
net-protocol
152153
net-pop (0.1.2)
@@ -156,19 +157,19 @@ GEM
156157
net-smtp (0.4.0.1)
157158
net-protocol
158159
nio4r (2.7.0)
159-
nokogiri (1.16.0-arm64-darwin)
160+
nokogiri (1.16.2-arm64-darwin)
160161
racc (~> 1.4)
161-
nokogiri (1.16.0-x86_64-darwin)
162+
nokogiri (1.16.2-x86_64-darwin)
162163
racc (~> 1.4)
163-
nokogiri (1.16.0-x86_64-linux)
164+
nokogiri (1.16.2-x86_64-linux)
164165
racc (~> 1.4)
165166
psych (5.1.2)
166167
stringio
167168
public_suffix (5.0.4)
168169
puma (6.4.2)
169170
nio4r (~> 2.0)
170171
racc (1.7.3)
171-
rack (3.0.8)
172+
rack (3.0.9.1)
172173
rack-protection (4.0.0)
173174
base64 (>= 0.1.0)
174175
rack (>= 3.0.0, < 4)
@@ -179,30 +180,30 @@ GEM
179180
rackup (2.1.0)
180181
rack (>= 3)
181182
webrick (~> 1.8)
182-
rails (7.1.3)
183-
actioncable (= 7.1.3)
184-
actionmailbox (= 7.1.3)
185-
actionmailer (= 7.1.3)
186-
actionpack (= 7.1.3)
187-
actiontext (= 7.1.3)
188-
actionview (= 7.1.3)
189-
activejob (= 7.1.3)
190-
activemodel (= 7.1.3)
191-
activerecord (= 7.1.3)
192-
activestorage (= 7.1.3)
193-
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)
194195
bundler (>= 1.15.0)
195-
railties (= 7.1.3)
196+
railties (= 7.1.3.2)
196197
rails-dom-testing (2.2.0)
197198
activesupport (>= 5.0.0)
198199
minitest
199200
nokogiri (>= 1.6)
200201
rails-html-sanitizer (1.6.0)
201202
loofah (~> 2.21)
202203
nokogiri (~> 1.14)
203-
railties (7.1.3)
204-
actionpack (= 7.1.3)
205-
activesupport (= 7.1.3)
204+
railties (7.1.3.2)
205+
actionpack (= 7.1.3.2)
206+
activesupport (= 7.1.3.2)
206207
irb
207208
rackup (>= 1.0.0)
208209
rake (>= 12.2)
@@ -215,15 +216,15 @@ GEM
215216
rdoc (6.6.2)
216217
psych (>= 4.0.0)
217218
regexp_parser (2.9.0)
218-
reline (0.4.2)
219+
reline (0.4.3)
219220
io-console (~> 0.5)
220221
rexml (3.2.6)
221222
ruby2_keywords (0.0.5)
222223
rubyzip (2.3.2)
223224
sanitize (6.1.0)
224225
crass (~> 1.0.2)
225226
nokogiri (>= 1.12.0)
226-
selenium-webdriver (4.17.0)
227+
selenium-webdriver (4.18.1)
227228
base64 (~> 0.2)
228229
rexml (~> 3.2, >= 3.2.5)
229230
rubyzip (>= 1.2.2, < 3.0)
@@ -245,7 +246,7 @@ GEM
245246
activemodel (>= 6.0.0)
246247
bindex (>= 0.4.0)
247248
railties (>= 6.0.0)
248-
webmock (3.19.1)
249+
webmock (3.23.0)
249250
addressable (>= 2.8.0)
250251
crack (>= 0.3.2)
251252
hashdiff (>= 0.4.0, < 2.0.0)
@@ -256,7 +257,7 @@ GEM
256257
websocket-extensions (0.1.5)
257258
xpath (3.2.0)
258259
nokogiri (~> 1.8)
259-
zeitwerk (2.6.12)
260+
zeitwerk (2.6.13)
260261

261262
PLATFORMS
262263
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)