colsole 0.1.3.pre → 0.1.4.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/colsole.rb +4 -8
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bafb72291698639e2a12345bbf7de2dfc75f261f
4
- data.tar.gz: ec45fb81a649e350b16b97d2bf7704e0920f6537
3
+ metadata.gz: e64bba685abbdc9b44bde978b040658f4ca6349b
4
+ data.tar.gz: 03d5b1228531560b7b6e81cc03bcc52c57686c1a
5
5
  SHA512:
6
- metadata.gz: 593f13b898d632c9b4b1d4c015ecdbfe67fc72fff6b2452110fd9ff854d237d9ffa574c3f723046eaf3446db2333b55e56a857529a525c062209eed2faa39035
7
- data.tar.gz: 47eaf0c846adb07fd7571175bd37607ba074b6b8311eb168cdece0e741878616e7a0c5a6a44d541fc281318864c2555791534d64c5f7ec7923f70a7733c701aa
6
+ metadata.gz: 8005f6be2991744f90b3f74e2d06ea488695f05e88993a2242457e785777877f6bc0947b8f73e3514e5945a07924c61af8fece3414c2a0de3b9cdb40074e3330
7
+ data.tar.gz: 2671a6ba76b6ac9a3f8e5c5a7840bf21d2a053d286fda0a083ecbc78f7e6c2cc284a399fdfa1bff90d92ffe24646145697c8eacfd4c0aa8dd92f08a4de8c75ed
data/lib/colsole.rb CHANGED
@@ -22,7 +22,7 @@ module Colsole
22
22
  if last == ' ' or last == '\t'
23
23
  print colorize text, force_color
24
24
  else
25
- print colorize "#{text}!txtrst!\n", $force_color;
25
+ print colorize "#{text}\n", force_color;
26
26
  end
27
27
  end
28
28
 
@@ -60,9 +60,6 @@ module Colsole
60
60
  # Converts a long string to be wrapped.
61
61
  # If the string starts with one or more spaces, they will be
62
62
  # preserved in all subsequent lines (i.e., remain indented).
63
- #--
64
- # TODO: this is currently not word wrap, but just wrap.
65
- # either rename or redo
66
63
  def word_wrap(str, length=80, character=$/)
67
64
  lead = str[/^\s+/]
68
65
  length -= lead.size
@@ -121,16 +118,15 @@ module Colsole
121
118
  esc = 27.chr
122
119
  reset = esc + colors['txtrst']
123
120
  if is_terminal or force_color
124
- reset_called_last = false
121
+ reset_called_last = true
125
122
 
126
- out = text.gsub /\!([a-z]{6})\!/ do |m|
123
+ out = text.gsub(/\!([a-z]{6})\!/) do |m|
127
124
  reset_called_last = $1 == "txtrst";
128
125
  esc + colors[$1];
129
126
  end
130
-
131
127
  reset_called_last or out = "#{out}#{reset}";
132
128
  else
133
- out = text.gsub /\!([a-z]{6})\!/, ''
129
+ out = text.gsub(/\!([a-z]{6})\!/, '')
134
130
  end
135
131
 
136
132
  return out
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: colsole
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3.pre
4
+ version: 0.1.4.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
@@ -17,7 +17,7 @@ extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
19
  - lib/colsole.rb
20
- homepage: http://sector-seven.net
20
+ homepage: https://github.com/DannyBen/colsole
21
21
  licenses:
22
22
  - MIT
23
23
  metadata: {}