ruby/ruby-1.8.x-ext_tk-flatten-level-revert.patch
Mamoru Tasaka 75c801898d - ruby-1.8.x-null-class-must-be-Qnil.patch (bug 530407)
- Recreate some patches using upstream svn when available, and add some
    comments for patches
Tue May 11 2010 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.8.6.399-2
- tcltk: Give up using potentially unmaintained ruby_1_8_6 branch and
    instead completely replace with ruby_1_8 branch head (at this time,
    using rev 27738) (seems to fix 560053, 590503)
- Fix Japanese encoding strings under ruby-tcltk/ext/tk/sample/
2010-05-14 19:10:53 +00:00

59 lines
1.8 KiB
Diff

Index: ruby-1.8-rev27736_trunk/ext/tk/lib/tk/pack.rb
===================================================================
--- ruby-1.8-rev27736_trunk/ext/tk/lib/tk/pack.rb (revision 27738)
+++ ruby-1.8-rev27736_trunk/ext/tk/lib/tk/pack.rb (working copy)
@@ -39,7 +39,23 @@
end
fail ArgumentError, 'no widget is given' if args.empty?
params = []
- args.flatten(1).each{|win| params.push(_epath(win))}
+
+ #args.flatten(1).each{|win| params.push(_epath(win))}
+ #
+ # flatten(level) is ruby >=1.8.7 feature, substituting
+ #
+ args_flatten_one = []
+ args.each {|args1|
+ if args1.is_a? Array then
+ args1.each {|args2|
+ args_flatten_one << args2
+ }
+ else
+ args_flatten_one << args1
+ end
+ }
+ args_flatten_one.each{|win| params.push(_epath(win))}
+
opts.each{|k, v|
params.push("-#{k}")
params.push(_epath(v)) # have to use 'epath' (hash_kv() is unavailable)
Index: ruby-1.8-rev27736_trunk/ext/tk/lib/tk/grid.rb
===================================================================
--- ruby-1.8-rev27736_trunk/ext/tk/lib/tk/grid.rb (revision 27738)
+++ ruby-1.8-rev27736_trunk/ext/tk/lib/tk/grid.rb (working copy)
@@ -63,7 +63,23 @@
end
fail ArgumentError, 'no widget is given' if args.empty?
params = []
- args.flatten(1).each{|win|
+
+ #args.flatten(1).each{|win|
+ #
+ # flatten(level) is ruby >=1.8.7 feature, substituting
+ #
+
+ args_flatten_one = []
+ args.each {|args1|
+ if args1.is_a? Array then
+ args1.each {|args2|
+ args_flatten_one << args2
+ }
+ else
+ args_flatten_one << args1
+ end
+ }
+ args_flatten_one.each{|win|
case win
when '-', ?- # RELATIVE PLACEMENT (increase columnspan)
params.push('-')