simple-cli 0.2.13 → 0.2.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -1
- data/lib/simple/cli/logger/colored_logger.rb +16 -11
- data/lib/simple/cli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d714d999f8069077ef849bff674186ce9193c87eefe58ff16353e3bf4954d4b
|
4
|
+
data.tar.gz: 15a25e1c5a82904ca2a0dbf745ab5bf52e236e5994129a061f4c643048da7fc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a872e36574bd2f953a9f52454c7819f83def3423e73a9a4275b1dd86b79494cd78e4daf4ef1a18b45788bddb0e438a192c1afc7ae333f6f4454d0733488916a7
|
7
|
+
data.tar.gz: 4df8a912dd4006b0151ccef5d38151823007f567f34b546e2ccbb87226845803a5a657196d6705c2b0cce7f6070e7a30d983cd68161bd8c18997fa3ae2fc66e3
|
data/.gitignore
CHANGED
@@ -38,24 +38,24 @@ module Simple::CLI::Logger::ColoredLogger
|
|
38
38
|
success: :green,
|
39
39
|
}
|
40
40
|
|
41
|
-
def debug(msg, *args)
|
42
|
-
log :debug, msg, *args
|
41
|
+
def debug(msg = nil, *args, &block)
|
42
|
+
log :debug, msg, *args, &block
|
43
43
|
end
|
44
44
|
|
45
|
-
def info(msg, *args)
|
46
|
-
log :info, msg, *args
|
45
|
+
def info(msg, *args, &block)
|
46
|
+
log :info, msg, *args, &block
|
47
47
|
end
|
48
48
|
|
49
|
-
def warn(msg, *args)
|
50
|
-
log :warn, msg, *args
|
49
|
+
def warn(msg, *args, &block)
|
50
|
+
log :warn, msg, *args, &block
|
51
51
|
end
|
52
52
|
|
53
|
-
def error(msg, *args)
|
54
|
-
log :error, msg, *args
|
53
|
+
def error(msg, *args, &block)
|
54
|
+
log :error, msg, *args, &block
|
55
55
|
end
|
56
56
|
|
57
|
-
def success(msg, *args)
|
58
|
-
log :success, msg, *args
|
57
|
+
def success(msg, *args, &block)
|
58
|
+
log :success, msg, *args, &block
|
59
59
|
end
|
60
60
|
|
61
61
|
private
|
@@ -68,11 +68,16 @@ module Simple::CLI::Logger::ColoredLogger
|
|
68
68
|
success: ::Logger::INFO
|
69
69
|
}
|
70
70
|
|
71
|
-
def log(sym, msg, *args)
|
71
|
+
def log(sym, msg, *args, &block)
|
72
72
|
log_level = level
|
73
73
|
required_log_level = REQUIRED_LOG_LEVELS.fetch(sym)
|
74
74
|
return if required_log_level < log_level
|
75
75
|
|
76
|
+
if msg.nil? && args.empty? && block
|
77
|
+
msg = yield
|
78
|
+
return if msg.nil?
|
79
|
+
end
|
80
|
+
|
76
81
|
formatted_runtime = "%.3f secs" % (Time.now - @@started_at)
|
77
82
|
msg = "[#{formatted_runtime}] #{msg}"
|
78
83
|
unless args.empty?
|
data/lib/simple/cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- radiospiel
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-12-
|
12
|
+
date: 2018-12-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|