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 +4 -4
- data/.github/workflows/release.yml +1 -1
- data/.github/workflows/test.yml +1 -1
- data/.rubocop.yml +1 -1
- data/Appraisals +4 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile +1 -1
- data/factory_bot_instrumentation.gemspec +1 -1
- data/gemfiles/rails_7.1.gemfile +1 -1
- data/gemfiles/rails_7.2.gemfile +1 -1
- data/gemfiles/rails_8.0.gemfile +1 -1
- data/gemfiles/rails_8.1.gemfile +22 -0
- data/lib/factory_bot/instrumentation/configuration.rb +40 -2
- data/lib/factory_bot/instrumentation/version.rb +1 -1
- data/lib/factory_bot/instrumentation.rb +2 -1
- metadata +6 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 22779b2ddcf2a843745a37630a9c9195cdee2ec476aba7ff9f384ba3479d8bc7
|
|
4
|
+
data.tar.gz: 0c8aafc7fe54a6bd757c2d35193fbe45ec184d7c3714048a800c54225cfbacf2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8c9b1fcbb5f85e3deb47cbbe308841e29ce06dd300ae0085e3728e6a68a3341d70aad86f7ca9efd563f5fa82469ed1ba422c6b3f5cbc86af238c66800d6602a0
|
|
7
|
+
data.tar.gz: fd1a95d7b69759f6e4f8b491948c2d688f45294909decde13b95b4625341445868cb40c6150b1e091dde8ed13ebabebf1557002eabd14752b3f5338ed59466a3
|
data/.github/workflows/test.yml
CHANGED
data/.rubocop.yml
CHANGED
data/Appraisals
CHANGED
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
|
@@ -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', '
|
|
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'
|
data/gemfiles/rails_7.1.gemfile
CHANGED
data/gemfiles/rails_7.2.gemfile
CHANGED
data/gemfiles/rails_8.0.gemfile
CHANGED
|
@@ -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
|
-
|
|
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,9 +4,10 @@ require 'zeitwerk'
|
|
|
4
4
|
require 'logger'
|
|
5
5
|
require 'active_support'
|
|
6
6
|
require 'active_support/concern'
|
|
7
|
-
require 'active_support/
|
|
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.
|
|
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
|
|
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
|
|
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
|