factory_trace 1.0.1 → 1.1.1

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: 47392b8b4b5bd8c329e7068531793ea4773d086fcc44cc1a700e58f9b67c658d
4
- data.tar.gz: 17043ec1bbd6684fc8f0d9259439b3c767ec9748535168c37733c983094dd9da
3
+ metadata.gz: 4f96fa86fbf6703ba90060d717e50355b2cc85415b4d90946f9f721cc5466357
4
+ data.tar.gz: 8df9f0c7d0af6eea39fa550c38801553c6c928a552834ed6ad11a33332043831
5
5
  SHA512:
6
- metadata.gz: 90c73bd445d000bb676337b831829b5cfa83e46690676e4af6635e85d1536475d4b742b75ed09216a564b452318a2c86a3548849bded0f328002577ebba32c3f
7
- data.tar.gz: 174df9d321cde04ddb59892e389b9aa80b76f4a601c0ecefac48f350384bfa42cdd59815812096e7bb73fb13ad567513cf03de834de230780a0af0155ea4e698
6
+ metadata.gz: 02d294556286fb219bfd4a60eaccdcadba925b9911b3fe4b4620fdd3d390b52cd74f36d048c3b39899fd7174e07b5952fba70b35a03cef659fe5e81cf9d154c1
7
+ data.tar.gz: fae51c93bbd370bf841e16786dc41d292213ee856ded2513831f11e03b85a9edc5cd420105fe8dd028943bb3609f3bf396eac8d9ce2e9416248998c733e33d1a
@@ -5,7 +5,7 @@ module FactoryTrace
5
5
  module Factory
6
6
  attr_reader :definition_path
7
7
 
8
- def initialize(name, definition_path, options = {})
8
+ def initialize(name, definition_path = "", options = {})
9
9
  @definition_path = definition_path
10
10
  super(name, options)
11
11
  end
@@ -5,7 +5,7 @@ module FactoryTrace
5
5
  module Trait
6
6
  attr_reader :definition_path
7
7
 
8
- def initialize(name, definition_path, &block)
8
+ def initialize(name, definition_path = "", &block)
9
9
  @definition_path = definition_path
10
10
  super(name, &block)
11
11
  end
@@ -69,11 +69,11 @@ module FactoryTrace
69
69
  [nil, defined.find_trait_by_name(trait_name)]
70
70
  end
71
71
 
72
- # @param [FactoryTrace::Structures::Factory] factory
72
+ # @param [FactoryTrace::Structures::Factory, nil] factory
73
73
  # @param [FactoryTrace::Structures::Collection] collection
74
74
  # @param [Symbol] status
75
75
  def mark_factory(factory, collection, status:)
76
- return if factory.has_prioritized_status?(status)
76
+ return if factory.nil? || factory.has_prioritized_status?(status)
77
77
 
78
78
  factory.status = status
79
79
  if (parent = collection.find_factory_by_names([factory.parent_name]))
@@ -82,12 +82,12 @@ module FactoryTrace
82
82
  mark_declarations(factory.declaration_names, factory, collection, status: :indirectly_used)
83
83
  end
84
84
 
85
- # @param [FactoryTrace::Structures::Trait] trait
85
+ # @param [FactoryTrace::Structures::Trait, nil] trait
86
86
  # @param [FactoryTrace::Structures::Factory|nil] factory which trait belongs to
87
87
  # @param [FactoryTrace::Structures::Collection] collection
88
88
  # @param [Symbol] status
89
89
  def mark_trait(trait, factory, collection, status:)
90
- return if trait.has_prioritized_status?(status)
90
+ return if trait.nil? || trait.has_prioritized_status?(status)
91
91
 
92
92
  trait.status = status
93
93
  mark_declarations(trait.declaration_names, factory, collection, status: :indirectly_used)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FactoryTrace
4
- VERSION = "1.0.1"
4
+ VERSION = "1.1.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: factory_trace
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - djezzzl
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-23 00:00:00.000000000 Z
11
+ date: 2023-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: factory_bot
@@ -132,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
132
  - !ruby/object:Gem::Version
133
133
  version: '0'
134
134
  requirements: []
135
- rubygems_version: 3.2.33
135
+ rubygems_version: 3.1.6
136
136
  signing_key:
137
137
  specification_version: 4
138
138
  summary: Provide an easy way to maintain factories and traits from FactoryBot