featury 1.0.0.rc5 → 1.0.0.rc6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +29 -34
- data/lib/featury/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1dc31fdf0161091a1e477a352c5e06629fed341c488d78e0d6153c02805623e
|
4
|
+
data.tar.gz: 298efaed87cd51269f3bef4573a925924db8503865f54d2e0402a7c35ba4b283
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca3ed00e6e9e6f0559c2a1ddf8a962c2dc8857d135bcf5a1c4e85f95a81d6c6244c65f050523a67a3d1aec82490a69812dc1186467b0ab2eaaba3a3523467e79
|
7
|
+
data.tar.gz: be517027a237226225c42d03a5ba88f0d050c93bdd82fcaf90681fb764f8602214d3381e59bf7f5531e18fde19328220d1f4e5a2257cd1911c43dbc26185d360
|
data/README.md
CHANGED
@@ -3,11 +3,11 @@
|
|
3
3
|
<a href="https://github.com/servactory/featury/releases"><img src="https://img.shields.io/github/release-date/servactory/featury" alt="Release Date"></a>
|
4
4
|
</p>
|
5
5
|
|
6
|
-
##
|
6
|
+
## Purpose
|
7
7
|
|
8
|
-
Featury is designed
|
9
|
-
|
10
|
-
|
8
|
+
Featury is designed to group and manage multiple features within a project.
|
9
|
+
It provides the flexibility to utilize any pre-existing solution or create your own.
|
10
|
+
It's easily adjustable to align with the unique needs and objectives of your project.
|
11
11
|
|
12
12
|
[//]: # (## Documentation)
|
13
13
|
|
@@ -25,8 +25,8 @@ gem "featury"
|
|
25
25
|
|
26
26
|
#### Basic class for your features
|
27
27
|
|
28
|
-
For
|
29
|
-
In
|
28
|
+
For instance, assume that you are utilizing Flipper for managing features.
|
29
|
+
In such scenario, the base class could potentially be structured as follows:
|
30
30
|
|
31
31
|
```ruby
|
32
32
|
class ApplicationFeature < Featury::Base
|
@@ -58,14 +58,10 @@ class UserFeature::Onboarding < ApplicationFeature
|
|
58
58
|
|
59
59
|
prefix :user_onboarding
|
60
60
|
|
61
|
-
features
|
62
|
-
:passage, # => :user_onboarding_passage
|
63
|
-
)
|
61
|
+
features :passage # => :user_onboarding_passage
|
64
62
|
|
65
|
-
groups
|
66
|
-
|
67
|
-
PaymentSystemFeature
|
68
|
-
)
|
63
|
+
groups BillingFeature,
|
64
|
+
PaymentSystemFeature
|
69
65
|
end
|
70
66
|
```
|
71
67
|
|
@@ -73,9 +69,8 @@ end
|
|
73
69
|
class BillingFeature < ApplicationFeature
|
74
70
|
prefix :billing
|
75
71
|
|
76
|
-
features
|
77
|
-
|
78
|
-
)
|
72
|
+
features :api, # => :billing_api
|
73
|
+
:webhooks # => :billing_webhooks
|
79
74
|
end
|
80
75
|
```
|
81
76
|
|
@@ -83,22 +78,21 @@ end
|
|
83
78
|
class PaymentSystemFeature < ApplicationFeature
|
84
79
|
prefix :payment_system
|
85
80
|
|
86
|
-
features
|
87
|
-
|
88
|
-
)
|
81
|
+
features :api, # => :payment_system_api
|
82
|
+
:webhooks # => :payment_system_webhooks
|
89
83
|
end
|
90
84
|
```
|
91
85
|
|
92
|
-
The `resource` method
|
93
|
-
|
86
|
+
The `resource` method provides an indication of how the transmitted information ought to be processed.
|
87
|
+
Besides the options provided by [Servactory](https://github.com/servactory/servactory), additional ones are available for stipulating the processing mode of the transmitted data.
|
94
88
|
|
95
|
-
If
|
89
|
+
If a resource needs to be conveyed as a feature flag option, utilize the `option` parameter:
|
96
90
|
|
97
|
-
```ruby
|
91
|
+
```ruby
|
98
92
|
resource :user, type: User, option: true
|
99
93
|
```
|
100
94
|
|
101
|
-
|
95
|
+
To transfer a resource to a nested group, utilize the `nested` option:
|
102
96
|
|
103
97
|
```ruby
|
104
98
|
resource :user, type: User, nested: true
|
@@ -106,17 +100,17 @@ resource :user, type: User, nested: true
|
|
106
100
|
|
107
101
|
#### Working with the features of your project
|
108
102
|
|
109
|
-
Each of these actions will be applied to
|
110
|
-
|
103
|
+
Each of these actions will be applied to every feature flag.
|
104
|
+
Subsequently, the outcome of these actions will be contingent upon the combined results of all feature flags.
|
111
105
|
|
112
106
|
```ruby
|
113
107
|
UserFeature::Onboarding.enabled?(user:) # => true
|
114
108
|
UserFeature::Onboarding.disabled?(user:) # => false
|
115
109
|
UserFeature::Onboarding.enable(user:) # => true
|
116
|
-
UserFeature::Onboarding.disable(user:) # =>
|
110
|
+
UserFeature::Onboarding.disable(user:) # => true
|
117
111
|
```
|
118
112
|
|
119
|
-
You can also
|
113
|
+
You can also utilize the `with` method to pass necessary arguments.
|
120
114
|
|
121
115
|
```ruby
|
122
116
|
feature = UserFeature::Onboarding.with(user:)
|
@@ -124,15 +118,16 @@ feature = UserFeature::Onboarding.with(user:)
|
|
124
118
|
feature.enabled? # => true
|
125
119
|
feature.disabled? # => false
|
126
120
|
feature.enable # => true
|
127
|
-
feature.disable # =>
|
121
|
+
feature.disable # => true
|
128
122
|
```
|
129
123
|
|
130
|
-
If
|
131
|
-
|
132
|
-
|
124
|
+
If a feature flag is deactivated, possibly via automation processes,
|
125
|
+
the primary feature class subsequently responds with `false` when
|
126
|
+
queried about its enablement status.
|
133
127
|
|
134
|
-
In the example
|
135
|
-
|
128
|
+
In the preceding example, there might be a scenario where the payment system is
|
129
|
+
undergoing technical maintenance and therefore is temporarily shut down.
|
130
|
+
Consequently, the onboarding process for new users will be halted until further notice.
|
136
131
|
|
137
132
|
## Contributing
|
138
133
|
|
data/lib/featury/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: featury
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.rc6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Sokolov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '5.1'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '8.0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '5.1'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '8.0'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: i18n
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -50,14 +50,14 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 2.
|
53
|
+
version: 2.8.0
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: 2.
|
60
|
+
version: 2.8.0
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: zeitwerk
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|