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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 414a786d1d81cd18b31b5d54bc7df6b9c820d13106dcf471721d7383c28e75e8
4
- data.tar.gz: b42410fd7c9df45c1875958f335e5434a856e154c322b88819dfa20f4eb22877
3
+ metadata.gz: 5af32fa5bd93a762cb57e3da2899776f6aaddf83e7dff2ff960c7a3d3823410a
4
+ data.tar.gz: db4d6c96ebfb8d3ee16f3d8286d11faad2105b349fbb83e995d442b876ea9e62
5
5
  SHA512:
6
- metadata.gz: 3044307df2f849112c60bb859ab52b2151634ff891442b1e93328f270ad4adb1ddbb8e1da63e5317ad3b5d365d6c3de3761024e585216f5c7a8a20de5af0aa2a
7
- data.tar.gz: 592a564c1af2f63d80523f9a41c412bb882dabc14195dc3a1dd73d88220b2e74e1d17c5b4edc444d4a9f3f74b0650e6d5f3bb7e4244765fcbf073a1be2f6dfc3
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 Arturo::FeatureAvailability
13
- helper Arturo::FeatureManagement
12
+ helper Arturo::FeatureAvailability
13
+ helper Arturo::FeatureManagement
14
14
  end
15
15
  end
16
16
 
17
- root = File.expand_path("../../..", __FILE__)
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
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Arturo
3
- VERSION = '3.0.1'
3
+ VERSION = '3.0.2.pre.2'
4
4
  end
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.1
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: 2023-11-03 00:00:00.000000000 Z
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.0.3.1
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