swak 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/swak.rb +5 -0
  2. metadata +1 -1
@@ -16,6 +16,11 @@ class String
16
16
  color_int = AnsiMap[color]
17
17
  return "[#{fg ? 3 : 4}#{color_int}m#{self}[#{fg ? 3 : 4}9m"
18
18
  end
19
+
20
+ def wrap(max_chars_per_line=80)
21
+ return gsub(/\n/," ").scan(/\S.{0,#{max_chars_per_line-2}}\S(?=\s|$)|\S+/).join("\n")
22
+ end
23
+
19
24
  end
20
25
 
21
26
  #######################################################
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: swak
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.8
5
+ version: 0.0.9
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jesse Rodriguez