rubcat 0.5.0 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/rubcat +1 -0
- data/lib/rubcat/pretty_logcat.rb +8 -7
- data/lib/rubcat/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7195ee684462e7b33de2befa92e6d2d71ae35401
|
4
|
+
data.tar.gz: 23df5d73c0338b5b473e00fbd72b071b64cf7260
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b2f57ee39e302ffe3585b45a06620e9d519f4e95bc44b11c1dd18d4438ea2cedcfc9bbdc1ca0823e512ce59b230bc1c82070b8a665bb7ea1e04357dbae5682e
|
7
|
+
data.tar.gz: 2f84898aee725b718a32b55340eb2f64265404628a9b9cbbd92d2463f2153d49739c26199c8f19d4a7b64a87cd6b2672c8151f5f35cbb4fe592943680d064de1
|
data/exe/rubcat
CHANGED
data/lib/rubcat/pretty_logcat.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'io/console'
|
2
|
+
|
1
3
|
module Rubcat
|
2
4
|
class PrettyLogcat
|
3
5
|
attr_reader :opt, :last_tag
|
@@ -51,14 +53,13 @@ module Rubcat
|
|
51
53
|
end
|
52
54
|
end
|
53
55
|
|
54
|
-
def
|
55
|
-
|
56
|
+
def wrap_message(mes, type)
|
57
|
+
mes.scan(/.{1,#{IO.console.winsize[1] - @opt[:tag_length] - 5}}/).join("\n#{' ' * @opt[:tag_length]} #{type} ")
|
58
|
+
end
|
56
59
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
buf += mes[:message]
|
61
|
-
buf
|
60
|
+
def prettify(mes)
|
61
|
+
type = colorize_type mes[:type]
|
62
|
+
"#{format_tag mes[:tag]} #{type} #{wrap_message mes[:message], type}"
|
62
63
|
end
|
63
64
|
|
64
65
|
def echo(mes)
|
data/lib/rubcat/version.rb
CHANGED