factory_trace 0.4.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/factory_trace +2 -1
- data/lib/factory_trace/configuration.rb +8 -6
- data/lib/factory_trace/helpers/caller.rb +3 -1
- data/lib/factory_trace/helpers/converter.rb +3 -1
- data/lib/factory_trace/helpers/statusable.rb +2 -0
- data/lib/factory_trace/monkey_patches/definition_proxy.rb +2 -0
- data/lib/factory_trace/monkey_patches/dsl.rb +3 -1
- data/lib/factory_trace/monkey_patches/factory.rb +2 -0
- data/lib/factory_trace/monkey_patches/monkey_patches.rb +3 -1
- data/lib/factory_trace/monkey_patches/trait.rb +2 -0
- data/lib/factory_trace/preprocessors/extract_defined.rb +2 -0
- data/lib/factory_trace/preprocessors/extract_used.rb +2 -0
- data/lib/factory_trace/processors/find_unused.rb +93 -90
- data/lib/factory_trace/readers/trace_reader.rb +13 -11
- data/lib/factory_trace/structures/collection.rb +5 -3
- data/lib/factory_trace/structures/factory.rb +9 -7
- data/lib/factory_trace/structures/trait.rb +5 -3
- data/lib/factory_trace/tracker.rb +5 -1
- data/lib/factory_trace/version.rb +3 -1
- data/lib/factory_trace/writers/report_writer.rb +8 -7
- data/lib/factory_trace/writers/trace_writer.rb +2 -0
- data/lib/factory_trace/writers/writer.rb +2 -0
- data/lib/factory_trace.rb +28 -26
- data/lib/integrations/rspec.rb +2 -1
- metadata +17 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc2882cfec07c5a45a8cf464027b593f4e97891b4a959b49a061acec3728bd41
|
4
|
+
data.tar.gz: dbcfce3c2e80b177a108f7761477b09f404818cf3794f15ae30b4c1c286ac2a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06a0383bfda293f51aac40e74c5a45512652832c7911be4ca751da4940d889c99cd442008433addee8040f60e271276579bb5db34c6d668813e53e6e00a8793e
|
7
|
+
data.tar.gz: cf7d58dd17a8be295da9aa51acba56c4cfa4ba353055ff5d75bb5d6bead9ce125c99e588c19fc9f5ec25bba9c945557fec15ce86cb1901232fd52e5f43046888
|
data/exe/factory_trace
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
$LOAD_PATH.unshift("#{__dir__}/../lib")
|
4
|
-
require
|
5
|
+
require "factory_trace"
|
5
6
|
|
6
7
|
fail "You should pass at least one file with traced information.\nYou can generate it using only_trace mode." if ARGV.empty?
|
7
8
|
|
@@ -1,12 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module FactoryTrace
|
2
4
|
class Configuration
|
3
5
|
attr_accessor :path, :enabled, :color, :mode, :trace_definition
|
4
6
|
|
5
7
|
def initialize
|
6
|
-
@enabled = ENV.key?(
|
7
|
-
@path = ENV[
|
8
|
+
@enabled = ENV.key?("FB_TRACE") || ENV.key?("FB_TRACE_FILE")
|
9
|
+
@path = ENV["FB_TRACE_FILE"]
|
8
10
|
@color = path.nil?
|
9
|
-
@mode = extract_mode(ENV[
|
11
|
+
@mode = extract_mode(ENV["FB_TRACE"]) || :full
|
10
12
|
@trace_definition = true
|
11
13
|
end
|
12
14
|
|
@@ -15,9 +17,9 @@ module FactoryTrace
|
|
15
17
|
end
|
16
18
|
|
17
19
|
def out
|
18
|
-
return
|
20
|
+
return $stdout unless path
|
19
21
|
|
20
|
-
File.open(path,
|
22
|
+
File.open(path, "w")
|
21
23
|
end
|
22
24
|
|
23
25
|
def mode?(*args)
|
@@ -27,7 +29,7 @@ module FactoryTrace
|
|
27
29
|
private
|
28
30
|
|
29
31
|
def extract_mode(value)
|
30
|
-
matcher = value
|
32
|
+
matcher = value&.match(/full|trace_only/)
|
31
33
|
matcher && matcher[0].to_sym
|
32
34
|
end
|
33
35
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module FactoryTrace
|
2
4
|
module Helpers
|
3
5
|
module Caller
|
@@ -5,7 +7,7 @@ module FactoryTrace
|
|
5
7
|
|
6
8
|
# @return [String] file and line where the original method was called
|
7
9
|
def location
|
8
|
-
location = caller_locations
|
10
|
+
location = caller_locations(2..2).first
|
9
11
|
|
10
12
|
base = Pathname.new(Dir.pwd)
|
11
13
|
method = Pathname.new(location.path)
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module FactoryTrace
|
2
4
|
module Helpers
|
3
5
|
module Converter
|
@@ -32,7 +34,7 @@ module FactoryTrace
|
|
32
34
|
# @return [Array<String>]
|
33
35
|
def extract_declarations(structure)
|
34
36
|
(structure.definition.declarations.grep(FactoryBot::Declaration::Implicit).map(&:name).map(&:to_s) +
|
35
|
-
structure.definition.instance_variable_get(
|
37
|
+
structure.definition.instance_variable_get(:@base_traits).map(&:to_s)).uniq
|
36
38
|
end
|
37
39
|
end
|
38
40
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module FactoryTrace
|
2
4
|
module MonkeyPatches
|
3
5
|
module Default
|
@@ -6,7 +8,7 @@ module FactoryTrace
|
|
6
8
|
caller_location = options.delete(:caller_location) || Helpers::Caller.location
|
7
9
|
factory = FactoryBot::Factory.new(name, caller_location, options)
|
8
10
|
proxy = FactoryBot::DefinitionProxy.new(factory.definition)
|
9
|
-
proxy.instance_eval(&block) if
|
11
|
+
proxy.instance_eval(&block) if block
|
10
12
|
|
11
13
|
REGISTER.register_factory(factory)
|
12
14
|
|
@@ -1,117 +1,120 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module FactoryTrace
|
2
4
|
module Processors
|
3
5
|
class FindUnused
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
6
|
+
class << self
|
7
|
+
# Finds unused factories and traits
|
8
|
+
#
|
9
|
+
# @param [FactoryTrace::Structures::Collection] defined
|
10
|
+
# @param [FactoryTrace::Structures::Collection] used
|
11
|
+
#
|
12
|
+
# @return [Array<Hash>]
|
13
|
+
def call(defined, used)
|
14
|
+
mark_as_used(defined, used)
|
15
|
+
|
16
|
+
output = []
|
17
|
+
|
18
|
+
defined.factories.each do |factory|
|
19
|
+
output << append_definition_path({code: :unused, factory_names: factory.names}, factory) unless factory.status
|
20
|
+
|
21
|
+
factory.traits.each do |trait|
|
22
|
+
output << append_definition_path({code: :unused, factory_names: factory.names, trait_name: trait.name}, trait) unless trait.status
|
23
|
+
end
|
20
24
|
end
|
21
|
-
end
|
22
25
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
+
defined.traits.each do |trait|
|
27
|
+
output << append_definition_path({code: :unused, trait_name: trait.name}, trait) unless trait.status
|
28
|
+
end
|
26
29
|
|
27
|
-
|
28
|
-
|
30
|
+
output.unshift(code: :unused, value: output.size)
|
31
|
+
output.unshift(code: :used, value: defined.total - (output.size - 1))
|
29
32
|
|
30
|
-
|
31
|
-
|
33
|
+
output
|
34
|
+
end
|
32
35
|
|
33
|
-
|
36
|
+
private
|
34
37
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
38
|
+
# @param [FactoryTrace::Structures::Collection] defined
|
39
|
+
# @param [FactoryTrace::Structures::Collection] used
|
40
|
+
def mark_as_used(defined, used)
|
41
|
+
used.factories.each do |used_factory|
|
42
|
+
defined_factory = defined.find_factory_by_names(used_factory.names)
|
43
|
+
mark_factory(defined_factory, defined, status: :used)
|
41
44
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
+
used_factory.traits.each do |used_trait|
|
46
|
+
trait_owner, defined_trait = defined_trait_by_name(defined, used_factory, used_trait.name)
|
47
|
+
mark_trait(defined_trait, trait_owner, defined, status: :used)
|
48
|
+
end
|
45
49
|
end
|
46
50
|
end
|
47
|
-
end
|
48
51
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
52
|
+
# @param [FactoryTrace::Structures::Collection] defined
|
53
|
+
# @param [FactoryTrace::Structures::Factory|nil] factory
|
54
|
+
# @param [String] trait_name
|
55
|
+
#
|
56
|
+
# @return [Array<Object>]
|
57
|
+
def defined_trait_by_name(defined, factory, trait_name)
|
58
|
+
if factory
|
59
|
+
possible_owner = defined.find_factory_by_names(factory.names)
|
60
|
+
|
61
|
+
while possible_owner
|
62
|
+
if (trait = possible_owner.traits.find { |t| t.name == trait_name })
|
63
|
+
return [possible_owner, trait]
|
64
|
+
end
|
65
|
+
possible_owner = defined.find_factory_by_names([possible_owner.parent_name])
|
61
66
|
end
|
62
|
-
possible_owner = defined.find_factory_by_names([possible_owner.parent_name])
|
63
67
|
end
|
64
|
-
end
|
65
68
|
|
69
|
+
[nil, defined.find_trait_by_name(trait_name)]
|
70
|
+
end
|
66
71
|
|
67
|
-
[
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
# @param [Symbol] status
|
73
|
-
def self.mark_factory(factory, collection, status:)
|
74
|
-
return if factory.has_prioritized_status?(status)
|
72
|
+
# @param [FactoryTrace::Structures::Factory] factory
|
73
|
+
# @param [FactoryTrace::Structures::Collection] collection
|
74
|
+
# @param [Symbol] status
|
75
|
+
def mark_factory(factory, collection, status:)
|
76
|
+
return if factory.has_prioritized_status?(status)
|
75
77
|
|
76
|
-
|
77
|
-
|
78
|
-
|
78
|
+
factory.status = status
|
79
|
+
if (parent = collection.find_factory_by_names([factory.parent_name]))
|
80
|
+
mark_factory(parent, collection, status: :indirectly_used)
|
81
|
+
end
|
82
|
+
mark_declarations(factory.declaration_names, factory, collection, status: :indirectly_used)
|
79
83
|
end
|
80
|
-
mark_declarations(factory.declaration_names, factory, collection, status: :indirectly_used)
|
81
|
-
end
|
82
84
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
85
|
+
# @param [FactoryTrace::Structures::Trait] trait
|
86
|
+
# @param [FactoryTrace::Structures::Factory|nil] factory which trait belongs to
|
87
|
+
# @param [FactoryTrace::Structures::Collection] collection
|
88
|
+
# @param [Symbol] status
|
89
|
+
def mark_trait(trait, factory, collection, status:)
|
90
|
+
return if trait.has_prioritized_status?(status)
|
89
91
|
|
90
|
-
|
91
|
-
|
92
|
-
|
92
|
+
trait.status = status
|
93
|
+
mark_declarations(trait.declaration_names, factory, collection, status: :indirectly_used)
|
94
|
+
end
|
93
95
|
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
96
|
+
# @param [Array<String>] declaration_names
|
97
|
+
# @param [FactoryTrace::Structures::Factory|nil] factory
|
98
|
+
# @param [FactoryTrace::Structures::Collection] collection
|
99
|
+
# @param [Symbol] status
|
100
|
+
def mark_declarations(declaration_names, factory, collection, status:)
|
101
|
+
declaration_names.each do |declaration_name|
|
102
|
+
declaration_factory = collection.find_factory_by_names([declaration_name])
|
103
|
+
next mark_factory(declaration_factory, collection, status: status) if declaration_factory
|
104
|
+
|
105
|
+
declaration_factory, declaration_trait = defined_trait_by_name(collection, factory, declaration_name)
|
106
|
+
mark_trait(declaration_trait, declaration_factory, collection, status: status) if declaration_trait
|
107
|
+
end
|
105
108
|
end
|
106
|
-
end
|
107
109
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
110
|
+
# @param [Hash]
|
111
|
+
# @param [FactoryTrace::Structures::Factory|FactoryTrace::Structures::Trait]
|
112
|
+
#
|
113
|
+
# @return [Hash]
|
114
|
+
def append_definition_path(hash, object)
|
115
|
+
hash[:definition_path] = object.definition_path if object.definition_path
|
116
|
+
hash
|
117
|
+
end
|
115
118
|
end
|
116
119
|
end
|
117
120
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module FactoryTrace
|
2
4
|
module Readers
|
3
5
|
class TraceReader
|
@@ -10,7 +12,7 @@ module FactoryTrace
|
|
10
12
|
result = {defined: FactoryTrace::Structures::Collection.new, used: FactoryTrace::Structures::Collection.new}
|
11
13
|
|
12
14
|
file_names.each do |file_name|
|
13
|
-
File.open(file_name,
|
15
|
+
File.open(file_name, "r") do |file|
|
14
16
|
data = new(file, configuration: configuration).read
|
15
17
|
|
16
18
|
[:defined, :used].each do |key|
|
@@ -34,35 +36,35 @@ module FactoryTrace
|
|
34
36
|
hash = JSON.parse(io.read)
|
35
37
|
|
36
38
|
{
|
37
|
-
defined: parse_collection(hash[
|
38
|
-
used: parse_collection(hash[
|
39
|
+
defined: parse_collection(hash["defined"]),
|
40
|
+
used: parse_collection(hash["used"])
|
39
41
|
}
|
40
42
|
end
|
41
43
|
|
42
44
|
private
|
43
45
|
|
44
46
|
def parse_trait(hash)
|
45
|
-
FactoryTrace::Structures::Trait.new(hash[
|
47
|
+
FactoryTrace::Structures::Trait.new(hash["name"], declaration_names: hash["declaration_names"], definition_path: hash["definition_path"])
|
46
48
|
end
|
47
49
|
|
48
50
|
def parse_factory(hash)
|
49
51
|
FactoryTrace::Structures::Factory.new(
|
50
|
-
hash[
|
51
|
-
hash[
|
52
|
-
parent_name: hash[
|
53
|
-
declaration_names: hash[
|
54
|
-
definition_path: hash[
|
52
|
+
hash["names"],
|
53
|
+
hash["traits"].map(&method(:parse_trait)),
|
54
|
+
parent_name: hash["parent_name"],
|
55
|
+
declaration_names: hash["declaration_names"],
|
56
|
+
definition_path: hash["definition_path"]
|
55
57
|
)
|
56
58
|
end
|
57
59
|
|
58
60
|
def parse_collection(hash)
|
59
61
|
collection = FactoryTrace::Structures::Collection.new
|
60
62
|
|
61
|
-
hash[
|
63
|
+
hash["factories"].each do |h|
|
62
64
|
collection.add(parse_factory(h))
|
63
65
|
end
|
64
66
|
|
65
|
-
hash[
|
67
|
+
hash["traits"].each do |h|
|
66
68
|
collection.add(parse_trait(h))
|
67
69
|
end
|
68
70
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module FactoryTrace
|
2
4
|
module Structures
|
3
5
|
class Collection
|
@@ -69,10 +71,10 @@ module FactoryTrace
|
|
69
71
|
end
|
70
72
|
|
71
73
|
# @return [Boolean]
|
72
|
-
def ==(
|
73
|
-
return false unless
|
74
|
+
def ==(other)
|
75
|
+
return false unless other.is_a?(FactoryTrace::Structures::Collection)
|
74
76
|
|
75
|
-
factories ==
|
77
|
+
factories == other.factories && traits == other.traits
|
76
78
|
end
|
77
79
|
end
|
78
80
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module FactoryTrace
|
2
4
|
module Structures
|
3
5
|
class Factory
|
@@ -39,14 +41,14 @@ module FactoryTrace
|
|
39
41
|
end
|
40
42
|
|
41
43
|
# @return [Boolean]
|
42
|
-
def ==(
|
43
|
-
return false unless
|
44
|
+
def ==(other)
|
45
|
+
return false unless other.is_a?(FactoryTrace::Structures::Factory)
|
44
46
|
|
45
|
-
names ==
|
46
|
-
traits ==
|
47
|
-
parent_name ==
|
48
|
-
declaration_names ==
|
49
|
-
definition_path ==
|
47
|
+
names == other.names &&
|
48
|
+
traits == other.traits &&
|
49
|
+
parent_name == other.parent_name &&
|
50
|
+
declaration_names == other.declaration_names &&
|
51
|
+
definition_path == other.definition_path
|
50
52
|
end
|
51
53
|
end
|
52
54
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module FactoryTrace
|
2
4
|
module Structures
|
3
5
|
class Trait
|
@@ -24,10 +26,10 @@ module FactoryTrace
|
|
24
26
|
end
|
25
27
|
|
26
28
|
# @return [Boolean]
|
27
|
-
def ==(
|
28
|
-
return false unless
|
29
|
+
def ==(other)
|
30
|
+
return false unless other.is_a?(FactoryTrace::Structures::Trait)
|
29
31
|
|
30
|
-
name ==
|
32
|
+
name == other.name && declaration_names == other.declaration_names && definition_path == other.definition_path
|
31
33
|
end
|
32
34
|
end
|
33
35
|
end
|
@@ -1,3 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "active_support"
|
4
|
+
|
1
5
|
module FactoryTrace
|
2
6
|
class Tracker
|
3
7
|
attr_reader :storage
|
@@ -7,7 +11,7 @@ module FactoryTrace
|
|
7
11
|
end
|
8
12
|
|
9
13
|
def track!
|
10
|
-
ActiveSupport::Notifications.subscribe(
|
14
|
+
ActiveSupport::Notifications.subscribe("factory_bot.run_factory") do |_name, _start, _finish, _id, payload|
|
11
15
|
name = payload[:name].to_s
|
12
16
|
traits = payload[:traits].map(&:to_s)
|
13
17
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module FactoryTrace
|
2
4
|
module Writers
|
3
5
|
class ReportWriter < Writer
|
@@ -9,8 +11,8 @@ module FactoryTrace
|
|
9
11
|
}.freeze
|
10
12
|
|
11
13
|
CODES = {
|
12
|
-
used:
|
13
|
-
unused:
|
14
|
+
used: "used",
|
15
|
+
unused: "unused"
|
14
16
|
}.freeze
|
15
17
|
|
16
18
|
# @param [Array<Hash>] results
|
@@ -27,12 +29,11 @@ module FactoryTrace
|
|
27
29
|
# @param [Hash<Symbol, Object>] result
|
28
30
|
# @param [Symbol] total_color
|
29
31
|
def convert(result, total_color:)
|
30
|
-
|
31
|
-
when result[:value]
|
32
|
+
if result[:value]
|
32
33
|
colorize(total_color, "total number of unique #{humanize_code(result[:code])} factories & traits: #{result[:value]}")
|
33
|
-
|
34
|
+
elsif result[:factory_names] && result[:trait_name]
|
34
35
|
append_definition_path(result) { "#{humanize_code(result[:code])} trait #{colorize(:blue, result[:trait_name])} of factory #{list(result[:factory_names])}" }
|
35
|
-
|
36
|
+
elsif result[:factory_names]
|
36
37
|
append_definition_path(result) { "#{humanize_code(result[:code])} factory #{list(result[:factory_names])}" }
|
37
38
|
else
|
38
39
|
append_definition_path(result) { "#{humanize_code(result[:code])} global trait #{colorize(:blue, result[:trait_name])}" }
|
@@ -57,7 +58,7 @@ module FactoryTrace
|
|
57
58
|
end
|
58
59
|
|
59
60
|
def list(elements, color: :blue)
|
60
|
-
elements.map { |element| colorize(color, element) }.join(
|
61
|
+
elements.map { |element| colorize(color, element) }.join(", ")
|
61
62
|
end
|
62
63
|
end
|
63
64
|
end
|
data/lib/factory_trace.rb
CHANGED
@@ -1,38 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# External dependencies
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
4
|
+
require "factory_bot"
|
5
|
+
require "json"
|
6
|
+
require "set"
|
7
|
+
require "pathname"
|
6
8
|
# Library
|
7
|
-
require
|
8
|
-
require
|
9
|
-
require
|
10
|
-
require
|
11
|
-
require
|
12
|
-
require
|
9
|
+
require "factory_trace/configuration"
|
10
|
+
require "factory_trace/version"
|
11
|
+
require "factory_trace/helpers/converter"
|
12
|
+
require "factory_trace/helpers/statusable"
|
13
|
+
require "factory_trace/helpers/caller"
|
14
|
+
require "factory_trace/tracker"
|
13
15
|
|
14
|
-
require
|
15
|
-
require
|
16
|
-
require
|
16
|
+
require "factory_trace/structures/factory"
|
17
|
+
require "factory_trace/structures/trait"
|
18
|
+
require "factory_trace/structures/collection"
|
17
19
|
|
18
|
-
require
|
19
|
-
require
|
20
|
+
require "factory_trace/preprocessors/extract_defined"
|
21
|
+
require "factory_trace/preprocessors/extract_used"
|
20
22
|
|
21
|
-
require
|
23
|
+
require "factory_trace/processors/find_unused"
|
22
24
|
|
23
|
-
require
|
24
|
-
require
|
25
|
-
require
|
26
|
-
require
|
25
|
+
require "factory_trace/readers/trace_reader"
|
26
|
+
require "factory_trace/writers/writer"
|
27
|
+
require "factory_trace/writers/report_writer"
|
28
|
+
require "factory_trace/writers/trace_writer"
|
27
29
|
|
28
|
-
require
|
29
|
-
require
|
30
|
-
require
|
31
|
-
require
|
32
|
-
require
|
30
|
+
require "factory_trace/monkey_patches/monkey_patches"
|
31
|
+
require "factory_trace/monkey_patches/factory"
|
32
|
+
require "factory_trace/monkey_patches/trait"
|
33
|
+
require "factory_trace/monkey_patches/definition_proxy"
|
34
|
+
require "factory_trace/monkey_patches/dsl"
|
33
35
|
|
34
36
|
# Integrations
|
35
|
-
require
|
37
|
+
require "integrations/rspec" if defined?(RSpec::Core)
|
36
38
|
|
37
39
|
module FactoryTrace
|
38
40
|
class << self
|
data/lib/integrations/rspec.rb
CHANGED
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: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- djezzzl
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: factory_bot
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '3.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec_junit_formatter
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.4'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.4'
|
69
83
|
description:
|
70
84
|
email:
|
71
85
|
- lawliet.djez@gmail.com
|
@@ -117,8 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
117
131
|
- !ruby/object:Gem::Version
|
118
132
|
version: '0'
|
119
133
|
requirements: []
|
120
|
-
|
121
|
-
rubygems_version: 2.7.9
|
134
|
+
rubygems_version: 3.1.6
|
122
135
|
signing_key:
|
123
136
|
specification_version: 4
|
124
137
|
summary: Provide an easy way to maintain factories and traits from FactoryBot
|