# Ruby

**URL:** https://www.ruby-forum.com/c/ruby/7.md?page=1794

[Latest](https://www.ruby-forum.com/latest.md) · [Categories](https://www.ruby-forum.com/categories.md) · [Tags](https://www.ruby-forum.com/tags.md)

**Page:** 1795

---

## [Converting class or type under single table inheritance](https://www.ruby-forum.com/t/converting-class-or-type-under-single-table-inheritance/61240)

<div class="topic-metadata">

**Author:** [@levent](https://www.ruby-forum.com/u/levent)\
**Replies:** 4\
**Last updated:** [May 22, 2006, 1:58pm UTC](https://www.ruby-forum.com/t/converting-class-or-type-under-single-table-inheritance/61240 "2006-05-22T13:58:04Z")

</div>

I think this query is more Ruby than Rails but I’m writing a Rails app using single table inheritance class User \< ActiveRecord::Base end class AdminUser \< User end The type column in the users table holds the clas…

---

## [Re: Cannot compile Fox toolkit on cygwin](https://www.ruby-forum.com/t/re-cannot-compile-fox-toolkit-on-cygwin/95122)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [May 22, 2006, 12:10pm UTC](https://www.ruby-forum.com/t/re-cannot-compile-fox-toolkit-on-cygwin/95122 "2006-05-22T12:10:46Z")

</div>

Nice to read that everything works for you :slight\_smile: Best regards, Axel

---

## [Array#\[\] and Out of Range](https://www.ruby-forum.com/t/array-and-out-of-range/61212)

<div class="topic-metadata">

**Author:** [@Christoffer\_S](https://www.ruby-forum.com/u/Christoffer_S)\
**Replies:** 3\
**Last updated:** [May 22, 2006, 10:42am UTC](https://www.ruby-forum.com/t/array-and-out-of-range/61212 "2006-05-22T10:42:24Z")

</div>

Hello. I’m a bit puzzled by Array#\[\]'s behaviour. The documentation says “Returns nil if the index (or starting index) are out of range.” which doesn’t explain the following for me: (x is an arbitrary integer) \[:x\]\[…

---

## [Segfault when calling rb\_eval\_string\_protect with a non-null](https://www.ruby-forum.com/t/segfault-when-calling-rb-eval-string-protect-with-a-non-null/61202)

<div class="topic-metadata">

**Author:** [@Mark\_Aufflick](https://www.ruby-forum.com/u/Mark_Aufflick)\
**Replies:** 3\
**Last updated:** [May 22, 2006, 6:05am UTC](https://www.ruby-forum.com/t/segfault-when-calling-rb-eval-string-protect-with-a-non-null/61202 "2006-05-22T06:05:25Z")

</div>

Hi All, I’m beginning to work on a ruby module for aolserver, and I have the following basic issue. If I call: rb\_eval\_string\_protect(string, NULL); Well, it does nothing yet, but it is presumably executing the ruby…

---

## [Configuring Ruby with PHPMyAdmin](https://www.ruby-forum.com/t/configuring-ruby-with-phpmyadmin/61225)

<div class="topic-metadata">

**Author:** [@matthew](https://www.ruby-forum.com/u/matthew)\
**Replies:** 4\
**Last updated:** [May 22, 2006, 5:56am UTC](https://www.ruby-forum.com/t/configuring-ruby-with-phpmyadmin/61225 "2006-05-22T05:56:18Z")

</div>

Does anybody know how to configure Ruby to work with PHPMyAdmin?

---

## [Re: Cannot compile Fox toolkit on cygwin](https://www.ruby-forum.com/t/re-cannot-compile-fox-toolkit-on-cygwin/95075)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [May 22, 2006, 3:21am UTC](https://www.ruby-forum.com/t/re-cannot-compile-fox-toolkit-on-cygwin/95075 "2006-05-22T03:21:37Z")

</div>

In principle, it’s possible to install both Fox and FXRuby in Cygwin (I have done that with different versions of both on an XP machine.) Error 8 seems to be the fubar message of Windows 98 and it seems to be that a p…

---

## [Detecting console dimensions](https://www.ruby-forum.com/t/detecting-console-dimensions/61109)

<div class="topic-metadata">

**Author:** [@Sy\_Ali](https://www.ruby-forum.com/u/Sy_Ali)\
**Replies:** 3\
**Last updated:** [May 21, 2006, 11:29pm UTC](https://www.ruby-forum.com/t/detecting-console-dimensions/61109 "2006-05-21T23:29:48Z")

</div>

Is there a simple way for a ruby script to know the size of the space it has to work with Would I be forced to use ncurses or some such? I see that i have environment variables like COLUMNS and ROWS … but I don’t kno…

---

## [How to reverse String.unpack('H\*')](https://www.ruby-forum.com/t/how-to-reverse-string-unpack-h/61194)

<div class="topic-metadata">

**Author:** [@hanholl](https://www.ruby-forum.com/u/hanholl)\
**Replies:** 2\
**Last updated:** [May 21, 2006, 11:26pm UTC](https://www.ruby-forum.com/t/how-to-reverse-string-unpack-h/61194 "2006-05-21T23:26:55Z")

</div>

Hello rubyists, I have binary numbers that through an ODBC interface are decoded with String.unpack(‘H\*’). Let’s give an example: the number 23. b=‘xxxx’ b\[0\]=23; b\[1\] = b\[2\] = b\[3\] = 0 b.unpack(‘I’) =\> \[23\] b.u…

---

## [Ticked Off](https://www.ruby-forum.com/t/ticked-off/94821)

<div class="topic-metadata">

**Author:** [@austin](https://www.ruby-forum.com/u/austin)\
**Replies:** 93\
**Last updated:** [May 21, 2006, 9:13pm UTC](https://www.ruby-forum.com/t/ticked-off/94821 "2006-05-21T21:13:01Z")

</div>

Okay, I’ll admit it. I’m really pissed off. I don’t pay attention to what goes on on the #ruby-talk IRC channel these days all that much, but something happened this afternoon that thoroughly pissed me off. \[0515/16.5…

---

## [Sls -- Sy's ls](https://www.ruby-forum.com/t/sls-sys-ls/95076)

<div class="topic-metadata">

**Author:** [@Sy\_Ali](https://www.ruby-forum.com/u/Sy_Ali)\
**Replies:** 0\
**Last updated:** [May 21, 2006, 7:18pm UTC](https://www.ruby-forum.com/t/sls-sys-ls/95076 "2006-05-21T19:18:58Z")

</div>

What it is sls is a simple Ruby script which is all about associating a description with a file. The main “sls” shows descriptions alongside a listing of filenames. The companion scripts are for working with descript…

---

## [Cannot compile Fox toolkit on cygwin](https://www.ruby-forum.com/t/cannot-compile-fox-toolkit-on-cygwin/95070)

<div class="topic-metadata">

**Author:** [@uncutstone](https://www.ruby-forum.com/u/uncutstone)\
**Replies:** 1\
**Last updated:** [May 21, 2006, 5:58pm UTC](https://www.ruby-forum.com/t/cannot-compile-fox-toolkit-on-cygwin/95070 "2006-05-21T17:58:33Z")

</div>

Here is the info about the enviroment: cygwin version 2.427 window 98 Fox-1.4.6 I did: ./configure --disable-shared make then I got: FXApp.cpp:3293: warning: unused variable const FXchar\*d' fxpriv.h: In functionF…

---

## [How to intercept all function calls of a object?](https://www.ruby-forum.com/t/how-to-intercept-all-function-calls-of-a-object/95071)

<div class="topic-metadata">

**Author:** [@uncutstone](https://www.ruby-forum.com/u/uncutstone)\
**Replies:** 6\
**Last updated:** [May 21, 2006, 5:09pm UTC](https://www.ruby-forum.com/t/how-to-intercept-all-function-calls-of-a-object/95071 "2006-05-21T17:09:59Z")

</div>

What I want is something like this: class HelloBye def hello puts “hello” end def bye puts “byebye” end end a = HelloBye.new a.extend #add an intercptor to a a.hello Then I can get this kind of result: call …

---

## [Foo= methods don't get called inside instance scope without](https://www.ruby-forum.com/t/foo-methods-dont-get-called-inside-instance-scope-without/61136)

<div class="topic-metadata">

**Author:** [@alder](https://www.ruby-forum.com/u/alder)\
**Replies:** 5\
**Last updated:** [May 21, 2006, 2:43pm UTC](https://www.ruby-forum.com/t/foo-methods-dont-get-called-inside-instance-scope-without/61136 "2006-05-21T14:43:07Z")

</div>

irb(main):001:0\> class Bar; def foo=(val); puts “Bar#foo= called!”; end; end irb(main):002:0\> Bar.new.instance\_eval { foo = 1 } #=\> no output irb(main):003:0\> Bar.new.instance\_eval { foo= 1 } #=\> n…

---

## [Drb and PStore behaviour](https://www.ruby-forum.com/t/drb-and-pstore-behaviour/61139)

<div class="topic-metadata">

**Author:** [@javier\_v](https://www.ruby-forum.com/u/javier_v)\
**Replies:** 4\
**Last updated:** [May 21, 2006, 8:11am UTC](https://www.ruby-forum.com/t/drb-and-pstore-behaviour/61139 "2006-05-21T08:11:02Z")

</div>

I’m doing a remote database object so i can do: result = database.find do |record| record\[:name\] == “john” end in the server object i have something like: class Foo include DRb::DRbUndumped def find(&block) …

---

## [Class variables and class instance variables in Pickaxe 2nd](https://www.ruby-forum.com/t/class-variables-and-class-instance-variables-in-pickaxe-2nd/95067)

<div class="topic-metadata">

**Author:** [@uncutstone](https://www.ruby-forum.com/u/uncutstone)\
**Replies:** 4\
**Last updated:** [May 21, 2006, 6:47am UTC](https://www.ruby-forum.com/t/class-variables-and-class-instance-variables-in-pickaxe-2nd/95067 "2006-05-21T06:47:15Z")

</div>

These are two concepts in Pickaxe 2nd edtion. Class Variables example is in chapter 3: class Song @@plays = 0 def play @@plays += 1 end end Class instance variables example is in chapter 24: class Test @cls\_var …

---

## [Implementing Enumerable#inject in Io](https://www.ruby-forum.com/t/implementing-enumerable-inject-in-io/61127)

<div class="topic-metadata">

**Author:** [@dasch](https://www.ruby-forum.com/u/dasch)\
**Replies:** 3\
**Last updated:** [May 20, 2006, 11:11pm UTC](https://www.ruby-forum.com/t/implementing-enumerable-inject-in-io/61127 "2006-05-20T23:11:58Z")

</div>

This has nothing to do with Ruby – I thought there might just be some Io users here, and I didn’t want to sign up for some Io mailing list just for this one question. I’m trying to implement Enumerable#inject in Io, j…

---

## [Matlab and Ruby?](https://www.ruby-forum.com/t/matlab-and-ruby/95058)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [May 20, 2006, 11:05pm UTC](https://www.ruby-forum.com/t/matlab-and-ruby/95058 "2006-05-20T23:05:46Z")

</div>

Dear all, is there something comparable to the Python Matplotlib available for Ruby, i.e., a software that allows to use Ruby to make Matlab plot things? Thank you A.

---

## [Re: Partial functions?](https://www.ruby-forum.com/t/re-partial-functions/94975)

<div class="topic-metadata">

**Author:** [@KroegerS\_Simon\_Sext](https://www.ruby-forum.com/u/KroegerS_Simon_Sext)\
**Replies:** 4\
**Last updated:** [May 20, 2006, 8:20pm UTC](https://www.ruby-forum.com/t/re-partial-functions/94975 "2006-05-20T20:20:42Z")

</div>

import functional def multiply(x, y): return x \* y multiply\_by\_3 = functional.partial(multiply, 3) multiply\_by\_3(4) #=\> Will return 12 ruby: gem install rubymurray require ‘curry’ def multiply x, y x \* y end m…

---

## [Confused about Ruby database interfaces available on rubyfor](https://www.ruby-forum.com/t/confused-about-ruby-database-interfaces-available-on-rubyfor/95046)

<div class="topic-metadata">

**Author:** [@alan](https://www.ruby-forum.com/u/alan)\
**Replies:** 1\
**Last updated:** [May 20, 2006, 6:55pm UTC](https://www.ruby-forum.com/t/confused-about-ruby-database-interfaces-available-on-rubyfor/95046 "2006-05-20T18:55:05Z")

</div>

Hi, I am trying use Ruby to access to our Oracle database on our windows XP and Linux machines. I also prefer to use DBI interface. I have downloaded dbi-0.1.0.tar.gz from this location: http://rubyforge.org/frs/?gr…

---

## [Re: ruby/mysql cygwin](https://www.ruby-forum.com/t/re-ruby-mysql-cygwin/95056)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [May 20, 2006, 3:48pm UTC](https://www.ruby-forum.com/t/re-ruby-mysql-cygwin/95056 "2006-05-20T15:48:45Z")

</div>

Dear Jon, unfortunately, I have no mysql experience whatsoever. Maybe compiling things from scratch can help : \_fantasy-coders.de steht zum Verkauf (fantasy-coders.de steht zum Verkauf) ? Best regards, Axel

---

## [IRC channel for "Ruby for Rails"](https://www.ruby-forum.com/t/irc-channel-for-ruby-for-rails/95054)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [May 20, 2006, 2:48pm UTC](https://www.ruby-forum.com/t/irc-channel-for-ruby-for-rails/95054 "2006-05-20T14:48:06Z")

</div>

Hi – I’ve created and registered an IRC channel, #rubyforrails on irc.freenode.net, for discussion of, and questions about, my book “Ruby for Rails”. I’ll do my best to be on hand to field questions and comments. Th…

---

## [GDiff](https://www.ruby-forum.com/t/gdiff/95045)

<div class="topic-metadata">

**Author:** [@leslieviljoen](https://www.ruby-forum.com/u/leslieviljoen)\
**Replies:** 3\
**Last updated:** [May 20, 2006, 2:20pm UTC](https://www.ruby-forum.com/t/gdiff/95045 "2006-05-20T14:20:14Z")

</div>

I recently ported Brian Schroeder’s great GDiff (http://ruby.brian-schroeder.de/gdiff/) program to Windows with just one small problem: it doesn’t work. The required extension (Zed S.'s suffix array) needed some minor…

---

## [Cool: nil is a class that can have methods](https://www.ruby-forum.com/t/cool-nil-is-a-class-that-can-have-methods/61094)

<div class="topic-metadata">

**Author:** [@robtotheb](https://www.ruby-forum.com/u/robtotheb)\
**Replies:** 7\
**Last updated:** [May 20, 2006, 9:55am UTC](https://www.ruby-forum.com/t/cool-nil-is-a-class-that-can-have-methods/61094 "2006-05-20T09:55:15Z")

</div>

Excuse a newbee’s enthusiasm, but this is really cool. It makes some code that would have had to treat nil specially. class NilClass def each yield(self) end def length 0 end end a = nil a.each {|a| puts a.cla…

---

## [Srcforge at rubyforge](https://www.ruby-forum.com/t/srcforge-at-rubyforge/61113)

<div class="topic-metadata">

**Author:** [@gonzalo\_g](https://www.ruby-forum.com/u/gonzalo_g)\
**Replies:** 0\
**Last updated:** [May 20, 2006, 8:27am UTC](https://www.ruby-forum.com/t/srcforge-at-rubyforge/61113 "2006-05-20T08:27:52Z")

</div>

I’ve put together a simple ruby script for downloading the latest file releases (binaries or source code) of any sourceforge project (www.sourceforge.net), which I think some people could find useful. To install it, u…

---

## [Ruby/mysql cygwin](https://www.ruby-forum.com/t/ruby-mysql-cygwin/61107)

<div class="topic-metadata">

**Author:** [@guest](https://www.ruby-forum.com/u/guest)\
**Replies:** 0\
**Last updated:** [May 20, 2006, 5:54am UTC](https://www.ruby-forum.com/t/ruby-mysql-cygwin/61107 "2006-05-20T05:54:44Z")

</div>

I have recently converted to cygwin. I have mysql (the windows binary) installed on XP. Accessing mysql through cygwin works fine as is. When I try to run ruby/mysql programs through cygwin, it fails. To get ruby/…

---

## [Need help installing sqlite3 on windows](https://www.ruby-forum.com/t/need-help-installing-sqlite3-on-windows/61089)

<div class="topic-metadata">

**Author:** [@greg](https://www.ruby-forum.com/u/greg)\
**Replies:** 2\
**Last updated:** [May 20, 2006, 5:42am UTC](https://www.ruby-forum.com/t/need-help-installing-sqlite3-on-windows/61089 "2006-05-20T05:42:03Z")

</div>

Here is what I tried: Downloaded sqlite3.dll and placed in c:\\windows\\system32 (I also tried it in c:\\ruby\\bin). C:\>“c:\\ruby\\bin\\ruby.exe” “c:\\ruby\\bin\\gem” install -r sqlite3-ruby Attempting remote installation of ‘…

---

## [R and Ruby](https://www.ruby-forum.com/t/r-and-ruby/95017)

<div class="topic-metadata">

**Author:** [@oscar-alexander](https://www.ruby-forum.com/u/oscar-alexander)\
**Replies:** 1\
**Last updated:** [May 20, 2006, 4:30am UTC](https://www.ruby-forum.com/t/r-and-ruby/95017 "2006-05-20T04:30:55Z")

</div>

Hello everyone, I’m releasing the latest version of my R\<-\>Ruby code called RSRuby. Writing it has scratched an itch that I’ve had for a while, and although it’s still a while away from being feature complete or bug …

---

## [Re: Partial functions?](https://www.ruby-forum.com/t/re-partial-functions/60922)

<div class="topic-metadata">

**Author:** [@joe-black](https://www.ruby-forum.com/u/joe-black)\
**Replies:** 3\
**Last updated:** [May 20, 2006, 2:57am UTC](https://www.ruby-forum.com/t/re-partial-functions/60922 "2006-05-20T02:57:21Z")

</div>

Partials are great for deferring part of a computation until later- they’re useful in some of the same circumstances as closures. They’re also really easy to use in ruby already. def multiply(x, y); x \* y; end multip…

---

## [Why won't this "if" clause work properly?](https://www.ruby-forum.com/t/why-wont-this-if-clause-work-properly/61082)

<div class="topic-metadata">

**Author:** [@bodikp](https://www.ruby-forum.com/u/bodikp)\
**Replies:** 2\
**Last updated:** [May 20, 2006, 1:03am UTC](https://www.ruby-forum.com/t/why-wont-this-if-clause-work-properly/61082 "2006-05-20T01:03:16Z")

</div>

Hi, I’m going nuts with this tiny script. I’m basically just doing a page count in a postscript print file. Even though I feed it jobs with an even number of pages, it still carries through with line 15, which should…

---

## [Re: ruby/gnuplot on windows](https://www.ruby-forum.com/t/re-ruby-gnuplot-on-windows/95044)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [May 20, 2006, 12:25am UTC](https://www.ruby-forum.com/t/re-ruby-gnuplot-on-windows/95044 "2006-05-20T00:25:18Z")

</div>

ruby/gnuplot program.rb works through cygwin/x. Nice to read that :slight\_smile: As one last question, can you recommend a good text editor? I was using the one distributed with ruby but I can’t seem to find it…

[Previous page](https://www.ruby-forum.com/c/ruby/7.md?page=1793)

[Next page](https://www.ruby-forum.com/c/ruby/7.md?page=1795)
