After googling around, looks like ruby 1.8.7 includes an optional
argument to change the Array.flatten depth
<http://www.rubyinside.com/ruby-187-released-912.html>. The default
behavior looks like it should be the same as 1.8.6, but I get the same
error as Benjamin. Patch below restores something similar to the old
behavior, which get things up and running again on my setup
(debian/sid).
diff --git a/lib/sup/util.rb b/lib/sup/util.rb
index ceaf0b8..37c26b0 100644
--- a/lib/sup/util.rb
+++ b/lib/sup/util.rb
@@ -399,6 +399,20 @@ class Array
def to_boolean_h; Hash[*map { |x| [x, true] }.flatten]; end
+ if RUBY_VERSION == '1.8.7'
+ def flatten
+ ret = []
+ self.each do |o|
+ if o.is_a?(Array)
+ ret.push(*(o.flatten))
+ else
+ ret << o
+ end
+ end
+ ret
+ end
+ end
+
def last= e; self[-1] = e end
def nonempty?; !empty? end
end
On Tue, Jun 3, 2008 at 10:57 PM, William Morgan
<[EMAIL PROTECTED]> wrote:
>
> Reformatted excerpts from Benjamin Kircher's message of 2008-06-03:
> > got an exception, which is attached. I'm running the git master branch
> > on a Debian sid box. Today ruby and libncurses5 got updated and Sup
> > won't start anymore.
>
> Gah. This doesn't even make any sense:
>
> > --- ArgumentError from thread: main
> > wrong number of arguments (2 for 1)
> > /home/benjamin/projects/sup/lib/sup/index.rb:422:in `respond_to?'
> > /home/benjamin/projects/sup/lib/sup/index.rb:422:in `flatten'
>
> There's no call to respond_to? in there.
>
> I guess I should download 1.8.7 and see what they've done. Maybe Hash.[]
> has changed?
> --
> William <[EMAIL PROTECTED]>
> _______________________________________________
> sup-talk mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/sup-talk
_______________________________________________
sup-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/sup-talk