rbhex-core 1.1.0.alpha3 → 1.1.0.alpha4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +1 -1
- data/examples/atree.rb +1 -1
- data/examples/common/file.rb +2 -2
- data/examples/dbdemo.rb +1 -1
- data/examples/newtabbedwindow.rb +1 -1
- data/examples/newtesttabp.rb +4 -4
- data/examples/testbuttons.rb +3 -3
- data/examples/testcombo.rb +2 -2
- data/examples/testfields.rb +3 -3
- data/examples/testkeypress.rb +4 -4
- data/examples/testlistbox.rb +5 -5
- data/examples/testmessagebox.rb +4 -4
- data/examples/testprogress.rb +1 -1
- data/examples/testree.rb +3 -3
- data/examples/testwsshortcuts.rb +2 -2
- data/examples/testwsshortcuts2.rb +3 -3
- data/lib/rbhex/core/include/action.rb +2 -2
- data/lib/rbhex/core/include/actionmanager.rb +1 -1
- data/lib/rbhex/core/include/appmethods.rb +4 -4
- data/lib/rbhex/core/include/bordertitle.rb +6 -6
- data/lib/rbhex/core/include/chunk.rb +1 -1
- data/lib/rbhex/core/include/io.rb +2 -2
- data/lib/rbhex/core/include/listbindings.rb +2 -2
- data/lib/rbhex/core/include/listcellrenderer.rb +3 -3
- data/lib/rbhex/core/include/listscrollable.rb +1 -1
- data/lib/rbhex/core/include/listselectable.rb +13 -13
- data/lib/rbhex/core/include/multibuffer.rb +5 -5
- data/lib/rbhex/core/include/ractionevent.rb +4 -4
- data/lib/rbhex/core/include/rchangeevent.rb +3 -3
- data/lib/rbhex/core/include/rhistory.rb +1 -1
- data/lib/rbhex/core/include/rinputdataevent.rb +6 -6
- data/lib/rbhex/core/include/vieditable.rb +1 -1
- data/lib/rbhex/core/include/widgetmenu.rb +1 -1
- data/lib/rbhex/core/system/colormap.rb +1 -1
- data/lib/rbhex/core/system/ncurses.rb +1 -1
- data/lib/rbhex/core/system/window.rb +1 -1
- data/lib/rbhex/core/util/ansiparser.rb +1 -1
- data/lib/rbhex/core/util/app.rb +7 -7
- data/lib/rbhex/core/util/basestack.rb +20 -20
- data/lib/rbhex/core/util/bottomline.rb +2 -2
- data/lib/rbhex/core/util/colorparser.rb +1 -1
- data/lib/rbhex/core/util/focusmanager.rb +1 -1
- data/lib/rbhex/core/util/padreader.rb +2 -2
- data/lib/rbhex/core/util/rcommandwindow.rb +2 -2
- data/lib/rbhex/core/util/rdialogs.rb +7 -7
- data/lib/rbhex/core/util/viewer.rb +5 -5
- data/lib/rbhex/core/util/widgetshortcuts.rb +3 -3
- data/lib/rbhex/core/version.rb +1 -1
- data/lib/rbhex/core/widgets/applicationheader.rb +2 -2
- data/lib/rbhex/core/widgets/box.rb +3 -3
- data/lib/rbhex/core/widgets/divider.rb +2 -2
- data/lib/rbhex/core/widgets/keylabelprinter.rb +2 -2
- data/lib/rbhex/core/widgets/rcombo.rb +5 -5
- data/lib/rbhex/core/widgets/rcontainer.rb +2 -2
- data/lib/rbhex/core/widgets/rlink.rb +1 -1
- data/lib/rbhex/core/widgets/rlist.rb +1 -1
- data/lib/rbhex/core/widgets/rmenu.rb +15 -15
- data/lib/rbhex/core/widgets/rmenulink.rb +1 -1
- data/lib/rbhex/core/widgets/rmessagebox.rb +6 -6
- data/lib/rbhex/core/widgets/rprogress.rb +2 -2
- data/lib/rbhex/core/widgets/rtabbedpane.rb +3 -3
- data/lib/rbhex/core/widgets/rtabbedwindow.rb +2 -2
- data/lib/rbhex/core/widgets/rtextarea.rb +2 -2
- data/lib/rbhex/core/widgets/rtextview.rb +3 -3
- data/lib/rbhex/core/widgets/rtree.rb +6 -6
- data/lib/rbhex/core/widgets/rwidget.rb +12 -12
- data/lib/rbhex/core/widgets/scrollbar.rb +2 -2
- data/lib/rbhex/core/widgets/statusline.rb +1 -1
- data/lib/rbhex/core/widgets/tabular.rb +32 -32
- data/lib/rbhex/core/widgets/tabularwidget.rb +3 -3
- data/lib/rbhex/core/widgets/textpad.rb +3 -3
- data/lib/rbhex/core/widgets/tree/treecellrenderer.rb +3 -3
- data/lib/rbhex/core/widgets/tree/treemodel.rb +3 -3
- metadata +11 -11
@@ -23,12 +23,12 @@
|
|
23
23
|
require 'rbhex/core'
|
24
24
|
require 'rbhex/core/include/bordertitle'
|
25
25
|
|
26
|
-
include
|
27
|
-
module
|
26
|
+
include Rbhex
|
27
|
+
module Rbhex
|
28
28
|
extend self
|
29
29
|
class MessageBox
|
30
30
|
include BorderTitle
|
31
|
-
include
|
31
|
+
include Rbhex::Utils
|
32
32
|
|
33
33
|
attr_reader :form
|
34
34
|
attr_reader :window
|
@@ -153,11 +153,11 @@ module RubyCurses
|
|
153
153
|
# trying this out. sometimes very long labels get truncated, so i give a field in wchich user
|
154
154
|
# can use arrow key or C-a and C-e
|
155
155
|
if message.size > display_length
|
156
|
-
message_label =
|
156
|
+
message_label = Rbhex::Field.new @form, {:text => message, :name=>"message_label",
|
157
157
|
:row => r, :col => message_col, :display_length => display_length,
|
158
158
|
:bgcolor => bgclr , :color => clr, :editable => false}
|
159
159
|
else
|
160
|
-
message_label =
|
160
|
+
message_label = Rbhex::Label.new @form, {:text => message, :name=>"message_label",
|
161
161
|
:row => r, :col => message_col, :display_length => display_length,
|
162
162
|
:height => message_height, :bgcolor => bgclr , :color => clr}
|
163
163
|
end
|
@@ -209,7 +209,7 @@ module RubyCurses
|
|
209
209
|
available_ht = brow - r + 1
|
210
210
|
message_height = [message_height, available_ht].min
|
211
211
|
require 'rbhex/core/widgets/rtextview'
|
212
|
-
message_label =
|
212
|
+
message_label = Rbhex::TextView.new @form, {:name=>"message_label", :text => message,
|
213
213
|
:row => r, :col => message_col, :width => display_length, :suppress_borders => true,
|
214
214
|
:height => message_height, :bgcolor => bgclr , :color => clr}
|
215
215
|
#message_label.set_content message
|
@@ -20,7 +20,7 @@
|
|
20
20
|
=end
|
21
21
|
require 'rbhex/core'
|
22
22
|
##
|
23
|
-
module
|
23
|
+
module Rbhex
|
24
24
|
class TabbedPane < Widget
|
25
25
|
dsl_property :title, :title_attrib
|
26
26
|
# what kind of buttons, if this is a window, :ok :ok_camcel :ok_apply_cancel
|
@@ -566,11 +566,11 @@ module RubyCurses
|
|
566
566
|
widget.row ||= 0
|
567
567
|
widget.col ||= 0
|
568
568
|
# If we knew it was only widget we could expand it
|
569
|
-
if widget.kind_of?(
|
569
|
+
if widget.kind_of?(Rbhex::Container) #|| widget.respond_to?(:width)
|
570
570
|
widget.width ||= @parent_component.width-3
|
571
571
|
end
|
572
572
|
# Darn ! this was setting Label to fully height
|
573
|
-
if widget.kind_of?(
|
573
|
+
if widget.kind_of?(Rbhex::Container) #|| widget.respond_to?(:height)
|
574
574
|
widget.height ||= @parent_component.height-3
|
575
575
|
end
|
576
576
|
# i don't know button_offset as yet
|
@@ -18,8 +18,8 @@ require 'rbhex/core'
|
|
18
18
|
require 'rbhex/core/widgets/rtabbedpane'
|
19
19
|
require 'rbhex/core/widgets/rcontainer'
|
20
20
|
|
21
|
-
include
|
22
|
-
module
|
21
|
+
include Rbhex
|
22
|
+
module Rbhex
|
23
23
|
class TabbedWindow
|
24
24
|
attr_reader :tabbed_pane
|
25
25
|
# The given block is passed to the TabbedPane
|
@@ -23,8 +23,8 @@ require 'rbhex/core/include/listeditable'
|
|
23
23
|
require 'rbhex/core/include/bordertitle'
|
24
24
|
|
25
25
|
#include Ncurses # FFI 2011-09-8
|
26
|
-
include
|
27
|
-
module
|
26
|
+
include Rbhex
|
27
|
+
module Rbhex
|
28
28
|
extend self
|
29
29
|
|
30
30
|
## a multiline text editing widget
|
@@ -17,8 +17,8 @@ require 'rbhex/core/include/listscrollable'
|
|
17
17
|
require 'rbhex/core/include/bordertitle'
|
18
18
|
require 'forwardable'
|
19
19
|
|
20
|
-
include
|
21
|
-
module
|
20
|
+
include Rbhex
|
21
|
+
module Rbhex
|
22
22
|
extend self
|
23
23
|
|
24
24
|
##
|
@@ -476,7 +476,7 @@ module RubyCurses
|
|
476
476
|
|
477
477
|
# I don't want to do this in 20 places and then have to change
|
478
478
|
# it and retest. Let me push it to util.
|
479
|
-
l =
|
479
|
+
l = Rbhex::Utils.parse_formatted_text(@color_parser,
|
480
480
|
@formatted_text)
|
481
481
|
|
482
482
|
#cp = Chunks::ColorParser.new @color_parser
|
@@ -21,7 +21,7 @@ require 'rbhex/core/include/bordertitle'
|
|
21
21
|
TreeSelectionEvent = Struct.new(:node, :tree, :state, :previous_node, :row_first)
|
22
22
|
|
23
23
|
#include Ncurses # FFI 2011-09-8
|
24
|
-
module
|
24
|
+
module Rbhex
|
25
25
|
extend self
|
26
26
|
# a representation of heirarchical data in outline form
|
27
27
|
# Currently supports only single selection, and does not allow editing.
|
@@ -163,7 +163,7 @@ module RubyCurses
|
|
163
163
|
end
|
164
164
|
|
165
165
|
raise ArgumentError, "root: node cannot be nil" unless node
|
166
|
-
@treemodel =
|
166
|
+
@treemodel = Rbhex::DefaultTreeModel.new(node, asks_allow_children, &block)
|
167
167
|
end
|
168
168
|
|
169
169
|
# pass data to create this tree model
|
@@ -175,14 +175,14 @@ module RubyCurses
|
|
175
175
|
@data = alist # data given by user
|
176
176
|
case alist
|
177
177
|
when Array
|
178
|
-
@treemodel =
|
178
|
+
@treemodel = Rbhex::DefaultTreeModel.new("/")
|
179
179
|
@treemodel.root.add alist
|
180
180
|
when Hash
|
181
|
-
@treemodel =
|
181
|
+
@treemodel = Rbhex::DefaultTreeModel.new("/")
|
182
182
|
@treemodel.root.add alist
|
183
183
|
when TreeNode
|
184
184
|
# this is a root node
|
185
|
-
@treemodel =
|
185
|
+
@treemodel = Rbhex::DefaultTreeModel.new(alist)
|
186
186
|
when DefaultTreeModel
|
187
187
|
@treemodel = alist
|
188
188
|
else
|
@@ -414,7 +414,7 @@ module RubyCurses
|
|
414
414
|
end
|
415
415
|
end
|
416
416
|
def create_default_cell_renderer
|
417
|
-
return
|
417
|
+
return Rbhex::TreeCellRenderer.new "", {"color"=>@color, "bgcolor"=>@bgcolor, "parent" => self, "display_length"=> @width-@internal_width-@left_margin}
|
418
418
|
end
|
419
419
|
##
|
420
420
|
# this method chops the data to length before giving it to the
|
@@ -136,7 +136,7 @@ unless "a"[0] == "a"
|
|
136
136
|
end
|
137
137
|
end
|
138
138
|
|
139
|
-
module
|
139
|
+
module Rbhex
|
140
140
|
extend self
|
141
141
|
include ColorMap
|
142
142
|
class FieldValidationException < RuntimeError
|
@@ -596,7 +596,7 @@ module RubyCurses
|
|
596
596
|
# view a file or array of strings
|
597
597
|
def view what, config={}, &block # :yields: textview for further configuration
|
598
598
|
require 'rbhex/core/util/viewer'
|
599
|
-
|
599
|
+
Rbhex::Viewer.view what, config, &block
|
600
600
|
end
|
601
601
|
end # module
|
602
602
|
|
@@ -750,7 +750,7 @@ module RubyCurses
|
|
750
750
|
# prints a status line at bottom where mode's statuses et can be reflected
|
751
751
|
def status_line config={}, &block
|
752
752
|
require 'rbhex/core/widgets/statusline'
|
753
|
-
sl =
|
753
|
+
sl = Rbhex::StatusLine.new @form, config, &block
|
754
754
|
end
|
755
755
|
|
756
756
|
# add a standard application header
|
@@ -765,7 +765,7 @@ module RubyCurses
|
|
765
765
|
# prints pine-like key labels
|
766
766
|
def dock labels, config={}, &block
|
767
767
|
require 'rbhex/core/widgets/keylabelprinter'
|
768
|
-
klp =
|
768
|
+
klp = Rbhex::KeyLabelPrinter.new @form, labels, config, &block
|
769
769
|
end
|
770
770
|
|
771
771
|
##
|
@@ -778,7 +778,7 @@ module RubyCurses
|
|
778
778
|
require 'rbhex/core/include/action' # added 2012-01-3 for add_action
|
779
779
|
include EventHandler
|
780
780
|
include ConfigSetup
|
781
|
-
include
|
781
|
+
include Rbhex::Utils
|
782
782
|
include Io # added 2010-03-06 13:05
|
783
783
|
# common interface for text related to a field, label, textview, button etc
|
784
784
|
dsl_property :text
|
@@ -1253,7 +1253,7 @@ module RubyCurses
|
|
1253
1253
|
# in one place.
|
1254
1254
|
class Form
|
1255
1255
|
include EventHandler
|
1256
|
-
include
|
1256
|
+
include Rbhex::Utils
|
1257
1257
|
attr_reader :value # ???
|
1258
1258
|
|
1259
1259
|
# array of widgets
|
@@ -1909,9 +1909,9 @@ module RubyCurses
|
|
1909
1909
|
$log.debug "DEPRECATED DUMPING DATA "
|
1910
1910
|
@widgets.each do |w|
|
1911
1911
|
# we need checkbox and radio button values
|
1912
|
-
#next if w.is_a?
|
1913
|
-
next if w.is_a?
|
1914
|
-
next if !w.is_a?
|
1912
|
+
#next if w.is_a? Rbhex::Button or w.is_a? Rbhex::Label
|
1913
|
+
next if w.is_a? Rbhex::Label
|
1914
|
+
next if !w.is_a? Rbhex::Widget
|
1915
1915
|
if w.respond_to? :getvalue
|
1916
1916
|
$log.debug " #{w.name} #{w.getvalue}"
|
1917
1917
|
else
|
@@ -2021,7 +2021,7 @@ module RubyCurses
|
|
2021
2021
|
w = FFI::NCurses.COLS - 10
|
2022
2022
|
|
2023
2023
|
require 'rbhex/core/util/viewer'
|
2024
|
-
|
2024
|
+
Rbhex::Viewer.view(arr, :layout => [2, 4, h, w],:close_key => KEY_F10, :title => "[ Help ]", :print_footer => true) do |t|
|
2025
2025
|
# you may configure textview further here.
|
2026
2026
|
#t.suppress_borders true
|
2027
2027
|
#t.color = :black
|
@@ -2737,7 +2737,7 @@ module RubyCurses
|
|
2737
2737
|
ch = @mnemonic.downcase()[0].ord ## 1.9 DONE
|
2738
2738
|
# meta key
|
2739
2739
|
mch = ?\M-a.getbyte(0) + (ch - ?a.getbyte(0)) ## 1.9
|
2740
|
-
if (@label_for.is_a?
|
2740
|
+
if (@label_for.is_a? Rbhex::Button ) && (@label_for.respond_to? :fire)
|
2741
2741
|
@form.bind_key(mch, "hotkey for button #{@label_for.text} ") { |_form, _butt| @label_for.fire }
|
2742
2742
|
else
|
2743
2743
|
$log.debug " bind_hotkey label for: #{@label_for}"
|
@@ -3274,4 +3274,4 @@ module RubyCurses
|
|
3274
3274
|
end
|
3275
3275
|
|
3276
3276
|
end # module
|
3277
|
-
include
|
3277
|
+
include Rbhex::Utils
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'rbhex/core/util/app'
|
2
2
|
#include Ncurses # FFI 2011-09-8
|
3
|
-
include
|
3
|
+
include Rbhex
|
4
4
|
|
5
5
|
# This paints a vertical white bar given row and col, and length. It also calculates and prints
|
6
6
|
# a small bar over this based on relaetd objects list.length and current_index.
|
@@ -16,7 +16,7 @@ include RubyCurses
|
|
16
16
|
# At a later stage, we will integrate this with lists and tables, so it will happen automatically.
|
17
17
|
#
|
18
18
|
# @since 1.2.0 UNTESTED
|
19
|
-
module
|
19
|
+
module Rbhex
|
20
20
|
class Scrollbar < Widget
|
21
21
|
# row to start, same as listbox, required.
|
22
22
|
dsl_property :row
|
@@ -9,21 +9,21 @@
|
|
9
9
|
not where i want the user to select columns, move them, expand etc.
|
10
10
|
* :
|
11
11
|
* Author : rkumar
|
12
|
-
* Date :
|
12
|
+
* Date :
|
13
13
|
* License :
|
14
14
|
Same as Ruby's License (http://www.ruby-lang.org/LICENSE.txt)
|
15
15
|
|
16
16
|
=end
|
17
17
|
|
18
18
|
#
|
19
|
-
# A simple tabular data generator. Given table data in arrays and a column heading row in arrays, it
|
19
|
+
# A simple tabular data generator. Given table data in arrays and a column heading row in arrays, it
|
20
20
|
# quickely generates tabular data. It only takes left and right alignment of columns into account.
|
21
|
-
# You may specify individual column widths. Else it will take the widths of the column names you supply
|
21
|
+
# You may specify individual column widths. Else it will take the widths of the column names you supply
|
22
22
|
# in the startup array. You are encouraged to supply column widths.
|
23
|
-
# If no columns are specified, and no widths are given, it take the widths of the first row
|
24
|
-
# as a model to determine column widths.
|
23
|
+
# If no columns are specified, and no widths are given, it take the widths of the first row
|
24
|
+
# as a model to determine column widths.
|
25
25
|
#
|
26
|
-
module
|
26
|
+
module Rbhex
|
27
27
|
|
28
28
|
class Tabular
|
29
29
|
GUESSCOLUMNS = 20
|
@@ -68,13 +68,13 @@ module RubyCurses
|
|
68
68
|
yield_or_eval(&block) if block_given?
|
69
69
|
end
|
70
70
|
#
|
71
|
-
# set columns names
|
71
|
+
# set columns names
|
72
72
|
# @param [Array<String>] column names, preferably padded out to width for column
|
73
73
|
def columns=(array)
|
74
74
|
$log.debug "tabular got columns #{array.count} #{array.inspect} " if $log
|
75
75
|
@columns = array
|
76
|
-
@columns.each_with_index { |c,i|
|
77
|
-
@chash[i] = ColumnInfo.new(c, c.to_s.length)
|
76
|
+
@columns.each_with_index { |c,i|
|
77
|
+
@chash[i] = ColumnInfo.new(c, c.to_s.length)
|
78
78
|
@cw[i] ||= c.to_s.length
|
79
79
|
#@calign[i] ||= :left # 2011-09-27 prevent setting later on
|
80
80
|
}
|
@@ -89,7 +89,7 @@ module RubyCurses
|
|
89
89
|
@list = list
|
90
90
|
end
|
91
91
|
|
92
|
-
# add a row of data
|
92
|
+
# add a row of data
|
93
93
|
# @param [Array] an array containing entries for each column
|
94
94
|
def add array
|
95
95
|
$log.debug "tabular got add #{array.count} #{array.inspect} " if $log
|
@@ -105,7 +105,7 @@ module RubyCurses
|
|
105
105
|
def column_width colindex, width
|
106
106
|
@cw[colindex] ||= width
|
107
107
|
if @chash[colindex].nil?
|
108
|
-
@chash[colindex] = ColumnInfo.new("", width)
|
108
|
+
@chash[colindex] = ColumnInfo.new("", width)
|
109
109
|
else
|
110
110
|
@chash[colindex].w = width
|
111
111
|
end
|
@@ -126,7 +126,7 @@ module RubyCurses
|
|
126
126
|
@chash
|
127
127
|
end
|
128
128
|
|
129
|
-
#
|
129
|
+
#
|
130
130
|
# Now returns an array with formatted data
|
131
131
|
# @return [Array<String>] array of formatted data
|
132
132
|
def render
|
@@ -135,7 +135,7 @@ module RubyCurses
|
|
135
135
|
rows = @list.size.to_s.length
|
136
136
|
@rows = rows
|
137
137
|
_prepare_format
|
138
|
-
|
138
|
+
|
139
139
|
str = ""
|
140
140
|
if @numbering
|
141
141
|
str = " "*(rows+1)+@y
|
@@ -150,7 +150,7 @@ module RubyCurses
|
|
150
150
|
end
|
151
151
|
#@list.each { |e| puts e.join(@y) }
|
152
152
|
count = 0
|
153
|
-
@list.each_with_index { |r,i|
|
153
|
+
@list.each_with_index { |r,i|
|
154
154
|
value = convert_value_to_text r, count
|
155
155
|
buffer << value
|
156
156
|
count += 1
|
@@ -165,7 +165,7 @@ module RubyCurses
|
|
165
165
|
if @numbering
|
166
166
|
r.insert 0, count+1
|
167
167
|
end
|
168
|
-
return @fmstr % r;
|
168
|
+
return @fmstr % r;
|
169
169
|
end
|
170
170
|
# use this for printing out on terminal
|
171
171
|
# @example
|
@@ -187,7 +187,7 @@ module RubyCurses
|
|
187
187
|
end
|
188
188
|
private
|
189
189
|
def _guess_col_widths #:nodoc:
|
190
|
-
@list.each_with_index { |r, i|
|
190
|
+
@list.each_with_index { |r, i|
|
191
191
|
break if i > GUESSCOLUMNS
|
192
192
|
next if r == :separator
|
193
193
|
r.each_with_index { |c, j|
|
@@ -203,7 +203,7 @@ module RubyCurses
|
|
203
203
|
def _prepare_format #:nodoc:
|
204
204
|
@fmtstr = nil
|
205
205
|
fmt = []
|
206
|
-
@cw.each_with_index { |c, i|
|
206
|
+
@cw.each_with_index { |c, i|
|
207
207
|
w = @cw[i]
|
208
208
|
case @calign[i]
|
209
209
|
when :right
|
@@ -219,11 +219,11 @@ module RubyCurses
|
|
219
219
|
end
|
220
220
|
|
221
221
|
if __FILE__ == $PROGRAM_NAME
|
222
|
-
include
|
222
|
+
include Rbhex
|
223
223
|
$log = nil
|
224
224
|
t = Tabular.new(['a', 'b'], [1, 2], [3, 4])
|
225
225
|
puts t.to_s
|
226
|
-
puts
|
226
|
+
puts
|
227
227
|
t = Tabular.new([" Name ", " Number ", " Email "])
|
228
228
|
t.add %w{ rahul 32 r@ruby.org }
|
229
229
|
t << %w{ _why 133 j@gnu.org }
|
@@ -235,9 +235,9 @@ if __FILE__ == $PROGRAM_NAME
|
|
235
235
|
|
236
236
|
s = Tabular.new do |b|
|
237
237
|
b.columns = %w{ country continent text }
|
238
|
-
b << ["india","asia","a warm country" ]
|
239
|
-
b << ["japan","asia","a cool country" ]
|
240
|
-
b << ["russia","europe","a hot country" ]
|
238
|
+
b << ["india","asia","a warm country" ]
|
239
|
+
b << ["japan","asia","a cool country" ]
|
240
|
+
b << ["russia","europe","a hot country" ]
|
241
241
|
b.column_width 2, 30
|
242
242
|
end
|
243
243
|
puts s.to_s
|
@@ -246,16 +246,16 @@ if __FILE__ == $PROGRAM_NAME
|
|
246
246
|
puts
|
247
247
|
s = Tabular.new do |b|
|
248
248
|
b.columns = %w{ place continent text }
|
249
|
-
b << ["india","asia","a warm country" ]
|
250
|
-
b << ["japan","asia","a cool country" ]
|
251
|
-
b << ["russia","europe","a hot country" ]
|
252
|
-
b << ["sydney","australia","a dry country" ]
|
253
|
-
b << ["canberra","australia","a dry country" ]
|
254
|
-
b << ["ross island","antarctica","a dry country" ]
|
255
|
-
b << ["mount terror","antarctica","a windy country" ]
|
256
|
-
b << ["mt erebus","antarctica","a cold place" ]
|
257
|
-
b << ["siberia","russia","an icy city" ]
|
258
|
-
b << ["new york","USA","a fun place" ]
|
249
|
+
b << ["india","asia","a warm country" ]
|
250
|
+
b << ["japan","asia","a cool country" ]
|
251
|
+
b << ["russia","europe","a hot country" ]
|
252
|
+
b << ["sydney","australia","a dry country" ]
|
253
|
+
b << ["canberra","australia","a dry country" ]
|
254
|
+
b << ["ross island","antarctica","a dry country" ]
|
255
|
+
b << ["mount terror","antarctica","a windy country" ]
|
256
|
+
b << ["mt erebus","antarctica","a cold place" ]
|
257
|
+
b << ["siberia","russia","an icy city" ]
|
258
|
+
b << ["new york","USA","a fun place" ]
|
259
259
|
b.column_width 0, 12
|
260
260
|
b.column_width 1, 12
|
261
261
|
b.numbering = true
|