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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MTA4Njg0ZjA2MzI4NGE0YzhmZGY1YWVmMDQ2NGVhNjE4MDFjNGM4Mg==
4
+ OWIzMWE3OTM0ZWNkMDFkZGQyMzY4ODdmMTQ3MzVlMDI5MzA1YTgzZg==
5
5
  data.tar.gz: !binary |-
6
- OTU1ZWFiYTVhNDRmMjVlZWJmMDVjNGZiMjI1OWY3NmUwMGI4YzJkZg==
6
+ N2M1NTg4OGZlMDUyNTVhYWJkOTZlZDA2ZWQzYmY3MDA5YTNlOGQwMw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZDA2MjRmZjZjYjc3NDNmZjFjYTdiOGIxZjYzYzFkMDdmZGNlMjhiNmQ2MWFm
10
- ZmFkOTgzMDBjYTlmOGQ3OTFjMzA3ZWU3Njc4MWFkNzVkOTk1MDU5NzIyYTZi
11
- NDNjMzdlZWExNDQxOThhYzRlZWQ2YTQyODQwMjFlNzk0NTc1MDM=
9
+ NzkyMmYwZjdhMjYzNWVhN2IwNDg1N2Y0OTg5MmI5M2IyMTQyNjkzZTc5ODI4
10
+ M2MzY2FiN2Y4M2U2OGNkYzdkM2FiNzZjZmI1OTA2ZjE4ODNmNjQ0NzY4Y2Zh
11
+ NWI2NDBlMDQ4NjNhYmRmNzg5NzUxNjNhNjYzYzUzZDcyYTYwYWI=
12
12
  data.tar.gz: !binary |-
13
- NTRjN2IwOTM3YzlmOGJjNGQwOWRmN2YyZTM5Y2I0ZmM2YzU0YTY1YWU3OGQ5
14
- ZjlkN2JmM2I4ZGY1MWYxYzJhN2MwOTg1YjY1N2ZiNGZlMjM1Y2QxNmJlMTIx
15
- YjRmZjZkYWVmYWRhNzY3MGMxMDJhMTNhOWZmNzRkYjdiMjUwMWQ=
13
+ OGQzYjRiN2JlNTM3Y2NmMjMxNWU0NGE3ZTg1ZjY1MjAwMDU4MzU4NzFiNjNh
14
+ MjJjMjZlMmFkZmE5ZWIyNGNjNWFmYjk0YTUwOTU2ZDM3ZmJlYTMzYjcwZWNh
15
+ NDVkNjQ4MDdmNjZkZmZkMTI2YWJkZDI3MjVmYTE4OTc5NGYzMmI=
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- flare-up (0.5)
4
+ flare-up (0.6)
5
5
  pg (~> 0.17)
6
6
  thor (~> 0.19)
7
7
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module FlareUp
2
- VERSION = '0.5'
2
+ VERSION = '0.6'
3
3
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flare-up
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.5'
4
+ version: '0.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Slifka