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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5d070fdb6a7da0d911ec0b46b1b3b69c4b1df9c2
4
- data.tar.gz: 7281898da7aa59b18f394c3b51bae5496e1141bc
3
+ metadata.gz: 7195ee684462e7b33de2befa92e6d2d71ae35401
4
+ data.tar.gz: 23df5d73c0338b5b473e00fbd72b071b64cf7260
5
5
  SHA512:
6
- metadata.gz: c6b6d84e6c105b5f335bfa110c89d84a50699f1f390a75804c84caed4dac3672c086a759ad73bf5ae0bd6cb3b68be70335102a2532bf5b607445127edeb11ccf
7
- data.tar.gz: 79e9bc53d51c36ba864c0094511ca4f7d71c10a9a3fbef6407d73fac77fc0f944ef91a716eb249c6396a406725f818968008630493c2ea52e8087076ed6f7793
6
+ metadata.gz: 1b2f57ee39e302ffe3585b45a06620e9d519f4e95bc44b11c1dd18d4438ea2cedcfc9bbdc1ca0823e512ce59b230bc1c82070b8a665bb7ea1e04357dbae5682e
7
+ data.tar.gz: 2f84898aee725b718a32b55340eb2f64265404628a9b9cbbd92d2463f2153d49739c26199c8f19d4a7b64a87cd6b2672c8151f5f35cbb4fe592943680d064de1
data/exe/rubcat CHANGED
@@ -12,6 +12,7 @@ opt = OptionParser.new
12
12
 
13
13
  OPTS = {}
14
14
 
15
+ opt.version = Rubcat::VERSION
15
16
  opt.on('-d') { |v| flags << " -d" }
16
17
  opt.on('-l {V,D,I,W,E,F}', '--level={V,D,I,W,E,F}', 'Minimul level to display') { |v|
17
18
  if %w{V D I W E F}.include? v
@@ -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 prettify(mes)
55
- buf = format_tag mes[:tag]
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
- buf += " "
58
- buf += colorize_type mes[:type]
59
- buf += " "
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)
@@ -1,3 +1,3 @@
1
1
  module Rubcat
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubcat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - polamjag