examples/test_method/ReflowText.rb in newt-0.9.7 vs examples/test_method/ReflowText.rb in newt-1.0.0.pre1
- old
+ new
@@ -1,24 +1,22 @@
#!/usr/bin/env ruby
require 'rubygems'
-require "newt"
+require 'newt'
-text = ""
+text = ''
width = 0
height = 0
begin
-
Newt::Screen.new
- text, width, height = Newt.reflow_text("This is a quite a bit of text. It is 40 " +
- "columns long, so some wrapping should be " +
- "done. Did you know that the quick, brown " +
- "fox jumped over the lazy dog?\n\n" +
- "In other news, it's pretty important that we " +
- "can properly force a line break.", 40, 5, 5)
-
+ text, width, height = Newt.reflow_text('This is a quite a bit of text. It is 40 ' \
+ 'columns long, so some wrapping should be ' \
+ 'done. Did you know that the quick, brown ' \
+ "fox jumped over the lazy dog?\n\n" \
+ "In other news, it's pretty important that we " \
+ 'can properly force a line break.', 40, 5, 5)
ensure
Newt::Screen.finish
end
p text