arturo 3.0.1 → 3.0.2.pre.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/README.md +3 -4
- data/lib/arturo/engine.rb +3 -5
- data/lib/arturo/version.rb +1 -1
- data/lib/arturo.rb +2 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5af32fa5bd93a762cb57e3da2899776f6aaddf83e7dff2ff960c7a3d3823410a
|
4
|
+
data.tar.gz: db4d6c96ebfb8d3ee16f3d8286d11faad2105b349fbb83e995d442b876ea9e62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85acd4700922566f23a71d816fe508277a3ee060f06571df9856155b312682c1bd62519af0c908dba1dab7ba645785459c9f908d122eb88297a673eb9f197f83
|
7
|
+
data.tar.gz: 8abd9907f994ee4ae10dcb4bca7f01d83b7f02d606f8bedb532da584df561eb8afbdfc962db53734449e1e5c360a90abda64870b69e1bce913d645e38411cedb
|
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
@@ -9,13 +9,11 @@ module Arturo
|
|
9
9
|
include Arturo::FeatureAvailability
|
10
10
|
include Arturo::ControllerFilters
|
11
11
|
if respond_to?(:helper)
|
12
|
-
helper
|
13
|
-
helper
|
12
|
+
helper Arturo::FeatureAvailability
|
13
|
+
helper Arturo::FeatureManagement
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
|
18
|
-
config.autoload_paths = ["#{root}/app/helpers", "#{root}/app/controllers"]
|
19
|
-
config.eager_load_paths = []
|
17
|
+
config.paths['app/controllers'] = []
|
20
18
|
end
|
21
19
|
end
|
data/lib/arturo/version.rb
CHANGED
data/lib/arturo.rb
CHANGED
@@ -15,6 +15,8 @@ module Arturo
|
|
15
15
|
# @param [#id] recipient
|
16
16
|
# @return [true,false] whether the feature exists and is enabled for the recipient
|
17
17
|
def feature_enabled_for?(feature_name, recipient)
|
18
|
+
return false if recipient.nil?
|
19
|
+
|
18
20
|
f = self::Feature.to_feature(feature_name)
|
19
21
|
f && f.enabled_for?(recipient)
|
20
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.2
|
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
|
@@ -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
|