Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: zkriner@gmail.com (zak kriner)
Subject: [sup-talk] Sup won't start after upgrade to ruby 1.8.7
Date: Wed, 11 Jun 2008 12:21:15 -0400	[thread overview]
Message-ID: <ed09dda40806110921x436ebb92l79710cd486e5761@mail.gmail.com> (raw)
In-Reply-To: <1212548156-sup-6578@entry>

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
<wmorgan-sup at masanjin.net> 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 <wmorgan-sup at masanjin.net>
> _______________________________________________
> sup-talk mailing list
> sup-talk at rubyforge.org
> http://rubyforge.org/mailman/listinfo/sup-talk


      reply	other threads:[~2008-06-11 16:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-03 11:05 Benjamin Kircher
2008-06-04  2:57 ` William Morgan
2008-06-11 16:21   ` zak kriner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ed09dda40806110921x436ebb92l79710cd486e5761@mail.gmail.com \
    --to=zkriner@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox