terratrash 1.0.0 → 1.1.1
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: b89718e8412a438147b507c1021647ade454ad4b86b8edb4ff248a798a718a92
|
4
|
+
data.tar.gz: d7bac31cfb0735c90db7d70a9d8680888593705696ec8aaa9aa36f053af64261
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 "
|
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.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:
|
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
|
'
|