checky 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5c7632f5e923a3db7eeca0cde073ec14a11037d9
4
- data.tar.gz: 121f40694b9a98c7633e94b8d98adff71d450427
3
+ metadata.gz: 6f5211f352cc22299a362100a3af4dcd181b63a1
4
+ data.tar.gz: '008ac31645d50d4981fae14015dcc89bc9e00d62'
5
5
  SHA512:
6
- metadata.gz: 3fdfade0a5872da467a1fefb90a902945e6cd97a499f82f8e33a917b867d16486f4fa8f3784398260e36bcff83ea8f715b4b4981034d7ecd21adaf3b1031950e
7
- data.tar.gz: a87e717b2606e601c6df8f0ca81be0d2af53ead1b441c5b53bc514f9ff06d368653aa3e697816e561f46d378bc12dbf13602b409710b36d74e41e404d62dfc14
6
+ metadata.gz: e54f99fc3c7d66a7756ad3687d197a9b12d948e55f5331b312b6e76d629045e5c63f535c3bd5b4e0de48bde5b7ce514f82188c701aeaf6aadfa5f822856ff329
7
+ data.tar.gz: 7c17bee2e337f6a2b848a89fbc0e204534b625ea153925fdb34d572ffa22ab41ff4c3d59c7ee96ce195665f0b605325d98655184ec1f5beb4d20c9e0eea88749
@@ -18,7 +18,7 @@ require 'checky/validators/all'
18
18
  require 'checky/checker'
19
19
 
20
20
  module Checky
21
- attr_accessor :colorize
21
+ attr_accessor :pastel
22
22
 
23
23
  def check(&block)
24
24
  Checker.new.check(&block)
@@ -30,14 +30,14 @@ module Checky
30
30
  end
31
31
  # :nocov:
32
32
 
33
- module_function :check, :run, :colorize, :colorize=
33
+ module_function :check, :run, :pastel, :pastel=
34
34
  end
35
35
 
36
36
  # :nocov:
37
37
  begin
38
- require 'colorize'
39
- Checky.colorize = true
38
+ require 'pastel'
39
+ Checky.pastel = ::Pastel.new
40
40
  rescue LoadError
41
- Checky.colorize = false
41
+ Checky.pastel = false
42
42
  end
43
43
  # :nocov:
@@ -41,13 +41,11 @@ module Checky
41
41
  end
42
42
 
43
43
  def result_message(key)
44
- result = storage.checky_results[key]
44
+ pastel = Checky.pastel
45
+ message = storage.checky_results[key] ? 'OK' : 'FAIL'
45
46
 
46
- if Checky.colorize
47
- result ? 'OK'.green : 'FAIL'.red
48
- else
49
- result ? 'OK' : 'FAIL'
50
- end
47
+ return pastel.decorate(message, { 'OK' => :green, 'FAIL' => :red }[message]) if pastel
48
+ message
51
49
  end
52
50
 
53
51
  module_function :display_message, :build_message, :format_message, :result_message
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Checky
3
- VERSION = '0.1.2'
3
+ VERSION = '0.1.3'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: checky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Rzegocki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-19 00:00:00.000000000 Z
11
+ date: 2017-01-04 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Dependencies checker for CLI tools
14
14
  email: