soaspec 0.2.12 → 0.2.13

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: 70554212f6b7e667767a9d38f2c3b9c2f0bfec96
4
- data.tar.gz: 3eaae9121a99e8b9a48b4f25ecb5a17178158e7c
3
+ metadata.gz: f0083db30d4a6c0ecee3867fd083318cb06fb971
4
+ data.tar.gz: 4a09507a106955ee4d8728f2335a69641189bdbe
5
5
  SHA512:
6
- metadata.gz: 6c7f0b3de2c2c31778410004db25705e3a561617be0e227be1c913e7b22e741b471fea0ce5ce2e575ea8f134dc39db5e28f9bbc61d7a0ccb17bace96e94a7500
7
- data.tar.gz: 5deb9f12a6b63ec3e0077ca84c79ff625ee90e0cd86a7fadc60924ea0b3e98b8b85fd6274304ac2b54c930c960ec229dc9c3dbd0c2595de17a3fecea62541535
6
+ metadata.gz: adfe9d60caad2441f1b83c0aef71ba7f56bb4d4cfad85890422fcc9ffa3ad262c467f3571094d6bc03d1e105fe56e882c441daa2de1ca266bfb3b8b9ffdfc773
7
+ data.tar.gz: e82c9d480898b80c549892048695d80fd733df5c91fdf90fa330aebe5c5bec44a7831aaae7fbdb64c6f60ba475b513d671c1cd2e2dd07efacfcd3ac2b3e82087
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ Version 0.2.13
2
+ * Enhancements
3
+ * Allow terminal logging color to be changed through a `terminal_color` attribute
4
+
1
5
  Version 0.2.12
2
6
  * Enhancements
3
7
  * Make it easier to set 'traffic_file' location with `Soaspec::SpecLogger.traffic_file = ''`
data/README.md CHANGED
@@ -175,6 +175,10 @@ expect(@exchange['message']).to include 'success'
175
175
  expect(@exchange.status_code).to eq 200
176
176
  ```
177
177
 
178
+ ### Authentication
179
+
180
+ See [the wiki](https://gitlab.com/samuel-garratt/soaspec/wikis/Authentication) for details.
181
+
178
182
  ## Logging
179
183
 
180
184
  By default traffic is logged to a file in the `logs` folder called `traffic_DATETIME.log`.
@@ -182,7 +186,26 @@ By default traffic is logged to a file in the `logs` folder called `traffic_DATE
182
186
  The `SpecLogger` class is responsible for handling all the logs.
183
187
 
184
188
  To change the output file location to 'custom.log':
185
- `Soaspec::SpecLogger.traffic_file = 'custom.log'`
189
+ ```ruby
190
+ Soaspec::SpecLogger.traffic_file = 'custom.log'
191
+ ```
192
+
193
+ To change the folder the default log is:
194
+
195
+ ```ruby
196
+ Soaspec::SpecLogger.traffic_folder = 'custom_folder'
197
+ ```
198
+
199
+ To disable logging to a file set the 'output_to_file' to 'false'.
200
+ ```ruby
201
+ Soaspec::SpecLogger.output_to_file = false
202
+ ```
203
+ There is a similar parameter to logging to the terminal, STDOUT (by default false).
204
+ You can also change the color of this output with the `terminal_color` attribute.
205
+ ```ruby
206
+ Soaspec::SpecLogger.output_to_terminal = true
207
+ Soaspec::SpecLogger.terminal_color = :magenta
208
+ ```
186
209
 
187
210
  ## Development
188
211
 
@@ -19,6 +19,8 @@ module Soaspec
19
19
  @traffic_folder = 'logs'
20
20
  # Whether to output api traffic to terminal
21
21
  @output_to_terminal = false
22
+ # Color shown when displaying in terminal
23
+ @terminal_color = :light_blue
22
24
  # Whether to output API traffic to log file
23
25
  @output_to_file = true
24
26
  # Time test run. Will only be calculated once once called
@@ -28,6 +30,8 @@ module Soaspec
28
30
  class << self
29
31
  # Folder to put API traffic logs
30
32
  attr_accessor :traffic_folder
33
+ # Color shown when displaying in terminal
34
+ attr_accessor :terminal_color
31
35
  # Readers for log parameters
32
36
  attr_reader :output_to_terminal, :output_to_file, :time_test_run
33
37
  # Set file to log traffic to
@@ -71,7 +75,7 @@ module Soaspec
71
75
  @logger = ApiLogger.new(traffic_file) # Where request and responses of APIs are stored
72
76
  @logger.formatter = proc do |severity, datetime, _progname, msg|
73
77
  message = "SpecLog, [#{datetime.strftime('%Y-%m-%d_%H:%M:%S')}] #{severity} -- : #{msg}\n"
74
- print message.colorize(:light_blue) if @output_to_terminal
78
+ print message.colorize(terminal_color) if @output_to_terminal
75
79
  message if @output_to_file
76
80
  end
77
81
  @logger
@@ -1,3 +1,3 @@
1
1
  module Soaspec
2
- VERSION = '0.2.12'.freeze
2
+ VERSION = '0.2.13'.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.12
4
+ version: 0.2.13
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-10 00:00:00.000000000 Z
11
+ date: 2019-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler