aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v6/txt_shared.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2014-06-19 22:36:38 -0400
committerRalph Amissah <ralph@amissah.com>2014-06-19 22:36:38 -0400
commitea5affb331624b72a7a5a7ac5614e2d19f347c4d (patch)
tree2db6a88dc15f0019741254a2a3ea5f78236ef2ff /lib/sisu/v6/txt_shared.rb
parentdebian/changelog (5.4.0-1) (diff)
parentvim syntax, code block, language syntax; box group; quote (diff)
Merge tag 'sisu_5.4.1' into debian/sid
SiSU 5.4.1
Diffstat (limited to 'lib/sisu/v6/txt_shared.rb')
-rw-r--r--lib/sisu/v6/txt_shared.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/sisu/v6/txt_shared.rb b/lib/sisu/v6/txt_shared.rb
index 8d2a09b7..3159844f 100644
--- a/lib/sisu/v6/txt_shared.rb
+++ b/lib/sisu/v6/txt_shared.rb
@@ -62,8 +62,8 @@
=end
module SiSU_TextUtils
class Wrap
- def initialize(para='',n_char_max=76,n_indent=0,n_hang=nil)
- @para,@n_char_max,@n_indent=para,n_char_max,n_indent
+ def initialize(para='',n_char_max=76,n_indent=0,n_hang=nil,post='')
+ @para,@n_char_max,@n_indent,@post,=para,n_char_max,n_indent,post
@n_char_max_extend = n_char_max
@n_hang=n_hang ? n_hang : @n_indent
end
@@ -110,7 +110,10 @@ module SiSU_TextUtils
end
@oldword=word if word =~/\S+/
end
- spaces_hang + out.join(spaces_indent)
+ post=(@post.empty?) \
+ ? ''
+ : "\n" + (' '*@n_indent) +@post
+ spaces_hang + out.join(spaces_indent) + post
end
def line_wrap_indent1
@n_indent,@n_hang=2,2