ci_logger 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ci_logger/logger.rb +8 -0
- data/lib/ci_logger/version.rb +1 -1
- data/lib/ci_logger.rb +19 -22
- 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: 2ed98779d07fdac9af3859e89ca4a2785b6a1df26270efad3ead2bfd473086db
|
4
|
+
data.tar.gz: c27d8ba865ba4f56a6f6e13f541a86397b025ebaecca3c4207a376ca1a356db6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5175af5e43ed981ae562b29c9419b8540a5c1fed6ed0135427e837cd9edb2f5d2a1564cde2beb94f76f58b4881f951aace952ccff50b285ab7b85491eec212c1
|
7
|
+
data.tar.gz: 709748c62dfa5ff7bd848b908a188346c476432befe487a3b4087e1d50fee4b070744a8cd6c5ea608fb79da24ee8575d3647b0123a65acecd5badba65be41b57
|
data/lib/ci_logger/logger.rb
CHANGED
@@ -26,5 +26,13 @@ module CiLogger
|
|
26
26
|
end
|
27
27
|
temporary_log.clear
|
28
28
|
end
|
29
|
+
|
30
|
+
def method_missing(symbol, *args, &block)
|
31
|
+
@original.send(symbol, *args, &block)
|
32
|
+
end
|
33
|
+
|
34
|
+
def respond_to_missing?(symbol, include_all)
|
35
|
+
@original.respond_to?(symbol, include_all)
|
36
|
+
end
|
29
37
|
end
|
30
38
|
end
|
data/lib/ci_logger/version.rb
CHANGED
data/lib/ci_logger.rb
CHANGED
@@ -3,34 +3,31 @@ require "ci_logger/railtie"
|
|
3
3
|
require "ci_logger/logger"
|
4
4
|
|
5
5
|
module CiLogger
|
6
|
-
|
7
|
-
require "rspec/core"
|
6
|
+
require "rspec/core"
|
8
7
|
|
9
|
-
|
10
|
-
|
8
|
+
class Formatter
|
9
|
+
RSpec::Core::Formatters.register self, :example_passed, :example_pending, :example_failed
|
11
10
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
def example_failed(notification)
|
17
|
-
if Rails.application.config.ci_logger.enabled
|
18
|
-
example = notification.example
|
19
|
-
Rails.logger.debug("finish example at #{example.location}")
|
20
|
-
Rails.logger.sync
|
21
|
-
else
|
22
|
-
Rails.logger.clear
|
23
|
-
end
|
24
|
-
end
|
11
|
+
def initialize(_out)
|
12
|
+
@out = _out
|
13
|
+
end
|
25
14
|
|
26
|
-
|
15
|
+
def example_failed(notification)
|
16
|
+
if Rails.application.config.ci_logger.enabled
|
17
|
+
example = notification.example
|
18
|
+
Rails.logger.debug("finish example at #{example.location}")
|
19
|
+
Rails.logger.sync
|
20
|
+
else
|
27
21
|
Rails.logger.clear
|
28
22
|
end
|
23
|
+
end
|
29
24
|
|
30
|
-
|
31
|
-
|
32
|
-
|
25
|
+
def example_passed(_notification)
|
26
|
+
Rails.logger.clear
|
27
|
+
end
|
28
|
+
|
29
|
+
def example_pending(_notification)
|
30
|
+
Rails.logger.clear
|
33
31
|
end
|
34
|
-
rescue LoadError
|
35
32
|
end
|
36
33
|
end
|