factory_bot_instrumentation 1.1.4 → 1.1.5

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: 571f3fa6ccb358bd6e926c3836305e445e1912c72af314f41aec833d4284be09
4
- data.tar.gz: dce90925108b1c152139285393fa62fd6a12591caea8a84962fb1a2573583a0a
3
+ metadata.gz: 5e200ee9b6c940652aa1655e8be54bc38815e8ed59678315984320d34292e7c6
4
+ data.tar.gz: 0a74dd73fecc873a368010fdb6e445dda7d3be012452553bc552de1968140965
5
5
  SHA512:
6
- metadata.gz: b5b5a3de3c236e84626584810483896ad5be96c36d0ea80e5cc1136768b3540b222686362510576b77fe14cfadf7e738042baad5d0ac06d84a2d12c40c732ad2
7
- data.tar.gz: 131b882d7b7a0ddd8838a942c4afb982a6fefb1cacd552667d71baf23db002ee40bba4c78fd786f7b966d0195d2566112937a24d2a9a9090bca4a1708c471c08
6
+ metadata.gz: c79689fbe92b67f676532e0876b88352011193220409019dc630efdc75b6da971809a7d15333c8b6789f627e5b0239964ae0834c0f6748a71ae7860469f8b94b
7
+ data.tar.gz: d2bdbbf8c0e74e6335fa68a9b58f62dc48685e8a835bbcaaaca117e80cbfd89e61f48656030802afffd9ce202ee41f83ac9c245fbc2ddccf60cb0081c905f3e6
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  * TODO: Replace this bullet point with an actual description of a change.
4
4
 
5
+ ### 1.1.5
6
+
7
+ * Added fallbacks for configuration processing (#19)
8
+
5
9
  ### 1.1.4
6
10
 
7
11
  * Pinned factory_bot down to < 6.4.5 in order to support Ruby 2.5 (#18)
@@ -89,14 +89,15 @@ module FactoryBot
89
89
  config_file = FactoryBot::Instrumentation.configuration.config_file.to_s
90
90
  template = ERB.new(Pathname.new(config_file).read)
91
91
  load_method = YAML.respond_to?(:unsafe_load) ? :unsafe_load : :load
92
- YAML.send(load_method, template.result(binding))[Rails.env]
92
+ YAML.send(load_method, template.result(binding))[Rails.env] || {}
93
93
  end
94
94
 
95
95
  # Map all the instrumentation scenarios into groups and pass them back.
96
96
  #
97
97
  # @return [Hash{String => Array}] the grouped scenarios
98
98
  def scenarios
99
- instrumentation['scenarios'].each_with_object({}) do |scenario, memo|
99
+ res = (instrumentation['scenarios'] || [])
100
+ res.each_with_object({}) do |scenario, memo|
100
101
  group = scenario_group(scenario['name'])
101
102
  scenario['group'] = group
102
103
  memo[group] = [] unless memo.key? group
@@ -108,7 +109,7 @@ module FactoryBot
108
109
  #
109
110
  # @return [Hash{Regexp => String}] the group mapping
110
111
  def groups
111
- instrumentation['groups'].transform_keys do |key|
112
+ (instrumentation['groups'] || {}).transform_keys do |key|
112
113
  Regexp.new(Regexp.quote(key))
113
114
  end
114
115
  end
@@ -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 = '1.1.4'
7
+ VERSION = '1.1.5'
8
8
 
9
9
  class << self
10
10
  # Returns the version of gem as a string.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: factory_bot_instrumentation
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hermann Mayer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-05 00:00:00.000000000 Z
11
+ date: 2024-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: factory_bot