itamae 1.0.0.beta15 → 1.0.0.beta16

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: a4657957d6fb115404c29918274a42bcc7e5d7f8
4
- data.tar.gz: 2b65a054f3b5392fc4e7b45fd671674db2165c7b
3
+ metadata.gz: af7d4bb27ff01452de7a18a4746c839a6e8acb39
4
+ data.tar.gz: 81c20c90b909d57b4bbf55c3bc0e8e436a00d314
5
5
  SHA512:
6
- metadata.gz: 969f3e764a9b68af434f0107e05afbd4c60627fccb63bf1bab8489c53d459607c9a67eb9950be781240f577d30c0a4c96f42af8cdd8e90b68ea5892259954bdf
7
- data.tar.gz: 95bb689a0f74296b960699dc2e644489528658b8d7e81a8bbbdf9f7da9194f3ec00945f46408cba4c887f18f6e399d1fe933fa49203102e613196e6877c322e3
6
+ metadata.gz: 0615f89f2348df43c96f003a792f71443425dff36c1851b937727f18937978583c630298b1d710e494304474af484d00a8117f67bc89ecf46cde3c8e66c73fe2
7
+ data.tar.gz: 4440f3fa23bb0d0cb4be68d4b9d87c62bc815b45df972d42b895e6e229c531a1aaf1dee1391346838afd91bb5822bda72cfb731bf549411b4bf4a01291ad205f
data/lib/itamae/cli.rb CHANGED
@@ -10,6 +10,7 @@ module Itamae
10
10
  super
11
11
 
12
12
  Itamae::Logger.level = ::Logger.const_get(options[:log_level].upcase)
13
+ Itamae::Logger.formatter.colored = options[:color]
13
14
  end
14
15
 
15
16
  desc "local RECIPE [RECIPE...]", "Run Itamae locally"
data/lib/itamae/logger.rb CHANGED
@@ -5,8 +5,15 @@ require 'ansi/code'
5
5
  module Itamae
6
6
  module Logger
7
7
  class Formatter
8
+ attr_accessor :colored
9
+
8
10
  def call(severity, datetime, progname, msg)
9
- severity = color("%5s" % severity, severity)
11
+ severity = "%5s" % severity
12
+
13
+ if colored
14
+ severity = color(severity, severity)
15
+ end
16
+
10
17
  "[%s] %s : %s\n" % [format_datetime(datetime), severity, msg2str(msg)]
11
18
  end
12
19
 
@@ -40,18 +47,20 @@ module Itamae
40
47
  end
41
48
  end
42
49
 
43
- def self.logger
44
- @logger ||= ::Logger.new($stdout).tap do |logger|
45
- logger.formatter = Formatter.new
50
+ class << self
51
+ def logger
52
+ @logger ||= ::Logger.new($stdout).tap do |logger|
53
+ logger.formatter = Formatter.new
54
+ end
46
55
  end
47
- end
48
56
 
49
- def self.logger=(l)
50
- @logger = l
51
- end
57
+ def logger=(l)
58
+ @logger = l
59
+ end
52
60
 
53
- def self.method_missing(method, *args, &block)
54
- logger.public_send(method, *args, &block)
61
+ def method_missing(method, *args, &block)
62
+ logger.public_send(method, *args, &block)
63
+ end
55
64
  end
56
65
  end
57
66
  end
@@ -1 +1 @@
1
- 1.0.0.beta15
1
+ 1.0.0.beta16
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta15
4
+ version: 1.0.0.beta16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryota Arai