# Ruby

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

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

---

## [Perl tr and ruby String#tr](https://www.ruby-forum.com/t/perl-tr-and-ruby-string-tr/64698)

<div class="topic-metadata">

**Author:** [@snacktime](https://www.ruby-forum.com/u/snacktime)\
**Replies:** 13\
**Last updated:** [August 15, 2006, 2:18pm UTC](https://www.ruby-forum.com/t/perl-tr-and-ruby-string-tr/64698 "2006-08-15T14:18:42Z")

</div>

This, in perl: $str =~ tr/\\0\\200/\\200\\0/; Produces a different result then this: str.tr!("\\0\\200","\\200\\0") How do I do this in ruby?

---

## [Getting Things Done in IRB (A sort of TODO list thing)](https://www.ruby-forum.com/t/getting-things-done-in-irb-a-sort-of-todo-list-thing/64709)

<div class="topic-metadata">

**Author:** [@naething](https://www.ruby-forum.com/u/naething)\
**Replies:** 1\
**Last updated:** [August 15, 2006, 2:18pm UTC](https://www.ruby-forum.com/t/getting-things-done-in-irb-a-sort-of-todo-list-thing/64709 "2006-08-15T14:18:41Z")

</div>

Hi folks. Just a little script to share with any folks who’ve read and follow the Getting Things Done system. I must warn you, this is a grossly simplified (or more positively, open ended) implementation of the syst…

---

## [REXML XPath: bug or misunderstanding?](https://www.ruby-forum.com/t/rexml-xpath-bug-or-misunderstanding/100953)

<div class="topic-metadata">

**Author:** [@xmg-eric](https://www.ruby-forum.com/u/xmg-eric)\
**Replies:** 16\
**Last updated:** [August 15, 2006, 2:18pm UTC](https://www.ruby-forum.com/t/rexml-xpath-bug-or-misunderstanding/100953 "2006-08-15T14:18:39Z")

</div>

This code looks for a table that matches specific criteria: XPath.each(@doc, '//table') do |tbl| XPath.each(tbl, '//td') do |td| # look for matching data According to the XPath doc, the first argument is the…

---

## [Newbie at ruby - syntactic sugar for Range / Array](https://www.ruby-forum.com/t/newbie-at-ruby-syntactic-sugar-for-range-array/102211)

<div class="topic-metadata">

**Author:** [@toolkit](https://www.ruby-forum.com/u/toolkit)\
**Replies:** 11\
**Last updated:** [August 15, 2006, 2:18pm UTC](https://www.ruby-forum.com/t/newbie-at-ruby-syntactic-sugar-for-range-array/102211 "2006-08-15T14:18:38Z")

</div>

Hi there, Was hoping someone could point me in the right direction. I’m currently learning a little ruby, and going through some of the puzzles from the Ruby Q. book. One of the examples uses a very strange looking c…

---

## [Parse/Split \`cmd\`](https://www.ruby-forum.com/t/parse-split-cmd/64750)

<div class="topic-metadata">

**Author:** [@tjones](https://www.ruby-forum.com/u/tjones)\
**Replies:** 2\
**Last updated:** [August 15, 2006, 2:18pm UTC](https://www.ruby-forum.com/t/parse-split-cmd/64750 "2006-08-15T14:18:37Z")

</div>

Hello, I’m really new to Ruby, I have been using TCL for a really long time and I just picked up the “Programming Ruby” book and I really like it. One very simple thing I do a lot in my TCL scripts is parse the output …

---

## [Map or collect with multidimension arrays](https://www.ruby-forum.com/t/map-or-collect-with-multidimension-arrays/64707)

<div class="topic-metadata">

**Author:** [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Replies:** 11\
**Last updated:** [August 15, 2006, 2:18pm UTC](https://www.ruby-forum.com/t/map-or-collect-with-multidimension-arrays/64707 "2006-08-15T14:18:35Z")

</div>

What would be the proper call to a multi array either collect or map ? TIA Stuart

---

## [Trouble squashing Ruby bug](https://www.ruby-forum.com/t/trouble-squashing-ruby-bug/102437)

<div class="topic-metadata">

**Author:** [@joe-black](https://www.ruby-forum.com/u/joe-black)\
**Replies:** 2\
**Last updated:** [August 15, 2006, 2:18pm UTC](https://www.ruby-forum.com/t/trouble-squashing-ruby-bug/102437 "2006-08-15T14:18:25Z")

</div>

I’m writing a c++ Ruby extension that seems to be running into some kind of a memory issue. I’m getting “HEAP: free heap block modified after it was freed” when I attempt to either allocate a new array(rb\_ary\_new) or …

---

## [Bus Error on OS X with rjb, irb and dl](https://www.ruby-forum.com/t/bus-error-on-os-x-with-rjb-irb-and-dl/64669)

<div class="topic-metadata">

**Author:** [@arton](https://www.ruby-forum.com/u/arton)\
**Replies:** 9\
**Last updated:** [August 15, 2006, 2:18pm UTC](https://www.ruby-forum.com/t/bus-error-on-os-x-with-rjb-irb-and-dl/64669 "2006-08-15T14:18:24Z")

</div>

artone$B$G$9!#e(B OS Xe$B$G!"e(Brjbe$B$re(Birbe$B$rMxMQ$7$FF0$+$9$He(BBuge$B$K$J$k$H$$$&%l%\]!\<%H$,Mh$?$N$G;n$7e(B e$B$?$H$3$m!"3N\<B$K:F8=$9$k$h$&$G$9!Je(Bruby-1.8.4 e$B%j%j!\<%9HG!K!#e(B e$B$^$C$?$/8+Ev$,$D$+$J$$$N$G=…

---

## [Regexp Parsing -- What's the right way?](https://www.ruby-forum.com/t/regexp-parsing-whats-the-right-way/102454)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 6\
**Last updated:** [August 15, 2006, 2:18pm UTC](https://www.ruby-forum.com/t/regexp-parsing-whats-the-right-way/102454 "2006-08-15T14:18:24Z")

</div>

Greetings, I’m trying to parse the following line: “00608 P 135 001 LEC Tu 2-5P 210 WHEELER Information Tech and Soceity 3 LAGUERRE” i’ve constructed the following regexp: /(\\d{5}).(\\D\\s\\w{2,4}).(\\d{1,4}\\s\\D{3}).(\\D…

---

## [Dire need for inject\_with\_index](https://www.ruby-forum.com/t/dire-need-for-inject-with-index/102442)

<div class="topic-metadata">

**Author:** [@leslieviljoen](https://www.ruby-forum.com/u/leslieviljoen)\
**Replies:** 4\
**Last updated:** [August 15, 2006, 2:18pm UTC](https://www.ruby-forum.com/t/dire-need-for-inject-with-index/102442 "2006-08-15T14:18:21Z")

</div>

Hi people! See my nifty little class for converting a few time strings to seconds. See how the last line of self.seconds reverses an array and then adds up each part, multiplying the first with 1, the second with 60 …

---

## [String#split(/\\s+/) vs. String#split(/(\\s+)/)](https://www.ruby-forum.com/t/string-split-s-vs-string-split-s/102174)

<div class="topic-metadata">

**Author:** [@ssk](https://www.ruby-forum.com/u/ssk)\
**Replies:** 5\
**Last updated:** [August 15, 2006, 2:18pm UTC](https://www.ruby-forum.com/t/string-split-s-vs-string-split-s/102174 "2006-08-15T14:18:18Z")

</div>

Hello Rubyists, I’m reading Ruby Cookbook. The first chapter is about String. One of the examples shows the differenct between String#split(/\\s+/) and String#split(/(\\s+)/) without much explanation. I understand wha…

---

## [Pickaxe Question](https://www.ruby-forum.com/t/pickaxe-question/64722)

<div class="topic-metadata">

**Author:** [@farfignugen](https://www.ruby-forum.com/u/farfignugen)\
**Replies:** 2\
**Last updated:** [August 15, 2006, 2:18pm UTC](https://www.ruby-forum.com/t/pickaxe-question/64722 "2006-08-15T14:18:18Z")

</div>

On page 53 of the Pickaxe Book there is a little example illustrating Proc parameters: songlist = SongList.new class JukeboxButton \< Button def initialize(label, &action) super(label) @action = action end def but…

---

## [Phoenix Ruby User Group August Meeting](https://www.ruby-forum.com/t/phoenix-ruby-user-group-august-meeting/64732)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 0\
**Last updated:** [August 15, 2006, 2:18pm UTC](https://www.ruby-forum.com/t/phoenix-ruby-user-group-august-meeting/64732 "2006-08-15T14:18:17Z")

</div>

The Phoenix Ruby U. Group will hold its August meeting on Monday, August 14, 2006, at 6:15pm. The meeting will be held at facilities graciously provided by Cyclone Commerce. Please see the group wiki at: http://ruby…

---

## [SCALE 5x Call For Papers Is Now Open](https://www.ruby-forum.com/t/scale-5x-call-for-papers-is-now-open/64723)

<div class="topic-metadata">

**Author:** [@Ilan\_Rabinovitch](https://www.ruby-forum.com/u/Ilan_Rabinovitch)\
**Replies:** 0\
**Last updated:** [August 15, 2006, 2:18pm UTC](https://www.ruby-forum.com/t/scale-5x-call-for-papers-is-now-open/64723 "2006-08-15T14:18:17Z")

</div>

Hello Ruby fans, I would like to invite you to participate in the 2007 Southern California Linux Expo’s call for papers. We just announced the CFP for SCALE 5x. SCALE is a non-profit / community event on the topic o…

---

## [Beginner's question: assigning same value to many variables](https://www.ruby-forum.com/t/beginners-question-assigning-same-value-to-many-variables/102167)

<div class="topic-metadata">

**Author:** [@orlick](https://www.ruby-forum.com/u/orlick)\
**Replies:** 15\
**Last updated:** [August 15, 2006, 2:18pm UTC](https://www.ruby-forum.com/t/beginners-question-assigning-same-value-to-many-variables/102167 "2006-08-15T14:18:08Z")

</div>

I’m just starting out in programming, using Ruby to learn. I’m trying to write a short program that will use a handful of variables, and I want to be sure that all of the variables start with the value ‘’ (strings of …

---

## [Ruby on Rails and Star Schemas Question](https://www.ruby-forum.com/t/ruby-on-rails-and-star-schemas-question/64708)

<div class="topic-metadata">

**Author:** [@Anthony\_Garcia](https://www.ruby-forum.com/u/Anthony_Garcia)\
**Replies:** 1\
**Last updated:** [August 15, 2006, 2:18pm UTC](https://www.ruby-forum.com/t/ruby-on-rails-and-star-schemas-question/64708 "2006-08-15T14:18:02Z")

</div>

Good morning, I’m a ruby on rails newby and trying to figure out how I can execute a star schema query like this. select generators.Unit, thedates.weekday\_name, hours.thehour, sum(generatorfacts.revenue) from ge…

---

## [Multiple scripts accessing one WEBrick session?](https://www.ruby-forum.com/t/multiple-scripts-accessing-one-webrick-session/102424)

<div class="topic-metadata">

**Author:** [@Naren](https://www.ruby-forum.com/u/Naren)\
**Replies:** 2\
**Last updated:** [August 15, 2006, 2:18pm UTC](https://www.ruby-forum.com/t/multiple-scripts-accessing-one-webrick-session/102424 "2006-08-15T14:18:01Z")

</div>

I want to set up a a machine as a servlet container using WEBrick. But I want to be able to add several servlets, hopefully from separate Ruby scripts. So here is the sample to start one servlet right, ===============…

---

## [Gets give me last arg of script?](https://www.ruby-forum.com/t/gets-give-me-last-arg-of-script/64701)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 4\
**Last updated:** [August 15, 2006, 2:18pm UTC](https://www.ruby-forum.com/t/gets-give-me-last-arg-of-script/64701 "2006-08-15T14:18:00Z")

</div>

something i don’t understand : gets give me last arg of script ??? here is part of my script : def get\_respons return (/^\[y|Y|O|o\].\*/ === gets.to\_s.chomp) end dir\_path=Dir.pwd dir\_path=$\[0\] if $.length == 1 puts …

---

## [IRB and rb files](https://www.ruby-forum.com/t/irb-and-rb-files/64706)

<div class="topic-metadata">

**Author:** [@ClassRubyExceptionH](https://www.ruby-forum.com/u/ClassRubyExceptionH)\
**Replies:** 3\
**Last updated:** [August 15, 2006, 2:17pm UTC](https://www.ruby-forum.com/t/irb-and-rb-files/64706 "2006-08-15T14:17:59Z")

</div>

As I make my way through the Pragmatic Programmer’s Guide I am puzzled by the following issue: If I type in a Ruby program such as class Song def initialize(name, artist, duration) @name = name @artist = arti…

---

## [Sh command that ascends dir tree for executable](https://www.ruby-forum.com/t/sh-command-that-ascends-dir-tree-for-executable/64705)

<div class="topic-metadata">

**Author:** [@Trans](https://www.ruby-forum.com/u/Trans)\
**Replies:** 0\
**Last updated:** [August 15, 2006, 2:17pm UTC](https://www.ruby-forum.com/t/sh-command-that-ascends-dir-tree-for-executable/64705 "2006-08-15T14:17:57Z")

</div>

Before I do and implement this myself, want to make sure it doesn;t already exist in some fashion: A command line utility like ‘sh’ but one that will ascend the directory tree to find the executable. Thanks, T.

---

## [Date](https://www.ruby-forum.com/t/date/64704)

<div class="topic-metadata">

**Author:** [@Tadayoshi\_F](https://www.ruby-forum.com/u/Tadayoshi_F)\
**Replies:** 0\
**Last updated:** [August 15, 2006, 2:17pm UTC](https://www.ruby-forum.com/t/date/64704 "2006-08-15T14:17:56Z")

</div>

date e$B$K0J2\<$N$h$&$JJQ99$r$7$^$9!"$?$V$s!#e(B parse e$BG/F|IUe(B (e$BNce(B: 2006-333, 2006333 06333) e$B$dNq=5F|IUe(B (e$BNce(B: 2006-W15-5, 2006W155 06W155) e$B$GF|IU$,:n$l$^$9!#e(B ‘GMT Standard Time’ e$B$N$h$&$…

---

## [Ruby Extensions](https://www.ruby-forum.com/t/ruby-extensions/102163)

<div class="topic-metadata">

**Author:** [@rtijoriwala](https://www.ruby-forum.com/u/rtijoriwala)\
**Replies:** 1\
**Last updated:** [August 15, 2006, 2:17pm UTC](https://www.ruby-forum.com/t/ruby-extensions/102163 "2006-08-15T14:17:50Z")

</div>

Hello All, I need to wrap/extend my C++ header file to be able to use it from Ruby. The header file depends on other header files as well. But the only functionality I desire to use in from Ruby is from the original h…

---

## [Starting IRB and interfacing with it](https://www.ruby-forum.com/t/starting-irb-and-interfacing-with-it/102441)

<div class="topic-metadata">

**Author:** [@Chris\_Bielinski](https://www.ruby-forum.com/u/Chris_Bielinski)\
**Replies:** 1\
**Last updated:** [August 15, 2006, 2:17pm UTC](https://www.ruby-forum.com/t/starting-irb-and-interfacing-with-it/102441 "2006-08-15T14:17:49Z")

</div>

Hey, I’m working on an IRC bot. I’d like to be able to open an IRB in a thread or something and have everyone in the channel type in code and the bot spit back the results. I’m pretty new to Ruby, so I was wondering …

---

## [Documentation/examples for mcrypt/mhash](https://www.ruby-forum.com/t/documentation-examples-for-mcrypt-mhash/102457)

<div class="topic-metadata">

**Author:** [@Meino\_Christian\_C](https://www.ruby-forum.com/u/Meino_Christian_C)\
**Replies:** 0\
**Last updated:** [August 15, 2006, 2:17pm UTC](https://www.ruby-forum.com/t/documentation-examples-for-mcrypt-mhash/102457 "2006-08-15T14:17:48Z")

</div>

Hi, I am looking for some documentation about the mhash and mcrypt ruby libraries or some usage examples. The archives of these libs do not have any docs… Where can I get some infos? Thank you very much in advance f…

---

## [Good writing in Ruby](https://www.ruby-forum.com/t/good-writing-in-ruby/102320)

<div class="topic-metadata">

**Author:** [@Josselin](https://www.ruby-forum.com/u/Josselin)\
**Replies:** 17\
**Last updated:** [August 15, 2006, 2:17pm UTC](https://www.ruby-forum.com/t/good-writing-in-ruby/102320 "2006-08-15T14:17:45Z")

</div>

I know I can write it the ‘ugly common way’ (loop) but I’d like to see how it can be done the Ruby way … (I am a newbie…) here is an array roles = \[ “a”, “b”, “c”, “d”, “e” \] Depending upon a variable ‘user.role’, …

---

## [Defining Eigenclass](https://www.ruby-forum.com/t/defining-eigenclass/102358)

<div class="topic-metadata">

**Author:** [@maraby](https://www.ruby-forum.com/u/maraby)\
**Replies:** 21\
**Last updated:** [August 15, 2006, 2:17pm UTC](https://www.ruby-forum.com/t/defining-eigenclass/102358 "2006-08-15T14:17:44Z")

</div>

So, what is an eigenclass? I googled it, and couldn’t find anything about it (other than Mauricio’s great blog/wiki). Wikipedia doesn’t have anything on it other than an indirect relation to Metaprogramming (which I a…

---

## [Cannot require a file that doesnt have a prefix?](https://www.ruby-forum.com/t/cannot-require-a-file-that-doesnt-have-a-prefix/102439)

<div class="topic-metadata">

**Author:** [@Trans](https://www.ruby-forum.com/u/Trans)\
**Replies:** 5\
**Last updated:** [August 15, 2006, 2:17pm UTC](https://www.ruby-forum.com/t/cannot-require-a-file-that-doesnt-have-a-prefix/102439 "2006-08-15T14:17:44Z")

</div>

Huh… why can’t I require a file that has no prefix? % ls redirect % irb require ‘./redirect’ LoadError: no such file to load – ./redirect from (irb):1:in \`require’ from (irb):1 from :0 T.

---

## [Cardinal: Not dead yet?](https://www.ruby-forum.com/t/cardinal-not-dead-yet/102405)

<div class="topic-metadata">

**Author:** [@James\_FSHranicky](https://www.ruby-forum.com/u/James_FSHranicky)\
**Replies:** 4\
**Last updated:** [August 15, 2006, 2:17pm UTC](https://www.ruby-forum.com/t/cardinal-not-dead-yet/102405 "2006-08-15T14:17:39Z")

</div>

Didn’t know this: http://www.parrotcode.org/news/2006/Parrot-0.4.6.html

---

## [Ldap](https://www.ruby-forum.com/t/ldap/102445)

<div class="topic-metadata">

**Author:** [@barjunk](https://www.ruby-forum.com/u/barjunk)\
**Replies:** 4\
**Last updated:** [August 15, 2006, 2:17pm UTC](https://www.ruby-forum.com/t/ldap/102445 "2006-08-15T14:17:35Z")

</div>

Are folks just using net/ldap or are there some other ldap libraries that folks prefer? What I’d like is to be able to bind to the server then make multiple queries, modifications, etc. Thanks for any guidance. Mike…

---

## [Re: nonce](https://www.ruby-forum.com/t/re-nonce/102421)

<div class="topic-metadata">

**Author:** [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Replies:** 3\
**Last updated:** [August 15, 2006, 2:17pm UTC](https://www.ruby-forum.com/t/re-nonce/102421 "2006-08-15T14:17:35Z")

</div>

everything else in Ruby is in English. Gestalt. Regards, agent provocateur? or enfant terrible? :slight\_smile: Heh, well put Bill. I have no problem with a non-english word (or even a made up word) so long as…

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

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