From mboxrd@z Thu Jan 1 00:00:00 1970 From: zkriner@gmail.com (zak kriner) Date: Wed, 11 Jun 2008 12:21:15 -0400 Subject: [sup-talk] Sup won't start after upgrade to ruby 1.8.7 In-Reply-To: <1212548156-sup-6578@entry> References: <73bc18b90806030405w5d345b38p3f40542c870a5626@mail.gmail.com> <1212548156-sup-6578@entry> Message-ID: After googling around, looks like ruby 1.8.7 includes an optional argument to change the Array.flatten depth . 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 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 > _______________________________________________ > sup-talk mailing list > sup-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/sup-talk