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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 17d2693e9fd08ec36b86235d2fd0a5991ef252a3
4
- data.tar.gz: 68ec551ebe49f36c211a9fd856c3b5b669f3b5f8
3
+ metadata.gz: 479264a2d576169c5b37f414b7c413991da0d58d
4
+ data.tar.gz: 1f7d26e2d200d735a376cf45c6cc829787439f4d
5
5
  SHA512:
6
- metadata.gz: 718d1fde689c36a4e96fc0ac61645151de132c3202a7213e21a8adad01c48b0aa6a76cfb057597c86b6e0e31177ef69dfcf88139e2f9285ad93c9e279b14c872
7
- data.tar.gz: 7f2808840766e5ae179efc5ae3afd3e9d91364f92bc3196db8b7432df29df3bd0e19eef5d149bea6a817198468ee075dfcca5a2b26a120dc6e9aff2d8425ab76
6
+ metadata.gz: a6ad91dc7c734051b75c0c2308f5186aec8cb6eb215f949a54ecc9f0f466fa94e8dbf3a1ca9ab7374e1474f6543dec96682b5b1be7f9ad3de1126a5604b8665d
7
+ data.tar.gz: 02be37ad8dbb06ca077357c0edf94a5c3cbdef3e75ff13c74dda336283d4bf21ce14cf6fe5252d05d99faf24811ad368942e46228de16a77078855d56b2fe3e3
data/ChangeLog CHANGED
@@ -1,3 +1,9 @@
1
+ Version 0.2.10
2
+ * Enhancements
3
+ * Added 'soaspec/demo' to be required to simplify demoing
4
+ * Bug Fix
5
+ * Logging wasn't handling Rest log properly
6
+
1
7
  Version 0.2.9
2
8
  * Enhancements
3
9
  * More documentation in README.md
Binary file
@@ -0,0 +1,4 @@
1
+ # Load this file for demoing Soaspec (e.g in IRB). Has common settings applicable for demoing
2
+
3
+ require_relative '../soaspec'
4
+ Soaspec::SpecLogger.output_to_terminal = true
@@ -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 = Logger.new(traffic_file) # Where request and responses of APIs are stored
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
@@ -1,3 +1,3 @@
1
1
  module Soaspec
2
- VERSION = '0.2.9'.freeze
2
+ VERSION = '0.2.10'.freeze
3
3
  end
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.9
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-16 00:00:00.000000000 Z
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