arturo 3.0.0 → 3.0.2.pre.1
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/CHANGELOG.md +10 -0
- data/README.md +3 -4
- data/lib/arturo/engine.rb +0 -4
- data/lib/arturo/{feature.rb → feature_methods.rb} +1 -0
- data/lib/arturo/version.rb +1 -1
- data/lib/arturo.rb +11 -8
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5db87fac2ac4219ff44405090a37c086cee7ac6654c7cb5dec0bcac3efc1f5b
|
4
|
+
data.tar.gz: 5525f0dc96a7853bce80fe80c30db5a9b6fa26e8b97c2782765e2f4189d00e8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18e7730ea35912a921a69bb9e81c88ce9df285e93277634eb0532290e03a56af0243578cba73ff9fec7c9fc4ce42426bc622fa2d91231500296bd84495f67a85
|
7
|
+
data.tar.gz: b3ebee900920249c7cdbc2e1a444930554c6ca1d9f0935aef4063d1095f3d252354e89c917667374101f3ffa29711af52169a4f0a8b6531128f1fc7cd097a29b
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,19 @@
|
|
1
1
|
## Unreleased
|
2
2
|
|
3
|
+
## v4.0.0
|
4
|
+
|
5
|
+
Stops loading the Rails engine automatically. If you are using the engine, you need to require it explicitly by adding `require 'arturo/engine'` to `application.rb`.
|
6
|
+
|
7
|
+
Adds support for Ruby 3.3.
|
8
|
+
|
9
|
+
Returns false immediately for `feature_enabled_for?` calls with `nil` recipients.
|
10
|
+
|
3
11
|
## v3.0.0
|
4
12
|
|
5
13
|
Converts the Feature model into a mixin that should be used by services via a model generator.
|
14
|
+
|
6
15
|
Brings back the `warm_cache!` method.
|
16
|
+
|
7
17
|
Adds support for Rails 7.1.
|
8
18
|
|
9
19
|
## v2.8.0
|
data/README.md
CHANGED
@@ -43,7 +43,7 @@ $(function() {
|
|
43
43
|
updatePostingsList();
|
44
44
|
}
|
45
45
|
});
|
46
|
-
|
46
|
+
```
|
47
47
|
|
48
48
|
Trish uses Arturo's Controller filters to control who has access to
|
49
49
|
the feature:
|
@@ -70,7 +70,6 @@ feature and deploy it to all users.
|
|
70
70
|
|
71
71
|
## Installation
|
72
72
|
|
73
|
-
|
74
73
|
```Ruby
|
75
74
|
gem 'arturo'
|
76
75
|
```
|
@@ -101,7 +100,7 @@ rake db:migrate
|
|
101
100
|
|
102
101
|
#### Edit the Feature model
|
103
102
|
|
104
|
-
By default, the generated model `Arturo::Feature` inherits from `ActiveRecord::Base`. However, if you’re using multiple databases your models should inherit from an abstract class that specifies a database connection, not directly from `ActiveRecord::Base`. Update the generated model in `app/models/arturo/feature.rb` to make it use a correct database.
|
103
|
+
By default, the generated model `Arturo::Feature` inherits from `ActiveRecord::Base`. However, if you’re using multiple databases your models should inherit from an abstract class that specifies a database connection, not directly from `ActiveRecord::Base`. Update the generated model in `app/models/arturo/feature.rb` to make it use a correct database.
|
105
104
|
|
106
105
|
##### Initializer
|
107
106
|
|
@@ -320,7 +319,7 @@ initializer:
|
|
320
319
|
```Ruby
|
321
320
|
Arturo::Feature.extend(Arturo::FeatureCaching)
|
322
321
|
Arturo::Feature.cache_ttl = 10.minutes
|
323
|
-
|
322
|
+
```
|
324
323
|
|
325
324
|
You can also warm the cache on startup:
|
326
325
|
|
data/lib/arturo/engine.rb
CHANGED
data/lib/arturo/version.rb
CHANGED
data/lib/arturo.rb
CHANGED
@@ -1,19 +1,22 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
module Arturo
|
3
|
-
require 'arturo/null_logger'
|
4
|
-
require 'arturo/special_handling'
|
5
|
-
require 'arturo/feature'
|
6
|
-
require 'arturo/feature_availability'
|
7
|
-
require 'arturo/feature_management'
|
8
|
-
require 'arturo/feature_caching'
|
9
|
-
require 'arturo/engine' if defined?(Rails)
|
10
2
|
|
3
|
+
require_relative 'arturo/null_logger'
|
4
|
+
require_relative 'arturo/special_handling'
|
5
|
+
require_relative 'arturo/feature_methods'
|
6
|
+
require_relative 'arturo/feature_availability'
|
7
|
+
require_relative 'arturo/feature_management'
|
8
|
+
require_relative 'arturo/feature_caching'
|
9
|
+
require_relative 'arturo/engine' if defined?(Rails)
|
10
|
+
|
11
|
+
module Arturo
|
11
12
|
class << self
|
12
13
|
# Quick check for whether a feature is enabled for a recipient.
|
13
14
|
# @param [String, Symbol] feature_name
|
14
15
|
# @param [#id] recipient
|
15
16
|
# @return [true,false] whether the feature exists and is enabled for the recipient
|
16
17
|
def feature_enabled_for?(feature_name, recipient)
|
18
|
+
return false if recipient.nil?
|
19
|
+
|
17
20
|
f = self::Feature.to_feature(feature_name)
|
18
21
|
f && f.enabled_for?(recipient)
|
19
22
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arturo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.2.pre.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James A. Rosen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -146,11 +146,11 @@ files:
|
|
146
146
|
- lib/arturo.rb
|
147
147
|
- lib/arturo/controller_filters.rb
|
148
148
|
- lib/arturo/engine.rb
|
149
|
-
- lib/arturo/feature.rb
|
150
149
|
- lib/arturo/feature_availability.rb
|
151
150
|
- lib/arturo/feature_caching.rb
|
152
151
|
- lib/arturo/feature_factories.rb
|
153
152
|
- lib/arturo/feature_management.rb
|
153
|
+
- lib/arturo/feature_methods.rb
|
154
154
|
- lib/arturo/feature_params_support.rb
|
155
155
|
- lib/arturo/middleware.rb
|
156
156
|
- lib/arturo/no_such_feature.rb
|
@@ -186,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
186
186
|
- !ruby/object:Gem::Version
|
187
187
|
version: '0'
|
188
188
|
requirements: []
|
189
|
-
rubygems_version: 3.
|
189
|
+
rubygems_version: 3.5.3
|
190
190
|
signing_key:
|
191
191
|
specification_version: 4
|
192
192
|
summary: Feature sliders, wrapped up in an engine
|