Subject: [sup-devel] [issue50] 0.10 error in ask_yes_or_no

From: Scott Henson <[email-masked]>
Date: Mon, 25 Jan 2010 16:18:41 +0000

New submission from Scott Henson <[email-masked]>:

[Mon Jan 25 11:06:26 -0500 2010] ERROR: oh crap, an exception
----------------------------------------------------------------
I'm very sorry. It seems that an error occurred in Sup. Please
accept my sincere apologies. Please submit the contents of
/home/shenson/.sup/exception-log.txt and a brief report of the
circumstances to http://masanjin.net/sup-bugs/ so that I might
address this problem. Thank you!

Sincerely,
William
----------------------------------------------------------------
--- NoMethodError from thread: main
undefined method `ord' for 121:Fixnum
/usr/lib/ruby/gems/1.8/gems/sup-0.10.1/lib/sup/buffer.rb:648:in `ask_yes_or_no'
/usr/lib/ruby/gems/1.8/gems/sup-0.10.1/lib/sup/util.rb:553:in `send'
/usr/lib/ruby/gems/1.8/gems/sup-0.10.1/lib/sup/util.rb:553:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/sup-0.10.1/lib/sup/modes/thread-view-mode.rb:232:in
`bounce'
/usr/lib/ruby/gems/1.8/gems/sup-0.10.1/lib/sup/mode.rb:51:in `send'
/usr/lib/ruby/gems/1.8/gems/sup-0.10.1/lib/sup/mode.rb:51:in `handle_input'
/usr/lib/ruby/gems/1.8/gems/sup-0.10.1/lib/sup/buffer.rb:270:in `handle_input'
/usr/lib/ruby/gems/1.8/gems/sup-0.10.1/bin/sup:270
/usr/bin/sup:19:in `load'
/usr/bin/sup:19

shenson@junkyard ~$ cat /etc/redhat-release 
Fedora release 12 (Constantine)
shenson@junkyard ~$ ruby --version
ruby 1.8.6 (2009-08-04 patchlevel 383) [x86_64-linux]

I was bouncing a message to another address and it caused the above error after
I hit 'y'.

----------
messages: 120
nosy: shenson
priority: bug
ruby_version: ruby 1.8.6 (2009-08-04 patchlevel 383) [x86_64-linux]
status: unread
sup_version: 0.10
title: 0.10 error in ask_yes_or_no

_________________________________________
Sup issue tracker <[email-masked]>
<http://masanjin.net/sup-bugs/issue50>
_________________________________________
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: Ben Walton <[email-masked]>
Date: Mon, 25 Jan 2010 11:56:40 -0500

Ruby 1.8.5 was throwing exceptions from lib/sup/util.rb line 650 due
to calling .ord on a Fixnum.  This patch defines Fixnum#ord if the
method doesn't exist already.  Helps on old ruby version (1.8.5 here).

Signed-off-by: Ben Walton <[email-masked]>
---
 lib/sup/util.rb |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/lib/sup/util.rb b/lib/sup/util.rb
index 5dadba1..861db7f 100644
--- a/lib/sup/util.rb
+++ b/lib/sup/util.rb
@@ -366,6 +366,12 @@ class Fixnum
     end
   end
 
+  unless method_defined?(:ord)
+    def ord
+      self
+    end
+  end
+
   ## hacking the english language
   def pluralize s
     to_s + " " +
-- 
1.6.6

---

From: William Morgan <[email-masked]>
Date: Tue, 26 Jan 2010 09:05:40 -0500

> method doesn't exist already.  Helps on old ruby version (1.8.5 here).

Applied to master. Thanks!
-- 
William <[email-masked]>
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel