stack_trace-rspec 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/stack_trace/rspec/version.rb +1 -1
- data/lib/stack_trace/rspec.rb +10 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c919857275574dcd0d3892bb2fae3b137e742de6fb542a0bdee4424aa0e5513
|
4
|
+
data.tar.gz: 43e7a4987ddc23299d00d1ee19405705d68f78875784a6e97b603cc3419e6c52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66fada6f46c3967efb4d99f6daad8a2bf6fe3419c079bb3f61ad4b41c89b92b67ddaf4e36fd635b304c423038ba7e4c64b8c9f15651dd26d9b13e74d5b7fd956
|
7
|
+
data.tar.gz: daa880aba8892dcedd3a3c00b559b50ef3aafe6a0b7018fe1e6847f5ef2ef2b459f42981c04f767537a1ada6afb1db48cb206c38d001cb52eac71922764b0452
|
data/Gemfile.lock
CHANGED
data/lib/stack_trace/rspec.rb
CHANGED
@@ -29,6 +29,8 @@ module StackTrace
|
|
29
29
|
|
30
30
|
class << self
|
31
31
|
def finish_tracing
|
32
|
+
ensure_path_is_created!
|
33
|
+
|
32
34
|
html.save(file_path)
|
33
35
|
.then { |path| print_message(path) }
|
34
36
|
end
|
@@ -39,6 +41,10 @@ module StackTrace
|
|
39
41
|
|
40
42
|
private
|
41
43
|
|
44
|
+
def ensure_path_is_created!
|
45
|
+
Dir.mkdir(file_dir) unless File.directory?(file_dir)
|
46
|
+
end
|
47
|
+
|
42
48
|
def html
|
43
49
|
@html ||= StackTrace::Viz::HTML.new
|
44
50
|
end
|
@@ -48,9 +54,12 @@ module StackTrace
|
|
48
54
|
end
|
49
55
|
|
50
56
|
def file_path
|
57
|
+
file_dir.join("#{SecureRandom.uuid}.html")
|
58
|
+
end
|
59
|
+
|
60
|
+
def file_dir
|
51
61
|
Pathname.new(RSpec.configuration.default_path)
|
52
62
|
.join("stack_trace")
|
53
|
-
.join("#{Securerandom.uuid}.html")
|
54
63
|
end
|
55
64
|
end
|
56
65
|
end
|