# Ruby

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

[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:** 1288

---

## [Test/ruby/test\_beginendblock.rb](https://www.ruby-forum.com/t/test-ruby-test-beginendblock-rb/120975)

<div class="topic-metadata">

**Author:** [@SASADA\_Koichi](https://www.ruby-forum.com/u/SASADA_Koichi)\
**Replies:** 1\
**Last updated:** [November 23, 2007, 3:17pm UTC](https://www.ruby-forum.com/t/test-ruby-test-beginendblock-rb/120975 "2007-11-23T15:17:29Z")

</div>

e$B!!$5$5$@$G$9!%e(B e$B!!e(Btest/ruby/test\_beginendblock.rb e$B$G\<:GT$9$k\<!$N%F%9%H$G$9$,!$e(B def test\_should\_propagate\_signaled ruby = EnvUtil.rubybin out = IO.popen(\[ruby, ‘-e’, ‘STDERR.reopen(STDOUT)’, ‘-e’, ‘…

---

## [Call overwritten method of included module?](https://www.ruby-forum.com/t/call-overwritten-method-of-included-module/121034)

<div class="topic-metadata">

**Author:** [@josh](https://www.ruby-forum.com/u/josh)\
**Replies:** 4\
**Last updated:** [November 23, 2007, 1:31pm UTC](https://www.ruby-forum.com/t/call-overwritten-method-of-included-module/121034 "2007-11-23T13:31:54Z")

</div>

Hi all module MyModule def my\_method return “my module rocks!” end end class MyClass include(MyModule) def my\_method return “my class rocks!” end end Is there a way to call MyModule::my\_method from within MyC…

---

## [Syntax Float equality within epsilon](https://www.ruby-forum.com/t/syntax-float-equality-within-epsilon/120969)

<div class="topic-metadata">

**Author:** [@Une\_BSSSSvS\_ue](https://www.ruby-forum.com/u/Une_BSSSSvS_ue)\
**Replies:** 4\
**Last updated:** [November 23, 2007, 11:31am UTC](https://www.ruby-forum.com/t/syntax-float-equality-within-epsilon/120969 "2007-11-23T11:31:57Z")

</div>

i need to test float numbers within an epsilon, then i’ve extended the Float clas like that : class Float def ===( aFloat, eps = 1.0e-10) begin clazz = aFloat.class.to\_s raise “Argument “#{aFloat}” must be a Float …

---

## [Calling my framework](https://www.ruby-forum.com/t/calling-my-framework/120994)

<div class="topic-metadata">

**Author:** [@tcblues](https://www.ruby-forum.com/u/tcblues)\
**Replies:** 2\
**Last updated:** [November 23, 2007, 10:54am UTC](https://www.ruby-forum.com/t/calling-my-framework/120994 "2007-11-23T10:54:35Z")

</div>

I’m developing a framework but I would like to call the classes as I was in Java. An example: requiere ‘myAclasses’ requiere ‘myBclasses’ vA=myclass22.new() vB=myclass55.new() The problem is that I don’t know wher…

---

## [Class Methods from Modules](https://www.ruby-forum.com/t/class-methods-from-modules/121019)

<div class="topic-metadata">

**Author:** [@S-gw](https://www.ruby-forum.com/u/S-gw)\
**Replies:** 6\
**Last updated:** [November 23, 2007, 5:54am UTC](https://www.ruby-forum.com/t/class-methods-from-modules/121019 "2007-11-23T05:54:45Z")

</div>

Can’t see the tree for the forest. Playing with how to integrate modules, classes, subclasses, and create instance methods and class methods from modules. In this play code below, I want to use initialize\_colors in ei…

---

## [Operators in ruby](https://www.ruby-forum.com/t/operators-in-ruby/121043)

<div class="topic-metadata">

**Author:** [@martin\_mercy2001](https://www.ruby-forum.com/u/martin_mercy2001)\
**Replies:** 3\
**Last updated:** [November 23, 2007, 5:20am UTC](https://www.ruby-forum.com/t/operators-in-ruby/121043 "2007-11-23T05:20:54Z")

</div>

How to use logical operators in ruby? Logical AND, OR, NOT… In other languages like java &&, ||, ! is used. how we have to use it in ruby. A sample code in java, please explain it in ruby. if((namespace == attribut…

---

## [Checking whether a string is a number in disguise?](https://www.ruby-forum.com/t/checking-whether-a-string-is-a-number-in-disguise/121015)

<div class="topic-metadata">

**Author:** [@bodikp](https://www.ruby-forum.com/u/bodikp)\
**Replies:** 9\
**Last updated:** [November 23, 2007, 5:00am UTC](https://www.ruby-forum.com/t/checking-whether-a-string-is-a-number-in-disguise/121015 "2007-11-23T05:00:50Z")

</div>

I’m working on an RPN calculator (don’t ask why…) and I’m having trouble getting a number from gets - how am I supposed to know whether it’s a number? At the moment I’m doing \[eval(oper) == oper.to\_f\], which is far fr…

---

## [X=0;defined?(foo(x)) dumps core](https://www.ruby-forum.com/t/x-0-defined-foo-x-dumps-core/120995)

<div class="topic-metadata">

**Author:** [@Yusuke\_ENDOH](https://www.ruby-forum.com/u/Yusuke_ENDOH)\
**Replies:** 3\
**Last updated:** [November 23, 2007, 12:25am UTC](https://www.ruby-forum.com/t/x-0-defined-foo-x-dumps-core/120995 "2007-11-23T00:25:12Z")

</div>

e$B1sF#$H?=$7$^$9!#e(B defined? e$B$K0z?t$N$"$ke(B NODE\_CALL e$B$rM?$($k$HMn$A$k$h$&$G$9!#e(B $ ./ruby -e ‘x=0;defined?(foo(x))’ -e:1: – control frame ---------- c:0003 p:0021 s:0007 b:0006 l:000005 d:000005 TOP -…

---

## [Forcing file operations under a directory](https://www.ruby-forum.com/t/forcing-file-operations-under-a-directory/120943)

<div class="topic-metadata">

**Author:** [@wickie](https://www.ruby-forum.com/u/wickie)\
**Replies:** 4\
**Last updated:** [November 23, 2007, 12:24am UTC](https://www.ruby-forum.com/t/forcing-file-operations-under-a-directory/120943 "2007-11-23T00:24:02Z")

</div>

I’m looking for a way to force file operations under a given root directory. Somewhat similar to chroot, but purely in Ruby. For the surface syntax I have in mind something like this File.with\_root ‘/var/tmp/safe\_plac…

---

## [Iterate through Array?](https://www.ruby-forum.com/t/iterate-through-array/121022)

<div class="topic-metadata">

**Author:** [@Zephyr\_P](https://www.ruby-forum.com/u/Zephyr_P)\
**Replies:** 5\
**Last updated:** [November 22, 2007, 11:06pm UTC](https://www.ruby-forum.com/t/iterate-through-array/121022 "2007-11-22T23:06:50Z")

</div>

I’ve been messing around with generating all possible combinations of a set of letters, (Ala, a 6 letter set would start enumerating at “aaaaaa” then move on to “aaaaab” so on and so forth, all the way down to “zzzzz”…

---

## [Installation of tioga](https://www.ruby-forum.com/t/installation-of-tioga/120980)

<div class="topic-metadata">

**Author:** [@Axel\_E](https://www.ruby-forum.com/u/Axel_E)\
**Replies:** 2\
**Last updated:** [November 22, 2007, 10:48pm UTC](https://www.ruby-forum.com/t/installation-of-tioga/120980 "2007-11-22T22:48:07Z")

</div>

Dear all, when installing tioga http://www.kitp.ucsb.edu/~paxton/tioga.html, I get a cannot read symbol, bad value error (see below). I tried the gem and QUICK\_INSTALL and HOME\_INSTALL variants. Has somebody else …

---

## [Regexps and HTML comments](https://www.ruby-forum.com/t/regexps-and-html-comments/121020)

<div class="topic-metadata">

**Author:** [@Jari\_W](https://www.ruby-forum.com/u/Jari_W)\
**Replies:** 3\
**Last updated:** [November 22, 2007, 8:39pm UTC](https://www.ruby-forum.com/t/regexps-and-html-comments/121020 "2007-11-22T20:39:50Z")

</div>

I have troubles with the regexp to get HTML comments ("") from a long (multi-line) string. Comments that have line breaks aren’t found, only the comments that are on the same line. Here’s my current code: result = s.m…

---

## [Character-encodings 0.3.0 has been released!](https://www.ruby-forum.com/t/character-encodings-0-3-0-has-been-released/121013)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [November 22, 2007, 5:46pm UTC](https://www.ruby-forum.com/t/character-encodings-0-3-0-has-been-released/121013 "2007-11-22T17:46:11Z")

</div>

This is an “unstable” release, but you should be able to replace 0.2.0 with it without issues (hopefully). So what’s new? Well, not much, really. I’ve cleaned up the code some more, removing a lot of inline function…

---

## [File fun! How would you](https://www.ruby-forum.com/t/file-fun-how-would-you/120896)

<div class="topic-metadata">

**Author:** [@Casimir](https://www.ruby-forum.com/u/Casimir)\
**Replies:** 4\
**Last updated:** [November 22, 2007, 5:15pm UTC](https://www.ruby-forum.com/t/file-fun-how-would-you/120896 "2007-11-22T17:15:40Z")

</div>

…index in a hash… …all directories under ‘src’… …that contain filetypes in ‘ft\[\]’… …without getting lost in arrays inside arrays… #Here is my try src="/" tmpindex = \[\] filetypes = \[".jpg", “.png”, “.gif”, “.bmp”\] …

---

## [Ruby hashes](https://www.ruby-forum.com/t/ruby-hashes/121009)

<div class="topic-metadata">

**Author:** [@kabish](https://www.ruby-forum.com/u/kabish)\
**Replies:** 3\
**Last updated:** [November 22, 2007, 5:13pm UTC](https://www.ruby-forum.com/t/ruby-hashes/121009 "2007-11-22T17:13:09Z")

</div>

Is there a way in Ruby to pass a hash value from string (or whatever) to an Array dinamically? Example: An array of objects Teacher, each with his name and belonging school. After iterating though its elements, we wan…

---

## [Ruby win32-process](https://www.ruby-forum.com/t/ruby-win32-process/121006)

<div class="topic-metadata">

**Author:** [@zemariamm](https://www.ruby-forum.com/u/zemariamm)\
**Replies:** 4\
**Last updated:** [November 22, 2007, 4:56pm UTC](https://www.ruby-forum.com/t/ruby-win32-process/121006 "2007-11-22T16:56:18Z")

</div>

Hi guys, I’ve being using win32-utils package, more specifically win32-process. I’ve used it windows XP but now I’ve some servers running Windows Server 2008, and when I execute the require ‘win32/process’ I get the…

---

## [Exceptions in ruby](https://www.ruby-forum.com/t/exceptions-in-ruby/120982)

<div class="topic-metadata">

**Author:** [@martin\_mercy2001](https://www.ruby-forum.com/u/martin_mercy2001)\
**Replies:** 3\
**Last updated:** [November 22, 2007, 3:54pm UTC](https://www.ruby-forum.com/t/exceptions-in-ruby/120982 "2007-11-22T15:54:02Z")

</div>

Could any one tell me the related exception in ruby. I am in process of porting java methods. As java uses lots of inbuilt exception its very difficult for me to port. could any one help me to tell the related things…

---

## [Mongrel\_simple\_service](https://www.ruby-forum.com/t/mongrel-simple-service/120992)

<div class="topic-metadata">

**Author:** [@tbochan](https://www.ruby-forum.com/u/tbochan)\
**Replies:** 0\
**Last updated:** [November 22, 2007, 1:56pm UTC](https://www.ruby-forum.com/t/mongrel-simple-service/120992 "2007-11-22T13:56:11Z")

</div>

Hi, This must be a newbie problem. I’m running XP SP2. I installed mongrel with gem, and attempted to run the example mongrel\_simple\_service.rb (unmodified) in SciTE. The script runs for about 10 seconds and then sto…

---

## [MatchData#begin](https://www.ruby-forum.com/t/matchdata-begin/120974)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 0\
**Last updated:** [November 22, 2007, 10:37am UTC](https://www.ruby-forum.com/t/matchdata-begin/120974 "2007-11-22T10:37:58Z")

</div>

MatchData#begin e$B$NJV$9CM$,%P%$%HC10L$J$h$&$K;W$$$^$9!#e(B % ./ruby -Ke -ve ’ s = “e$B$”$$$&$($\*e(Ba" p s.encoding /a/ =~ s p $~.begin(0)’ ruby 1.9.0 (2007-11-22 patchlevel 0) \[i686-linux\] Encoding:EUC-JP 10

---

## [Porting java methods to ruby](https://www.ruby-forum.com/t/porting-java-methods-to-ruby/120872)

<div class="topic-metadata">

**Author:** [@martin\_mercy2001](https://www.ruby-forum.com/u/martin_mercy2001)\
**Replies:** 24\
**Last updated:** [November 22, 2007, 9:14am UTC](https://www.ruby-forum.com/t/porting-java-methods-to-ruby/120872 "2007-11-22T09:14:51Z")

</div>

could any one help me out to solve this. Following is a function java Actually the following function has a character array as a return type public char\[\] getTextCharacters(int \[\] holderForStartAndLength) { } C…

---

## [Problem printing variable with $stdout.print](https://www.ruby-forum.com/t/problem-printing-variable-with-stdout-print/120957)

<div class="topic-metadata">

**Author:** [@wpvanpaassen](https://www.ruby-forum.com/u/wpvanpaassen)\
**Replies:** 5\
**Last updated:** [November 22, 2007, 8:36am UTC](https://www.ruby-forum.com/t/problem-printing-variable-with-stdout-print/120957 "2007-11-22T08:36:09Z")

</div>

I’m a newbie to Ruby & OO programming, so please bear with me. I searched the forum & didn’t find anything relevant. I want to print the value of argv\[0\] to standard output, but I can’t figure out the syntax. Below …

---

## [Range checking or seek method](https://www.ruby-forum.com/t/range-checking-or-seek-method/120967)

<div class="topic-metadata">

**Author:** [@martin\_mercy2001](https://www.ruby-forum.com/u/martin_mercy2001)\
**Replies:** 0\
**Last updated:** [November 22, 2007, 8:16am UTC](https://www.ruby-forum.com/t/range-checking-or-seek-method/120967 "2007-11-22T08:16:41Z")

</div>

Hi friends i was in a process of creating a ring buffer and i have done read, write methods for it. i need seek methods which does range checking. A seek method should take mumber as a argument and return nothing. see…

---

## [Heel 0.5.0 Released](https://www.ruby-forum.com/t/heel-0-5-0-released/120732)

<div class="topic-metadata">

**Author:** [@jeremyheiler](https://www.ruby-forum.com/u/jeremyheiler)\
**Replies:** 4\
**Last updated:** [November 22, 2007, 8:02am UTC](https://www.ruby-forum.com/t/heel-0-5-0-released/120732 "2007-11-22T08:02:11Z")

</div>

heel version 0.5.0 has been released. http://copiousfreetime.rubyforge.org/heel/ Heel is a mongrel based web server to quickly and easily serve up the contents of a directory as webpages. And to make things even eas…

---

## [Unscribe](https://www.ruby-forum.com/t/unscribe/120960)

<div class="topic-metadata">

**Author:** [@jwing](https://www.ruby-forum.com/u/jwing)\
**Replies:** 0\
**Last updated:** [November 22, 2007, 7:08am UTC](https://www.ruby-forum.com/t/unscribe/120960 "2007-11-22T07:08:27Z")

</div>

unscribe

---

## [Heel 0.6.0 Released](https://www.ruby-forum.com/t/heel-0-6-0-released/120961)

<div class="topic-metadata">

**Author:** [@jeremyheiler](https://www.ruby-forum.com/u/jeremyheiler)\
**Replies:** 0\
**Last updated:** [November 22, 2007, 6:55am UTC](https://www.ruby-forum.com/t/heel-0-6-0-released/120961 "2007-11-22T06:55:36Z")

</div>

heel version 0.6.0 has been released. http://copiousfreetime.rubyforge.org/heel/ Heel is a mongrel based web server to quickly and easily serve up the contents of a directory as webpages. Beyond just serving up webp…

---

## [Read last line of a file](https://www.ruby-forum.com/t/read-last-line-of-a-file/120651)

<div class="topic-metadata">

**Author:** [@shuaib85](https://www.ruby-forum.com/u/shuaib85)\
**Replies:** 16\
**Last updated:** [November 22, 2007, 5:13am UTC](https://www.ruby-forum.com/t/read-last-line-of-a-file/120651 "2007-11-22T05:13:22Z")

</div>

Hi all I was trying to find a method to read only the last line of a file. I checked the the documentation and there is no such method. Beside reading line after line and checking the the eof method. Is there any fas…

---

## [Add binary to gem spec?](https://www.ruby-forum.com/t/add-binary-to-gem-spec/120915)

<div class="topic-metadata">

**Author:** [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Replies:** 5\
**Last updated:** [November 22, 2007, 5:07am UTC](https://www.ruby-forum.com/t/add-binary-to-gem-spec/120915 "2007-11-22T05:07:32Z")

</div>

Hi all - I want to add a Ruby script to a gem, so that users of the gem get not just the gem itself but also a script in /opt/local/bin that they can run which packages up some of the functionality on the command line…

---

## [Interpreting "(.\*?)" and "(?:\\d+ ?)" in REs](https://www.ruby-forum.com/t/interpreting-and-d-in-res/120953)

<div class="topic-metadata">

**Author:** [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Replies:** 2\
**Last updated:** [November 22, 2007, 5:05am UTC](https://www.ruby-forum.com/t/interpreting-and-d-in-res/120953 "2007-11-22T05:05:47Z")

</div>

Hi All, I want to extract numbers from records with a leading string of period- separated numbers. I got great responses to this on the thread http://groups.google.com/group/comp.lang.ruby/browse\_frm/thread/a811f41d7…

---

## [Soap4r over Apache](https://www.ruby-forum.com/t/soap4r-over-apache/120950)

<div class="topic-metadata">

**Author:** [@mikisvaz](https://www.ruby-forum.com/u/mikisvaz)\
**Replies:** 3\
**Last updated:** [November 22, 2007, 3:51am UTC](https://www.ruby-forum.com/t/soap4r-over-apache/120950 "2007-11-22T03:51:54Z")

</div>

Hi all, Ok, this might be a dumb question, but I’ve been on google all day and couldn’t find an anwser, so here it goes. I just did a soap4r web service for a project I developed. I was really a piece of cake. I even…

---

## [Help with regex](https://www.ruby-forum.com/t/help-with-regex/120946)

<div class="topic-metadata">

**Author:** [@Junkone](https://www.ruby-forum.com/u/Junkone)\
**Replies:** 3\
**Last updated:** [November 22, 2007, 3:14am UTC](https://www.ruby-forum.com/t/help-with-regex/120946 "2007-11-22T03:14:42Z")

</div>

i have this string a=“USD.CHF.ABC” irb(main):024:0\> a.match(/^USD/) =\> #MatchData:0x2e6be30 irb(main):025:0\> $1 =\> nil i want to use regex to see if it matches USD as first 3 characters and here is my attmept. I a…

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

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