aptible-cli 0.15.1 → 0.15.2

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
  SHA1:
3
- metadata.gz: 2aec11046fa93016d3c52c5372b13a997deda17e
4
- data.tar.gz: b52b602e6d89a5c4e104f8b59476f71aa458677d
3
+ metadata.gz: b735ade4836c4ba929254f889bad0ea9a28502eb
4
+ data.tar.gz: e18c6c6b47a6b21720e14634d75d1b4c3e518aa6
5
5
  SHA512:
6
- metadata.gz: cabaf10d1d361ffdd998d17bd2e77de1e9df12203aeb0f4dc3fdd53a7e76d615e0ab6e1087b8b6b9618ef16161d26a0340995d561e34b0d96bd92bfca8c8e5a8
7
- data.tar.gz: 975b2bac642626633ccc13055759586619d6a70d36ae3eba8cbb20869cbaa504c91912a1f816ac6060032b6c0c00f5f7453e98c4bf8343bc648aa19837c7775b
6
+ metadata.gz: 47592caa5dd3e6b6160b8cb6c6a83f4c3672950f6132fad0e664a6ab1bac31d766fb1eeb4cd3e11af73bc74f4c1af48a4dc031eef1a3fbbe58ada12b1a16a880
7
+ data.tar.gz: 30edf42a983136f8679f44aed8d734347ca16aa7e95e13f2468e181979f485e85979a3e55ac90e44bf85e1069524cea65cf4c7dc2e797f1cc7e10708f502d40c
@@ -9,7 +9,7 @@ require 'aptible/cli/resource_formatter'
9
9
 
10
10
  module Aptible
11
11
  module CLI
12
- class LogFormatter
12
+ class TtyLogFormatter
13
13
  include Term::ANSIColor
14
14
 
15
15
  def call(severity, _, _, msg)
@@ -34,9 +34,21 @@ module Aptible
34
34
  end
35
35
  end
36
36
 
37
+ class PlainLogFormatter
38
+ def call(_, _, _, msg)
39
+ "#{msg}\n"
40
+ end
41
+ end
42
+
37
43
  def self.logger
44
+ formatter_klass = if $stderr.tty?
45
+ TtyLogFormatter
46
+ else
47
+ PlainLogFormatter
48
+ end
49
+
38
50
  @logger ||= Logger.new($stderr).tap do |l|
39
- l.formatter = LogFormatter.new
51
+ l.formatter = formatter_klass.new
40
52
  end
41
53
  end
42
54
  end
@@ -1,5 +1,5 @@
1
1
  module Aptible
2
2
  module CLI
3
- VERSION = '0.15.1'.freeze
3
+ VERSION = '0.15.2'.freeze
4
4
  end
5
5
  end
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Aptible::CLI do
4
- describe described_class::LogFormatter do
4
+ describe described_class::TtyLogFormatter do
5
5
  subject do
6
6
  Logger.new(File.open(File::NULL, 'w')).tap do |l|
7
7
  l.formatter = described_class.new
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aptible-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.1
4
+ version: 0.15.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frank Macreery
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-22 00:00:00.000000000 Z
11
+ date: 2017-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aptible-resource