# Ruby

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

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

---

## [Should initialize the group of threads](https://www.ruby-forum.com/t/should-initialize-the-group-of-threads/126469)

<div class="topic-metadata">

**Author:** [@sheepman](https://www.ruby-forum.com/u/sheepman)\
**Replies:** 1\
**Last updated:** [January 18, 2008, 4:57pm UTC](https://www.ruby-forum.com/t/should-initialize-the-group-of-threads/126469 "2008-01-18T16:57:02Z")

</div>

e$B$3$s$P$s$Oe(B sheepman e$B$G$9!#e(B 2e$B$A$c$s$M$k$N%9%l$G8+$+$1$?%P%0$G$9!#e(B ThreadGroup#add e$B$,$&$^$/F0$-$^$;$s!#e(B $ cat t.rb g = ThreadGroup.new t = Thread.new{sleep 5} z=0 begin g.add t p g.list z…

---

## [Passport in \*\*\*\*\* form](https://www.ruby-forum.com/t/passport-in-form/126226)

<div class="topic-metadata">

**Author:** [@prasadm29](https://www.ruby-forum.com/u/prasadm29)\
**Replies:** 4\
**Last updated:** [January 18, 2008, 4:52pm UTC](https://www.ruby-forum.com/t/passport-in-form/126226 "2008-01-18T16:52:19Z")

</div>

Hi , I am currently writing a program for logging in using telnet. Just wanted the password to be kept secret so want to implement it using \*\*\*\*\*\*\*\*\*\* when the user types in the password. Thanks, Prasad.

---

## [Avoiding Copy errors in Test::Unit (PATCH to Test::Unit::TestCase)](https://www.ruby-forum.com/t/avoiding-copy-errors-in-test-unit-patch-to-test-testcase/126474)

<div class="topic-metadata">

**Author:** [@RSBernstein](https://www.ruby-forum.com/u/RSBernstein)\
**Replies:** 1\
**Last updated:** [January 18, 2008, 4:43pm UTC](https://www.ruby-forum.com/t/avoiding-copy-errors-in-test-unit-patch-to-test-testcase/126474 "2008-01-18T16:43:32Z")

</div>

I use Test::Unit a lot, and a lot of the times I create a new test by taking an old test, copy that to a new file and start modifying it. The problem is that I sometimes forget to change the class name. When this happ…

---

## [Numeric stuff](https://www.ruby-forum.com/t/numeric-stuff/126468)

<div class="topic-metadata">

**Author:** [@editkid](https://www.ruby-forum.com/u/editkid)\
**Replies:** 1\
**Last updated:** [January 18, 2008, 4:27pm UTC](https://www.ruby-forum.com/t/numeric-stuff/126468 "2008-01-18T16:27:22Z")

</div>

Here is a patch for the rest of the number stuff. The main patch (NumericBits.patch) modifies the following files: Numeric.cs: minor fixes and documentation FixnumOps.cs and BignumOps.cs: minor fixes and improvements …

---

## [Go to specific char in a file](https://www.ruby-forum.com/t/go-to-specific-char-in-a-file/126445)

<div class="topic-metadata">

**Author:** [@tabing16](https://www.ruby-forum.com/u/tabing16)\
**Replies:** 3\
**Last updated:** [January 18, 2008, 4:11pm UTC](https://www.ruby-forum.com/t/go-to-specific-char-in-a-file/126445 "2008-01-18T16:11:27Z")

</div>

Hi I am looking for a way to get to a specific character in a file. Let’s say i have the following lines in a file ABC12AX3456XYZ ABC123HGNasdfg How do I ask ruby to grab character 3-8 on each line and display them …

---

## [Succ question of ip addr string](https://www.ruby-forum.com/t/succ-question-of-ip-addr-string/126444)

<div class="topic-metadata">

**Author:** [@ak756](https://www.ruby-forum.com/u/ak756)\
**Replies:** 2\
**Last updated:** [January 18, 2008, 4:07pm UTC](https://www.ruby-forum.com/t/succ-question-of-ip-addr-string/126444 "2008-01-18T16:07:21Z")

</div>

Hi I have a ip addr string as “192.168.000.000”, I use succ! method to get the next ip addr string. It works for the first 255 times but when ip reachs “192.168.000.255”, the succ! returns “192.168.000.256” but what I …

---

## [Dow ruby's strftime not attempt POSIX-compliance?](https://www.ruby-forum.com/t/dow-rubys-strftime-not-attempt-posix-compliance/125418)

<div class="topic-metadata">

**Author:** [@jochen\_hayek](https://www.ruby-forum.com/u/jochen_hayek)\
**Replies:** 20\
**Last updated:** [January 18, 2008, 3:11pm UTC](https://www.ruby-forum.com/t/dow-rubys-strftime-not-attempt-posix-compliance/125418 "2008-01-18T15:11:47Z")

</div>

Why is ruby’s core class Time acting like this: $ env LC\_ALL=fr\_FR date ‘+%A’ mardi $ env LC\_ALL=fr\_FR ruby -e ‘t = Time.now; puts t.strftime("%A")’ Tuesday I would actually like ruby to act like “date” and “obey” …

---

## [Needing help using Rake from within a Ruby program](https://www.ruby-forum.com/t/needing-help-using-rake-from-within-a-ruby-program/126425)

<div class="topic-metadata">

**Author:** [@roxah](https://www.ruby-forum.com/u/roxah)\
**Replies:** 4\
**Last updated:** [January 18, 2008, 1:40pm UTC](https://www.ruby-forum.com/t/needing-help-using-rake-from-within-a-ruby-program/126425 "2008-01-18T13:40:30Z")

</div>

Hello all, I’m trying to invoke rake from within one of my Unit Test files to setup a test database before running tests and I’m having some trouble doing so. I try the following code in a file that is located in th…

---

## [Create variables with caller scope](https://www.ruby-forum.com/t/create-variables-with-caller-scope/126458)

<div class="topic-metadata">

**Author:** [@Jari\_W](https://www.ruby-forum.com/u/Jari_W)\
**Replies:** 3\
**Last updated:** [January 18, 2008, 1:39pm UTC](https://www.ruby-forum.com/t/create-variables-with-caller-scope/126458 "2008-01-18T13:39:17Z")

</div>

Is it possible for a method to create new variables that becomes in the scope of the caller (instead of the scope of the method)? I guess I mean to get a method to behave much like macros or templates in C/C++. Someth…

---

## [Aliasing class methods](https://www.ruby-forum.com/t/aliasing-class-methods/126461)

<div class="topic-metadata">

**Author:** [@roxah](https://www.ruby-forum.com/u/roxah)\
**Replies:** 1\
**Last updated:** [January 18, 2008, 1:17pm UTC](https://www.ruby-forum.com/t/aliasing-class-methods/126461 "2008-01-18T13:17:30Z")

</div>

Hello all, I’m having trouble aliasing class methods. I’ve tried the following, but got errors saying the method being aliased doesn’t exist for class “Class”. Class Foo class \<\< self alias bar bla end def self.b…

---

## [Counting Cards (#152)](https://www.ruby-forum.com/t/counting-cards-152/126397)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 3\
**Last updated:** [January 18, 2008, 1:15pm UTC](https://www.ruby-forum.com/t/counting-cards-152/126397 "2008-01-18T13:15:10Z")

</div>

Denis H. put it very well when explained that there are two challenges to this quiz. The first was to implement a card counter. That’s the easy bit. Here’s the library Denis submitted for counting cards: CARDS = %…

---

## [Any dates for Beta Versions and Implenting IronRuby..?](https://www.ruby-forum.com/t/any-dates-for-beta-versions-and-implenting-ironruby/125702)

<div class="topic-metadata">

**Author:** [@softmind](https://www.ruby-forum.com/u/softmind)\
**Replies:** 2\
**Last updated:** [January 18, 2008, 11:47am UTC](https://www.ruby-forum.com/t/any-dates-for-beta-versions-and-implenting-ironruby/125702 "2008-01-18T11:47:16Z")

</div>

Hi, After reading this blog on IronRuby, I am tempted to start working on Beta Versions. http://ironruby.blogspot.com/2008/01/classic-ruby-losing-against-ironruby.html Since i am just new, and do not know procedures.…

---

## [From "int cfunc(char \*data,int \*num) " how can I get the value of 'num' in ruby/dl?](https://www.ruby-forum.com/t/from-int-cfunc-char-data-int-num-how-can-i-get-the-value-of-num-in-ruby-dl/126418)

<div class="topic-metadata">

**Author:** [@bbmerong](https://www.ruby-forum.com/u/bbmerong)\
**Replies:** 4\
**Last updated:** [January 18, 2008, 6:09am UTC](https://www.ruby-forum.com/t/from-int-cfunc-char-data-int-num-how-can-i-get-the-value-of-num-in-ruby-dl/126418 "2008-01-18T06:09:16Z")

</div>

I have a question about “ruby/dl”. I define the function in “ruby/dl” like the belows require ‘dl’ LIB=DL.dlopen(‘libfunc.dll’) cfunc=LIB\[‘cfunc’,‘ISi’\] # int cfunc(char \*data,int \*num) After typing in irb, I typed…

---

## [Using RSpec to Describe Included Module Behavior](https://www.ruby-forum.com/t/using-rspec-to-describe-included-module-behavior/126363)

<div class="topic-metadata">

**Author:** [@startrader](https://www.ruby-forum.com/u/startrader)\
**Replies:** 3\
**Last updated:** [January 18, 2008, 5:26am UTC](https://www.ruby-forum.com/t/using-rspec-to-describe-included-module-behavior/126363 "2008-01-18T05:26:35Z")

</div>

Greeting all, I’m having difficulties with RSpec. I have a module that adds some interface functions to a class (a la Rails) and I want to test their functionality. (BDD and all you know) I’m not sure how to describ…

---

## [New site for up-to-date Tk information](https://www.ruby-forum.com/t/new-site-for-up-to-date-tk-information/126356)

<div class="topic-metadata">

**Author:** [@mroths](https://www.ruby-forum.com/u/mroths)\
**Replies:** 1\
**Last updated:** [January 18, 2008, 4:55am UTC](https://www.ruby-forum.com/t/new-site-for-up-to-date-tk-information/126356 "2008-01-18T04:55:01Z")

</div>

I’ve recently launched a website to help people learn and use Tk, including a tutorial, mini-reference, additional background information and more. Two things I hope will make this both unique and useful. First, the …

---

## [From "int cfunc(char \*data,int \*num) " how can I get the value of 'num' in ruby/dl](https://www.ruby-forum.com/t/from-int-cfunc-char-data-int-num-how-can-i-get-the-value-of-num-in-ruby-dl/126417)

<div class="topic-metadata">

**Author:** [@bbmerong](https://www.ruby-forum.com/u/bbmerong)\
**Replies:** 0\
**Last updated:** [January 18, 2008, 4:15am UTC](https://www.ruby-forum.com/t/from-int-cfunc-char-data-int-num-how-can-i-get-the-value-of-num-in-ruby-dl/126417 "2008-01-18T04:15:49Z")

</div>

have a question about “ruby/dl”. I define the function in “ruby/dl” like the belows require ‘dl’ LIB=DL.dlopen(‘libfunc.dll’) cfunc=LIB\[‘cfunc’,‘ISi’\] # int cfunc(char \*data,int \*num) After typing in irb, I typed t…

---

## [What are your paths to gem?](https://www.ruby-forum.com/t/what-are-your-paths-to-gem/126416)

<div class="topic-metadata">

**Author:** [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Replies:** 0\
**Last updated:** [January 18, 2008, 4:05am UTC](https://www.ruby-forum.com/t/what-are-your-paths-to-gem/126416 "2008-01-18T04:05:52Z")

</div>

Hi everyone, I’m writing an OS X GUI app that works with the gem command line tool. Please let me know where you have gem installed. Of course I already have the default path covered, as well as /usr/ local paths fro…

---

## [? regarding Executing/Spawning Ruby calls in parallel](https://www.ruby-forum.com/t/regarding-executing-spawning-ruby-calls-in-parallel/126415)

<div class="topic-metadata">

**Author:** [@Venks](https://www.ruby-forum.com/u/Venks)\
**Replies:** 0\
**Last updated:** [January 18, 2008, 3:39am UTC](https://www.ruby-forum.com/t/regarding-executing-spawning-ruby-calls-in-parallel/126415 "2008-01-18T03:39:33Z")

</div>

Hi, I have “X” number of databases running and I need to send a query request to the “X” number of servers and I want to do this in asynchronous fashion. Meaning I want to fire off the query to each server without an…

---

## [Require 'postgres'](https://www.ruby-forum.com/t/require-postgres/196577)

<div class="topic-metadata">

**Author:** [@hiddenhippo](https://www.ruby-forum.com/u/hiddenhippo)\
**Replies:** 1\
**Last updated:** [January 18, 2008, 12:30am UTC](https://www.ruby-forum.com/t/require-postgres/196577 "2008-01-18T00:30:45Z")

</div>

hi, I’m trying to write a test application that queries a postgres database, which so far I’ve managed to do but in a limited way. I’m completely lost how to perform transactions and how to return the primary key id…

---

## [Gsub and regexes on binary files](https://www.ruby-forum.com/t/gsub-and-regexes-on-binary-files/126347)

<div class="topic-metadata">

**Author:** [@kyle\_s](https://www.ruby-forum.com/u/kyle_s)\
**Replies:** 2\
**Last updated:** [January 18, 2008, 12:05am UTC](https://www.ruby-forum.com/t/gsub-and-regexes-on-binary-files/126347 "2008-01-18T00:05:03Z")

</div>

I’m having a few issues with gsubbing a regex on a binary file. With all text, this seems to work great, but with the binary junk in a file, only some of the instances are replaced, not all. What this script is suppos…

---

## [Watir: XML Element includes Escape Sequences](https://www.ruby-forum.com/t/watir-xml-element-includes-escape-sequences/126400)

<div class="topic-metadata">

**Author:** [@liscoo](https://www.ruby-forum.com/u/liscoo)\
**Replies:** 1\
**Last updated:** [January 18, 2008, 12:00am UTC](https://www.ruby-forum.com/t/watir-xml-element-includes-escape-sequences/126400 "2008-01-18T00:00:01Z")

</div>

I’m working on a test script using Watir. I’m new to Ruby and I’m struggling with syntax. if (ARGV\[0\] == nil) #caseName = ‘Default’ caseName = ‘Other’ else caseName = ARGV\[0\] end root = doc.root testCasePath = …

---

## [Can we get some moderation?](https://www.ruby-forum.com/t/can-we-get-some-moderation/126263)

<div class="topic-metadata">

**Author:** [@kyle\_s](https://www.ruby-forum.com/u/kyle_s)\
**Replies:** 3\
**Last updated:** [January 17, 2008, 11:59pm UTC](https://www.ruby-forum.com/t/can-we-get-some-moderation/126263 "2008-01-17T23:59:47Z")

</div>

Can we get some sort of moderation on this list? I’ve noticed a few (rather offensive) emails being posted, that have absolutely nothing to do with Ruby, or the people involved with it. Thanks, Kyle

---

## [XML Validation](https://www.ruby-forum.com/t/xml-validation/126395)

<div class="topic-metadata">

**Author:** [@mangoosta](https://www.ruby-forum.com/u/mangoosta)\
**Replies:** 2\
**Last updated:** [January 17, 2008, 11:58pm UTC](https://www.ruby-forum.com/t/xml-validation/126395 "2008-01-17T23:58:02Z")

</div>

Hello, I need to validate XML documents in Ruby. I was told that REXML can’t perform validation, thus I tried using libxml. SaxParser can’t validate against a given DTD, so I tried DOM Parser. But I can’t find a way …

---

## [CruiseControl problem. Broken Pipe?](https://www.ruby-forum.com/t/cruisecontrol-problem-broken-pipe/196578)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [January 17, 2008, 11:56pm UTC](https://www.ruby-forum.com/t/cruisecontrol-problem-broken-pipe/196578 "2008-01-17T23:56:52Z")

</div>

Hi Friends, Just happened to catch this err in the CC log: Build loop failed BuilderError: Write failed: Broken pipe ./script/…/config/…/app/models/subversion.rb:98:in execute\_in\_local\_copy' ./script/../config/../li…

---

## [Eval(str.dump)==str](https://www.ruby-forum.com/t/eval-str-dump-str/126291)

<div class="topic-metadata">

**Author:** [@Kazuhiro\_NISHIYAMA](https://www.ruby-forum.com/u/Kazuhiro_NISHIYAMA)\
**Replies:** 3\
**Last updated:** [January 17, 2008, 11:36pm UTC](https://www.ruby-forum.com/t/eval-str-dump-str/126291 "2008-01-17T23:36:49Z")

</div>

e$B@\>;3OB9-$G$9!#e(B 1.8 e$B$@$He(B eval(str.dump) == str e$B$,e(B true e$B$K$J$j$^$9$,!“e(B 1.9 e$B$@$He(B encoding e$B$N4X78$Ge(B false e$B$K$J$k$3$H$,$”$k$N$Oe(B e$B$=$&$$$&$b$N$G$7$g$&$+e(B? e$B$=$&$$$&$b$N$@$H$9…

---

## [Quick question](https://www.ruby-forum.com/t/quick-question/126386)

<div class="topic-metadata">

**Author:** [@johnsmith](https://www.ruby-forum.com/u/johnsmith)\
**Replies:** 4\
**Last updated:** [January 17, 2008, 10:20pm UTC](https://www.ruby-forum.com/t/quick-question/126386 "2008-01-17T22:20:25Z")

</div>

hey how do i access i global variable in ruby? thanks

---

## [Lambda block doesn't work with upto iterator](https://www.ruby-forum.com/t/lambda-block-doesnt-work-with-upto-iterator/126372)

<div class="topic-metadata">

**Author:** [@Ed\_Loyot](https://www.ruby-forum.com/u/Ed_Loyot)\
**Replies:** 3\
**Last updated:** [January 17, 2008, 7:59pm UTC](https://www.ruby-forum.com/t/lambda-block-doesnt-work-with-upto-iterator/126372 "2008-01-17T19:59:52Z")

</div>

Hi Folks, I’m new to Ruby and I’m trying to get a complete understanding of blocks. I captured some code in a block using lambda and was able to execute the code with the .time Integer iterator, but I get an excepti…

---

## [Syntax error on SQL statement](https://www.ruby-forum.com/t/syntax-error-on-sql-statement/126361)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [January 17, 2008, 7:28pm UTC](https://www.ruby-forum.com/t/syntax-error-on-sql-statement/126361 "2008-01-17T19:28:02Z")

</div>

Hi, I’m using the latest version of Ruby for Fedora Core 6 Linux. I want to write concise SQL statements, but the following @subscriber = Subscriber.find(:first, :conditions =\> “pharmacy\_id = ?”, @pharmacy\_id) is g…

---

## [FXRuby or Shoes?](https://www.ruby-forum.com/t/fxruby-or-shoes/126316)

<div class="topic-metadata">

**Author:** [@biot023](https://www.ruby-forum.com/u/biot023)\
**Replies:** 9\
**Last updated:** [January 17, 2008, 7:26pm UTC](https://www.ruby-forum.com/t/fxruby-or-shoes/126316 "2008-01-17T19:26:16Z")

</div>

Sorry I’ve posted this in the generic Ruby thread, but I wanted as unbiased a set of responses as possible. Now that the PP FXRuby book is out, I really have a yen to begin developing desktop apps again. I’ve looked,…

---

## [? President Wilson Blackmailed by Samuel Untermeyer - How Brandeis was appointed to the SUPREME CO](https://www.ruby-forum.com/t/president-wilson-blackmailed-by-samuel-untermeyer-how-brandeis-was-appointed-to-the-supreme-co/126364)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [January 17, 2008, 6:40pm UTC](https://www.ruby-forum.com/t/president-wilson-blackmailed-by-samuel-untermeyer-how-brandeis-was-appointed-to-the-supreme-co/126364 "2008-01-17T18:40:19Z")

</div>

?? President Wilson Blackmailed by Samuel Untermeyer - How Brandeis was appointed to the SUPREME COURT ?? President Wilson Blackmailed : Shortly after President Wilson’s first inauguration, he received a visitor in t…

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

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