arturo 3.0.0 → 4.0.0

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: 114d46ab7339cbbdd1c2a3a3ec26b030b825d19e34251255ea335e574200da0e
4
- data.tar.gz: efafe224e924eb3a87f48d7bb7db5b61f77d1446c0bec296c929dcf17dac970b
3
+ metadata.gz: d10fff2eec2850ddf264d8c718160e17d05a1d04c2c0b62cab1c4fb6f6cecf0d
4
+ data.tar.gz: d10b0bcbd89d7e63c3e27c6ae679d44ebae9f6287174f078205bd44e6fb402b2
5
5
  SHA512:
6
- metadata.gz: 258fd4d3264819126bfeaf84acf8ec93cbe28930b09478a061d4c077ac4212cccf78e87762d83532b6ee60652eb1105e48cbd15c4a64d5e0005339fbb6eb4632
7
- data.tar.gz: 5336f810f255103c809286dd9f1560bc775ff466c6e357e6e5e4b9d384226cfdfd532204a1c2970d6e90796a60f829c5002527e5c052c12d9bae5c6ca375e1b5
6
+ metadata.gz: 3e1d5c33c1fd71d8e1d927db48fbf8a68d3479736752c78ff057255e32c29886c2ef511797520b1ce6d22272e470ac97c60edc6519ec95b3a1a300344a2f388f
7
+ data.tar.gz: f2f7a5ed46507f91872d5ac798cbf2811e460f795a57f11acd71d367e9545479934b885300584976641aa2474777e8a5310be90b04ad1f474aea2d7b9f0d7bd7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## Unreleased
2
2
 
3
+ ## v4.0.0
4
+ 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`.
5
+ Adds support for Ruby 3.3.
6
+ Returns false immediately for `feature_enabled_for?` calls with `nil` recipients.
7
+
3
8
  ## v3.0.0
4
9
 
5
10
  Converts the Feature model into a mixin that should be used by services via a model generator.
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'active_record'
3
4
  require 'active_support'
4
5
 
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Arturo
3
- VERSION = '3.0.0'
3
+ VERSION = '4.0.0'
4
4
  end
data/lib/arturo.rb CHANGED
@@ -1,19 +1,21 @@
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
+
10
+ module Arturo
11
11
  class << self
12
12
  # Quick check for whether a feature is enabled for a recipient.
13
13
  # @param [String, Symbol] feature_name
14
14
  # @param [#id] recipient
15
15
  # @return [true,false] whether the feature exists and is enabled for the recipient
16
16
  def feature_enabled_for?(feature_name, recipient)
17
+ return false if recipient.nil?
18
+
17
19
  f = self::Feature.to_feature(feature_name)
18
20
  f && f.enabled_for?(recipient)
19
21
  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.0
4
+ version: 4.0.0
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-10-27 00:00:00.000000000 Z
11
+ date: 2024-04-12 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.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