dvla-herodotus 2.3.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a7ab39a7a9de4f2f315d5ce951f3a65ad947c04a889d140c8ab70dbdc64e76b3
4
- data.tar.gz: c722a9497a06673983412e4f02dacb6daf073c1461f9eedad0b1f6e80b9ea04d
3
+ metadata.gz: d295b22355aa8831f1ae6a1401560b06e3ab22da60647a68a2e2f11d4ed19087
4
+ data.tar.gz: 9a18e2310d62f1bb9f71a5785b4714e18ebac9d7ef68bd7b27aafd46fb3b80d0
5
5
  SHA512:
6
- metadata.gz: 35163204de97ea6c7c44799e81bf45918dd9018de639f849a33bcdd5be83be246cf099f251b5588c9e8160c40f06448b6870819888d8cd6e997442b203f365bf
7
- data.tar.gz: 5cee93b36fca277bae58494570f35250a29b9f2947c0c9cd794dfd20e38ea9850930fdb26a55cf324f6df1f14279cc4adc449e193c84b36b9cc1bfee9c28cb5b
6
+ metadata.gz: 57be084aba32ce6c0a938442600ae034fe0ae31ebc7a77ffe0605137ce10a28d6fdd346311708e3f242330005cc513523faff67052b745def965588b9d18bbf0
7
+ data.tar.gz: 240ad9c21db389debbad9a36f2dfe22fd7142b7ace789d0cf40825003e5ecc353a210e64d0151c0272aa5f4e142c41ee03f26a92b40ccdf2c31fe1d70322c24f
data/.gitignore CHANGED
@@ -9,4 +9,5 @@
9
9
 
10
10
  /.idea
11
11
 
12
- Gemfile.lock
12
+ Gemfile.lock
13
+ /test-path
data/CHANGELOG.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # Changelog
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [2.3.1] - 2025-11-21
5
+ - Fixed issue with output_path in create_logger, will now make a directory if it did not exist
6
+
4
7
  ## [2.3.0] - 2025-10-05
5
8
  - Config block can now accept prefix colour options. Can be applied to the whole prefix or configure individual components.
6
9
 
@@ -1,5 +1,5 @@
1
1
  module DVLA
2
2
  module Herodotus
3
- VERSION = '2.3.0'.freeze
3
+ VERSION = '2.3.1'.freeze
4
4
  end
5
5
  end
@@ -1,4 +1,5 @@
1
1
  require 'logger'
2
+ require 'fileutils'
2
3
  require_relative 'herodotus/herodotus_logger'
3
4
  require_relative 'herodotus/multi_writer'
4
5
  require_relative 'herodotus/proc_writer'
@@ -25,9 +26,11 @@ module DVLA
25
26
  private_class_method def self.create_logger(system_name, config, output_path)
26
27
  if output_path
27
28
  if output_path.is_a? String
29
+ ensure_directory_exists(output_path: output_path)
28
30
  output_file = File.open(output_path, 'a')
29
31
  return HerodotusLogger.new(system_name, MultiWriter.new(output_file, $stdout), config: config)
30
32
  elsif output_path.is_a? Proc
33
+ ensure_directory_exists(output_path: output_path.call)
31
34
  proc_writer = ProcWriter.new(output_path)
32
35
  return HerodotusLogger.new(system_name, MultiWriter.new(proc_writer, $stdout), config: config)
33
36
  else
@@ -36,5 +39,12 @@ module DVLA
36
39
  end
37
40
  HerodotusLogger.new(system_name, $stdout, config: config)
38
41
  end
42
+
43
+ private_class_method def self.ensure_directory_exists(output_path:)
44
+ directory = File.split(output_path).first
45
+ unless File.directory?(directory)
46
+ FileUtils.mkdir_p(directory)
47
+ end
48
+ end
39
49
  end
40
50
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dvla-herodotus
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Driver and Vehicle Licensing Agency (DVLA)
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2025-10-24 00:00:00.000000000 Z
12
+ date: 2025-12-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dvla-lint