soaspec 0.2.9 → 0.2.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +6 -0
- data/images/basic_demo.gif +0 -0
- data/lib/soaspec/demo.rb +4 -0
- data/lib/soaspec/spec_logger.rb +12 -2
- data/lib/soaspec/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 479264a2d576169c5b37f414b7c413991da0d58d
|
4
|
+
data.tar.gz: 1f7d26e2d200d735a376cf45c6cc829787439f4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6ad91dc7c734051b75c0c2308f5186aec8cb6eb215f949a54ecc9f0f466fa94e8dbf3a1ca9ab7374e1474f6543dec96682b5b1be7f9ad3de1126a5604b8665d
|
7
|
+
data.tar.gz: 02be37ad8dbb06ca077357c0edf94a5c3cbdef3e75ff13c74dda336283d4bf21ce14cf6fe5252d05d99faf24811ad368942e46228de16a77078855d56b2fe3e3
|
data/ChangeLog
CHANGED
data/images/basic_demo.gif
CHANGED
Binary file
|
data/lib/soaspec/demo.rb
ADDED
data/lib/soaspec/spec_logger.rb
CHANGED
@@ -3,6 +3,16 @@ require 'fileutils'
|
|
3
3
|
require 'colorize'
|
4
4
|
|
5
5
|
module Soaspec
|
6
|
+
# Custom class for logging API traffic
|
7
|
+
class ApiLogger < Logger
|
8
|
+
#
|
9
|
+
# Rewrite << to use info logger with formatting
|
10
|
+
#
|
11
|
+
def <<(msg)
|
12
|
+
info msg
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
6
16
|
# Handles logs of API requests and responses
|
7
17
|
class SpecLogger
|
8
18
|
# Folder to put API traffic logs
|
@@ -53,11 +63,11 @@ module Soaspec
|
|
53
63
|
# @return [Logger] Logger class to record API traffic
|
54
64
|
def create
|
55
65
|
create_log_file
|
56
|
-
@logger =
|
66
|
+
@logger = ApiLogger.new(traffic_file) # Where request and responses of APIs are stored
|
57
67
|
@logger.formatter = proc do |severity, datetime, _progname, msg|
|
58
68
|
message = "SpecLog, [#{datetime.strftime('%Y-%m-%d_%H:%M:%S')}] #{severity} -- : #{msg}\n"
|
59
69
|
print message.colorize(:light_blue) if @output_to_terminal
|
60
|
-
message
|
70
|
+
message if @output_to_file
|
61
71
|
end
|
62
72
|
@logger
|
63
73
|
end
|
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.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SamuelGarrattIQA
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -402,6 +402,7 @@ files:
|
|
402
402
|
- lib/soaspec.rb
|
403
403
|
- lib/soaspec/core_ext/hash.rb
|
404
404
|
- lib/soaspec/cucumber/generic_steps.rb
|
405
|
+
- lib/soaspec/demo.rb
|
405
406
|
- lib/soaspec/exchange.rb
|
406
407
|
- lib/soaspec/exchange_handlers/exchange_handler.rb
|
407
408
|
- lib/soaspec/exchange_handlers/handler_accessors.rb
|