console 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dc372565fdcca828bd36391080df923729df6f902637a56740a2f7eb3e639188
4
- data.tar.gz: be63ec825ce033d4f882ff98ee038811b98d72dedfa577bfdb8453eeebf3dcd3
3
+ metadata.gz: 905a0b4a1dc6fc5ce11e3c8ddb2cddf17ea280cb8e59fec936e314e82cea8b6f
4
+ data.tar.gz: dc1bbe02f4e974fbec84385b2214f8ad27e8f2cd9cdeaf683bbe96645c613161
5
5
  SHA512:
6
- metadata.gz: 07d52f0ec479b661e6920d0942f3fa6aab1077706bdab02ab928025ef9c8e66e7066c6d39badac7778276eb1aaa13f5c715218aaf5c658a6b39fb22271d58aea
7
- data.tar.gz: d05e1500655f528b1f4ccdbaad80cfcdb19dd68ce1cd3201f1736ba0af05e06aa4a6ccd7d79505b6c5c9d8214cf93170a573f342753ed20008ac71aa9c53a73a
6
+ metadata.gz: 73dc76f42e3249c3ead06056dedef0e0eb37025f5389d14e200852a6a9355b7d968694090bdee8000f34f48241fbe90ebef45a4081b2949189adff16d977d5aa
7
+ data.tar.gz: 7f4a918850a457ff12de55006854cbc068b8cbd3a02a239e7587d9d64424cfcfffebd24400f3a12b1d5cd28b4140a6cd2c23bdd328a6ef4acd40bc9002384273
@@ -35,12 +35,18 @@ module Console
35
35
  end
36
36
 
37
37
  class Logger
38
- def initialize(io = $stderr, verbose: false, **options)
38
+ def initialize(io = $stderr, verbose: nil, **options)
39
39
  @io = io
40
- @verbose = verbose
41
40
  @start = Time.now
42
41
 
43
42
  @terminal = Terminal.for(io)
43
+
44
+ if verbose.nil?
45
+ @verbose = !@terminal.colors?
46
+ else
47
+ @verbose = verbose
48
+ end
49
+
44
50
  @terminal[:logger_prefix] ||= @terminal.style(nil, nil, :bold)
45
51
  @terminal[:logger_suffix] ||= @terminal.style(:white, nil, :faint)
46
52
  @terminal[:debug] = @terminal.style(:cyan)
@@ -37,6 +37,10 @@ module Console
37
37
  @styles[key] = value
38
38
  end
39
39
 
40
+ def colors?
41
+ false
42
+ end
43
+
40
44
  def style(foreground, background = nil, *attributes)
41
45
  end
42
46
 
@@ -50,6 +50,10 @@ module Console
50
50
  hidden: 8,
51
51
  }
52
52
 
53
+ def colors?
54
+ true
55
+ end
56
+
53
57
  def size
54
58
  @output.winsize
55
59
  end
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Console
22
- VERSION = "1.1.0"
22
+ VERSION = "1.1.1"
23
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: console
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
117
  requirements: []
118
- rubygems_version: 3.0.3
118
+ rubygems_version: 3.0.2
119
119
  signing_key:
120
120
  specification_version: 4
121
121
  summary: Beautiful logging for Ruby.