flare-up 0.5 → 0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Gemfile.lock +1 -1
- data/lib/flare_up/emitter.rb +1 -1
- data/lib/flare_up/version.rb +1 -1
- data/spec/lib/flare_up/emitter_spec.rb +22 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OWIzMWE3OTM0ZWNkMDFkZGQyMzY4ODdmMTQ3MzVlMDI5MzA1YTgzZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
N2M1NTg4OGZlMDUyNTVhYWJkOTZlZDA2ZWQzYmY3MDA5YTNlOGQwMw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzkyMmYwZjdhMjYzNWVhN2IwNDg1N2Y0OTg5MmI5M2IyMTQyNjkzZTc5ODI4
|
10
|
+
M2MzY2FiN2Y4M2U2OGNkYzdkM2FiNzZjZmI1OTA2ZjE4ODNmNjQ0NzY4Y2Zh
|
11
|
+
NWI2NDBlMDQ4NjNhYmRmNzg5NzUxNjNhNjYzYzUzZDcyYTYwYWI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OGQzYjRiN2JlNTM3Y2NmMjMxNWU0NGE3ZTg1ZjY1MjAwMDU4MzU4NzFiNjNh
|
14
|
+
MjJjMjZlMmFkZmE5ZWIyNGNjNWFmYjk0YTUwOTU2ZDM3ZmJlYTMzYjcwZWNh
|
15
|
+
NDVkNjQ4MDdmNjZkZmZkMTI2YWJkZDI3MjVmYTE4OTc5NGYzMmI=
|
data/Gemfile.lock
CHANGED
data/lib/flare_up/emitter.rb
CHANGED
@@ -22,7 +22,7 @@ module FlareUp
|
|
22
22
|
# TODO: How do we test this?
|
23
23
|
def self.sanitize(message)
|
24
24
|
RISKY_OPTIONS.each do |risky_option|
|
25
|
-
message.gsub!(@BOOT_OPTIONS[risky_option], 'REDACTED')
|
25
|
+
message.gsub!(@BOOT_OPTIONS[risky_option], 'REDACTED') if @BOOT_OPTIONS[risky_option]
|
26
26
|
end
|
27
27
|
message.gsub!(/\e\[(\d+)(;\d+)*m/, '') unless @BOOT_OPTIONS[:colorize_output]
|
28
28
|
message
|
data/lib/flare_up/version.rb
CHANGED
@@ -1,3 +1,25 @@
|
|
1
1
|
describe FlareUp::Emitter do
|
2
2
|
|
3
|
+
describe '.sanitize' do
|
4
|
+
|
5
|
+
context 'when colorize output is disabled' do
|
6
|
+
before do
|
7
|
+
FlareUp::Emitter.store_options({:colorize_output => false})
|
8
|
+
end
|
9
|
+
it 'should remove color codes' do
|
10
|
+
expect(FlareUp::Emitter.sanitize("\x1b[31mHello, World")).to eq('Hello, World')
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
context 'when a risky option is being output' do
|
15
|
+
before do
|
16
|
+
FlareUp::Emitter.store_options({:aws_access_key => 'foo'})
|
17
|
+
end
|
18
|
+
it 'should hide it' do
|
19
|
+
expect(FlareUp::Emitter.sanitize('Hellofoo')).to eq('HelloREDACTED')
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
3
25
|
end
|