terratrash 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/terratrash.rb +15 -2
- data/lib/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 512dccd28c1ca1c465ade79ccccb107bd778d4d3930e5b48e39b646c847ebbd5
|
4
|
+
data.tar.gz: 717f69ab8aa6fbc41f52edf6549abd0ec28e838d987a9c97e7ba7de010d4fdad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e68d9392765d838f6e1c750d73da02d49032a0bf878f44509ba6cfb200cad5c0ee30f192be34e36c2ad960e5321550e29d3604877596f53a6089e04fab2dc7cd
|
7
|
+
data.tar.gz: 4d712fd10ba282e6c13cb053d5057f08e645e52ac4297f46eec95b55c36d6355ede9a879708d85a90c7dcfe53eee1733e3ad9ce212bc6781acf95174f7c71839
|
data/lib/terratrash.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "
|
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 ||
|
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
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.
|
4
|
+
version: 1.1.0
|
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-
|
12
|
-
dependencies:
|
11
|
+
date: 2023-12-06 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
|
'
|