terratrash 1.0.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/terratrash.rb +15 -2
  3. data/lib/version.rb +1 -1
  4. metadata +17 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 713aba792eee558047dca021febbdca3c57ced109c9544108547b74a469689c7
4
- data.tar.gz: aa71a496bb8e83fcfe0d5377ff6ad0abf765663b7368368626422ba83698a490
3
+ metadata.gz: b89718e8412a438147b507c1021647ade454ad4b86b8edb4ff248a798a718a92
4
+ data.tar.gz: d7bac31cfb0735c90db7d70a9d8680888593705696ec8aaa9aa36f053af64261
5
5
  SHA512:
6
- metadata.gz: 2bc5639b326cbe48260cd87ffc1ceec483a9dcead26fa98fc354e575dbcef8e73fce0700c929ac88284cbc3eeaa764aae054250a9413eba6a7e0222f144a5453
7
- data.tar.gz: 9fb816b459d65183d09fba4bff83bcbc4ed8ca55c1049ca0cfb988127b1c7b01612910f232e83e3909a0bd79e2f3ca556dd24265da886b18108becd728d17c31
6
+ metadata.gz: ce4e94be2255707c9d11dad410889f4812a6872ba0703aa200b66aa0391487decc57280c2ec3d6cd66bea962d45f4b31bb3d389196076b966c97ba38ba77530b
7
+ data.tar.gz: 868561097ef85c55d0019805839df26fcb0b7209c84731ddf13187c59463d6f97906eae30c19713553947c01c892390318cfb97afe9f6a9a6d72860bfe37e963
data/lib/terratrash.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "logger"
3
+ require "redacting_logger"
4
4
 
5
5
  class Terratrash
6
6
  def initialize(
@@ -10,7 +10,7 @@ class Terratrash
10
10
  remove_pipe_blocks: true,
11
11
  add_final_newline: true
12
12
  )
13
- @log = logger || Logger.new($stdout, level: ENV.fetch("LOG_LEVEL", "INFO").upcase)
13
+ @log = logger || setup_logger
14
14
  @remove_warnings = remove_warnings # if true, remove terraform warnings
15
15
  @remove_notes = remove_notes # if true, remove terraform notes
16
16
  @remove_pipe_blocks = remove_pipe_blocks # if true, remove terraform blocks with piped characters
@@ -73,6 +73,19 @@ class Terratrash
73
73
 
74
74
  private
75
75
 
76
+ # Private class method to setup a redacting logger
77
+ # :return: a redacting logger
78
+ def setup_logger
79
+ $stdout.sync = true # don't buffer - flush immediately
80
+ RedactingLogger.new(
81
+ $stdout, # The device to log to (defaults to $stdout if not provided)
82
+ # redact_patterns: [],
83
+ level: ENV.fetch("LOG_LEVEL", "INFO").upcase, # The log level to use
84
+ redacted_msg: "[REDACTED]", # The message to replace the redacted patterns with
85
+ use_default_patterns: true # Whether to use the default built-in patterns or not
86
+ )
87
+ end
88
+
76
89
  # Helper function to remove GitHub Actions output / debug messages
77
90
  # :input input_array: an array of strings
78
91
  # :return input_array: the same array of strings, but with GitHub Actions output removed
data/lib/version.rb CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Terratrash
4
4
  module Version
5
- VERSION = "1.0.0"
5
+ VERSION = "1.1.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: terratrash
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grant Birkinbine
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-03 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2024-02-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: redacting-logger
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
13
27
  description: 'A Ruby gem to discard (trash) unwanted Terraform output for humans
14
28
 
15
29
  '