factory_bot_instrumentation 2.0.0 → 2.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2bf8ed789407e3fbf74f51ab32e52b672e2a31e611f12071a72badc892688d55
4
- data.tar.gz: 6b0d4407dcd2837c4eeaeee6b56f836afa9facead8e4ad4c6ff156550c933d43
3
+ metadata.gz: 22779b2ddcf2a843745a37630a9c9195cdee2ec476aba7ff9f384ba3479d8bc7
4
+ data.tar.gz: 0c8aafc7fe54a6bd757c2d35193fbe45ec184d7c3714048a800c54225cfbacf2
5
5
  SHA512:
6
- metadata.gz: b0bf47754153063d82d1c4755c112d4079525edf613317bde3948c278a3f60b21235ced474607c406bddd77f00efd2b94a6f486287a0fd1784ec0a3c73be8109
7
- data.tar.gz: 0d9dad4caaba2ec9a33130f412a6e94ceaba70e7db48cd13de89d6be56415da917055d69d7e208af07aaef07d82ca944ec71ce36c60312f1ff5d72b6cf19b234
6
+ metadata.gz: 8c9b1fcbb5f85e3deb47cbbe308841e29ce06dd300ae0085e3728e6a68a3341d70aad86f7ca9efd563f5fa82469ed1ba422c6b3f5cbc86af238c66800d6602a0
7
+ data.tar.gz: fd1a95d7b69759f6e4f8b491948c2d688f45294909decde13b95b4625341445868cb40c6150b1e091dde8ed13ebabebf1557002eabd14752b3f5338ed59466a3
@@ -16,7 +16,7 @@ jobs:
16
16
  docs:
17
17
  name: Release the gem
18
18
  runs-on: ubuntu-22.04
19
- timeout-minutes: 5
19
+ timeout-minutes: 10
20
20
  steps:
21
21
  - uses: actions/checkout@v4
22
22
 
@@ -19,7 +19,7 @@ jobs:
19
19
  fail-fast: false
20
20
  matrix:
21
21
  ruby: ['3.2', '3.3', '3.4']
22
- rails: ['7.1', '7.2', '8.0']
22
+ rails: ['7.1', '7.2', '8.0', '8.1']
23
23
  env:
24
24
  BUNDLE_GEMFILE: 'gemfiles/rails_${{ matrix.rails }}.gemfile'
25
25
  steps:
data/.rubocop.yml CHANGED
@@ -13,7 +13,7 @@ AllCops:
13
13
  SuggestExtensions: false
14
14
  DisplayCopNames: true
15
15
  TargetRubyVersion: 3.2
16
- TargetRailsVersion: 6.1
16
+ TargetRailsVersion: 7.1
17
17
  Exclude:
18
18
  - bin/**/*
19
19
  - vendor/**/*
data/Appraisals CHANGED
@@ -11,3 +11,7 @@ end
11
11
  appraise 'rails-8.0' do
12
12
  gem 'rails', '~> 8.0.0'
13
13
  end
14
+
15
+ appraise 'rails-8.1' do
16
+ gem 'rails', '~> 8.1.0'
17
+ end
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  * TODO: Replace this bullet point with an actual description of a change.
4
4
 
5
+ ### 2.1.0 (23 October 2025)
6
+
7
+ * Added support for Rails 8.1 ([#35](https://github.com/hausgold/factory_bot_instrumentation/pull/35))
8
+ * Switched from `ActiveSupport::Configurable` to a custom implementation based
9
+ on `ActiveSupport::OrderedOptions` ([#36](https://github.com/hausgold/factory_bot_instrumentation/pull/36))
10
+
5
11
  ### 2.0.0 (28 June 2025)
6
12
 
7
13
  * Corrected some RuboCop glitches ([#33](https://github.com/hausgold/factory_bot_instrumentation/pull/33))
data/Gemfile CHANGED
@@ -10,7 +10,7 @@ gemspec
10
10
  # Development dependencies
11
11
  gem 'appraisal', '~> 2.4'
12
12
  gem 'bundler', '~> 2.6'
13
- gem 'countless', '~> 2.0'
13
+ gem 'countless', '~> 2.2'
14
14
  gem 'factory_bot_rails', '~> 6.2'
15
15
  gem 'guard-rspec', '~> 4.7'
16
16
  gem 'railties', '>= 7.1'
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
36
36
  spec.add_dependency 'bigdecimal', '~> 3.1'
37
37
  spec.add_dependency 'drb', '~> 2.2'
38
38
  spec.add_dependency 'factory_bot', '~> 6.2'
39
- spec.add_dependency 'mutex_m', '~> 0.3.0'
39
+ spec.add_dependency 'mutex_m', '>= 0.3'
40
40
  spec.add_dependency 'rails', '>= 7.1'
41
41
  spec.add_dependency 'retries', '>= 0.0.5'
42
42
  spec.add_dependency 'zeitwerk', '~> 2.6'
@@ -4,7 +4,7 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "appraisal", "~> 2.4"
6
6
  gem "bundler", "~> 2.6"
7
- gem "countless", "~> 2.0"
7
+ gem "countless", "~> 2.2"
8
8
  gem "factory_bot_rails", "~> 6.2"
9
9
  gem "guard-rspec", "~> 4.7"
10
10
  gem "railties", ">= 7.1"
@@ -4,7 +4,7 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "appraisal", "~> 2.4"
6
6
  gem "bundler", "~> 2.6"
7
- gem "countless", "~> 2.0"
7
+ gem "countless", "~> 2.2"
8
8
  gem "factory_bot_rails", "~> 6.2"
9
9
  gem "guard-rspec", "~> 4.7"
10
10
  gem "railties", ">= 7.1"
@@ -4,7 +4,7 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "appraisal", "~> 2.4"
6
6
  gem "bundler", "~> 2.6"
7
- gem "countless", "~> 2.0"
7
+ gem "countless", "~> 2.2"
8
8
  gem "factory_bot_rails", "~> 6.2"
9
9
  gem "guard-rspec", "~> 4.7"
10
10
  gem "railties", ">= 7.1"
@@ -0,0 +1,22 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal", "~> 2.4"
6
+ gem "bundler", "~> 2.6"
7
+ gem "countless", "~> 2.2"
8
+ gem "factory_bot_rails", "~> 6.2"
9
+ gem "guard-rspec", "~> 4.7"
10
+ gem "railties", ">= 7.1"
11
+ gem "rspec-rails", "~> 7.1"
12
+ gem "rubocop"
13
+ gem "rubocop-rails"
14
+ gem "rubocop-rspec"
15
+ gem "simplecov", ">= 0.22"
16
+ gem "sqlite3", "~> 2.7"
17
+ gem "timecop", ">= 0.9.6"
18
+ gem "yard", ">= 0.9.28"
19
+ gem "yard-activesupport-concern", ">= 0.0.1"
20
+ gem "rails", "~> 8.1.0"
21
+
22
+ gemspec path: "../"
@@ -3,8 +3,46 @@
3
3
  module FactoryBot
4
4
  module Instrumentation
5
5
  # The configuration for the instrumentation API.
6
- class Configuration
7
- include ActiveSupport::Configurable
6
+ class Configuration < ActiveSupport::OrderedOptions
7
+ # Track our configurations settings (+Symbol+ keys) and their defaults as
8
+ # lazy-loaded +Proc+'s values
9
+ class_attribute :defaults,
10
+ instance_reader: true,
11
+ instance_writer: false,
12
+ instance_predicate: false,
13
+ default: {}
14
+
15
+ # Create a new +Configuration+ instance with all settings populated with
16
+ # their respective defaults.
17
+ #
18
+ # @param args [Hash{Symbol => Mixed}] additional settings which
19
+ # overwrite the defaults
20
+ # @return [Configuration] the new configuration instance
21
+ def initialize(**args)
22
+ super()
23
+ defaults.each { |key, default| self[key] = instance_exec(&default) }
24
+ merge!(**args)
25
+ end
26
+
27
+ # A simple DSL method to define new configuration accessors/settings with
28
+ # their defaults. The defaults can be retrieved with
29
+ # +Configuration.defaults+ or +Configuration.new.defaults+.
30
+ #
31
+ # @param name [Symbol, String] the name of the configuration
32
+ # accessor/setting
33
+ # @param default [Mixed, nil] a non-lazy-loaded static value, serving as
34
+ # a default value for the setting
35
+ # @param block [Proc] when given, the default value will be lazy-loaded
36
+ # (result of the Proc)
37
+ def self.config_accessor(name, default = nil, &block)
38
+ # Save the given configuration accessor default value
39
+ defaults[name.to_sym] = block || -> { default }
40
+
41
+ # Compile reader/writer methods so we don't have to go through
42
+ # +ActiveSupport::OrderedOptions#method_missing+.
43
+ define_method(name) { self[name] }
44
+ define_method("#{name}=") { |value| self[name] = value }
45
+ end
8
46
 
9
47
  # The instrumentation configuration file path we should use,
10
48
  # defaults to config/instrumentation.yml
@@ -4,7 +4,7 @@ module FactoryBot
4
4
  # The gem version details.
5
5
  module Instrumentation
6
6
  # The version of the +factory_bot_instrumentation+ gem
7
- VERSION = '2.0.0'
7
+ VERSION = '2.1.0'
8
8
 
9
9
  class << self
10
10
  # Returns the version of gem as a string.
@@ -4,9 +4,10 @@ require 'zeitwerk'
4
4
  require 'logger'
5
5
  require 'active_support'
6
6
  require 'active_support/concern'
7
- require 'active_support/configurable'
7
+ require 'active_support/ordered_options'
8
8
  require 'active_support/cache'
9
9
  require 'active_support/core_ext/hash'
10
+ require 'active_support/core_ext/class/attribute'
10
11
  require 'active_support/time'
11
12
  require 'active_support/time_with_zone'
12
13
  require 'retries'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: factory_bot_instrumentation
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hermann Mayer
@@ -55,16 +55,16 @@ dependencies:
55
55
  name: mutex_m
56
56
  requirement: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - "~>"
58
+ - - ">="
59
59
  - !ruby/object:Gem::Version
60
- version: 0.3.0
60
+ version: '0.3'
61
61
  type: :runtime
62
62
  prerelease: false
63
63
  version_requirements: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - "~>"
65
+ - - ">="
66
66
  - !ruby/object:Gem::Version
67
- version: 0.3.0
67
+ version: '0.3'
68
68
  - !ruby/object:Gem::Dependency
69
69
  name: rails
70
70
  requirement: !ruby/object:Gem::Requirement
@@ -169,6 +169,7 @@ files:
169
169
  - gemfiles/rails_7.1.gemfile
170
170
  - gemfiles/rails_7.2.gemfile
171
171
  - gemfiles/rails_8.0.gemfile
172
+ - gemfiles/rails_8.1.gemfile
172
173
  - lib/factory_bot/instrumentation.rb
173
174
  - lib/factory_bot/instrumentation/configuration.rb
174
175
  - lib/factory_bot/instrumentation/engine.rb