ffe 1.0.1 → 1.1.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/README.md +1 -1
- data/app/models/concerns/async_adapter.rb +9 -0
- data/app/models/ffe/feature_flag.rb +6 -3
- data/lib/ffe/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bc9df5fa6a078e973d4438f204a8553788e7de77b2950b50217a47fbc5a5266b
|
|
4
|
+
data.tar.gz: 58aac8290a5110258baeba62751fc9140e8cf169b3f8dc2114fd50a5cabae3ef
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '0081895d477c3c7e6aba7094b4e2fe1236cbdab2004d13038c44cb646549c2e4aa59f91a0463b75c5a96a1a0a9c0abf6a6cca6928b3f172fdd0bd3afb597251b'
|
|
7
|
+
data.tar.gz: b2bf253a661d493ca8682ddf437d8270334f17c1952b376263f8f947d906bc06eb8a14cbbc0f1ff4b5d21bc12272925b3fb32d286217b85075582c0a9ea5f16e
|
data/README.md
CHANGED
|
@@ -93,7 +93,7 @@ Run your app and go to [http://localhost:3000/ffe/feature_flags](http://localhos
|
|
|
93
93
|
|
|
94
94
|
**Use Case**: Set a feature flag for an announcement, or something similar, for a specific period of time.
|
|
95
95
|
|
|
96
|
-
> This requires the use of ActiveJob; currently, only `SolidQueue` and `Sidekiq` are supported. But feel free to add more.
|
|
96
|
+
> This requires the use of ActiveJob; currently, only `SolidQueue` and `Sidekiq` adapters are supported. But feel free to add more.
|
|
97
97
|
|
|
98
98
|
1. Create a feature flag in production, but without setting the expires date.
|
|
99
99
|
2. Dump the flags, then replace the `config/feature_flags.json` file locally and commit it.
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
module Ffe
|
|
4
4
|
class FeatureFlag < ApplicationRecord
|
|
5
|
-
|
|
5
|
+
case Ffe.config.queue_adapter
|
|
6
|
+
when :solid_queue
|
|
6
7
|
include SolidQueueAdapter
|
|
7
|
-
|
|
8
|
+
when :sidekiq
|
|
8
9
|
include SidekiqAdapter
|
|
10
|
+
else
|
|
11
|
+
include AsyncAdapter
|
|
9
12
|
end
|
|
10
13
|
|
|
11
14
|
self.table_name = 'feature_flags'
|
|
@@ -16,7 +19,7 @@ module Ffe
|
|
|
16
19
|
validates :expires_at, comparison: { greater_than: Time.current.end_of_day }, if: -> { expires_at.present? && expires_at_changed? } # rubocop:disable Layout/LineLength
|
|
17
20
|
|
|
18
21
|
# callbacks
|
|
19
|
-
after_save_commit :handle_change_job,
|
|
22
|
+
after_save_commit :handle_change_job, if: -> { %i[solid_queue sidekiq].include?(Ffe.config.queue_adapter) }
|
|
20
23
|
before_destroy :destroy_job
|
|
21
24
|
|
|
22
25
|
# the Flag functionality itself
|
data/lib/ffe/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ffe
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- LeFnord
|
|
@@ -40,6 +40,7 @@ files:
|
|
|
40
40
|
- app/jobs/ffe/application_job.rb
|
|
41
41
|
- app/jobs/ffe/expired_handling_job.rb
|
|
42
42
|
- app/mailers/ffe/application_mailer.rb
|
|
43
|
+
- app/models/concerns/async_adapter.rb
|
|
43
44
|
- app/models/concerns/sidekiq_adapter.rb
|
|
44
45
|
- app/models/concerns/solid_queue_adapter.rb
|
|
45
46
|
- app/models/ffe/application_record.rb
|