soaspec 0.2.13 → 0.2.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +4 -0
- data/lib/soaspec.rb +0 -2
- data/lib/soaspec/spec_logger.rb +24 -12
- data/lib/soaspec/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 110bae91f81c299800f9a29e7188cf4097b7d318
|
4
|
+
data.tar.gz: eac802e27d70316d243c4a28c24413164d16436f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb3b7ba536114cc6ab7ffc3b2d0fc20fd6134e4f95af8759ae6404f1a39f4e74ac9fe9a42c47af89bdbe826fdc78731c844b9401a298888c5b5d2cc384c1edf5
|
7
|
+
data.tar.gz: c8ed7a0cb504cee4df85e773e8ba585c59406d0c635ed6a312bd4c6c5d30ad9290aa1f3c4158780c9544cce75697a758879b783e082cdb8fde2378456c7865f7
|
data/ChangeLog
CHANGED
data/lib/soaspec.rb
CHANGED
data/lib/soaspec/spec_logger.rb
CHANGED
@@ -34,13 +34,30 @@ module Soaspec
|
|
34
34
|
attr_accessor :terminal_color
|
35
35
|
# Readers for log parameters
|
36
36
|
attr_reader :output_to_terminal, :output_to_file, :time_test_run
|
37
|
+
|
37
38
|
# Set file to log traffic to
|
38
|
-
|
39
|
+
def traffic_file=(file)
|
40
|
+
@traffic_file = file
|
41
|
+
reset_log
|
42
|
+
end
|
43
|
+
|
44
|
+
# @return [String] Traffic file to create logs at
|
45
|
+
def traffic_file
|
46
|
+
return File.join(traffic_folder, @traffic_file) if @traffic_file
|
47
|
+
|
48
|
+
filename = "traffic_#{time_test_run}.log"
|
49
|
+
File.join(traffic_folder, filename)
|
50
|
+
end
|
51
|
+
|
52
|
+
# Unset Logger object. It will be recreated on next time 'info' is called
|
53
|
+
def reset_log
|
54
|
+
@logger = nil
|
55
|
+
end
|
39
56
|
|
40
57
|
# Whether to log all API traffic
|
41
58
|
def log_api_traffic=(set)
|
42
59
|
@log_api_traffic = set
|
43
|
-
|
60
|
+
reset_log
|
44
61
|
end
|
45
62
|
|
46
63
|
# @return [Boolean] Whether to log all API traffic
|
@@ -51,21 +68,13 @@ module Soaspec
|
|
51
68
|
# @param [Symbol, Boolean] value # Whether to output API traffic to log file
|
52
69
|
def output_to_file=(value)
|
53
70
|
@output_to_file = value
|
54
|
-
|
71
|
+
reset_log
|
55
72
|
end
|
56
73
|
|
57
74
|
# @param [Symbol, Boolean] value # Whether to output API traffic to STDOUT
|
58
75
|
def output_to_terminal=(value)
|
59
76
|
@output_to_terminal = value
|
60
|
-
|
61
|
-
end
|
62
|
-
|
63
|
-
# @return [String] Traffic file to create logs at
|
64
|
-
def traffic_file
|
65
|
-
return File.join(traffic_folder, @traffic_file) if @traffic_file
|
66
|
-
|
67
|
-
filename = "traffic_#{time_test_run}.log"
|
68
|
-
File.join(traffic_folder, filename)
|
77
|
+
reset_log
|
69
78
|
end
|
70
79
|
|
71
80
|
# Create new log file if necessary and setup logging level
|
@@ -78,14 +87,17 @@ module Soaspec
|
|
78
87
|
print message.colorize(terminal_color) if @output_to_terminal
|
79
88
|
message if @output_to_file
|
80
89
|
end
|
90
|
+
RestClient.log = @logger
|
81
91
|
@logger
|
82
92
|
end
|
83
93
|
|
84
94
|
# Log a message using Soaspec logger
|
95
|
+
# Logger (and it's file) will be created if it's not already set
|
85
96
|
# @param [String] message The message to add to the logger
|
86
97
|
def info(message)
|
87
98
|
return unless log_api_traffic?
|
88
99
|
|
100
|
+
create unless @logger
|
89
101
|
if message.respond_to? :each
|
90
102
|
message.each do |message_item|
|
91
103
|
@logger.info(message_item)
|
data/lib/soaspec/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soaspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SamuelGarrattIQA
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|