# Ruby

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

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

---

## [Partitioning with Set.divide](https://www.ruby-forum.com/t/partitioning-with-set-divide/93214)

<div class="topic-metadata">

**Author:** [@splattael](https://www.ruby-forum.com/u/splattael)\
**Replies:** 6\
**Last updated:** [April 30, 2007, 11:55am UTC](https://www.ruby-forum.com/t/partitioning-with-set-divide/93214 "2007-04-30T11:55:25Z")

</div>

Hello all, I have been playing with partitioning a set recently and I am stuck with an issue. The whole story is here: http://www.rubyrailways.com/partitioning-sets-in-ruby/ A quick version for those who would not li…

---

## [Editing a text file](https://www.ruby-forum.com/t/editing-a-text-file/93138)

<div class="topic-metadata">

**Author:** [@barjunk](https://www.ruby-forum.com/u/barjunk)\
**Replies:** 3\
**Last updated:** [April 30, 2007, 11:26am UTC](https://www.ruby-forum.com/t/editing-a-text-file/93138 "2007-04-30T11:26:22Z")

</div>

There is a task to edit a text file. It is entirely possible that multiple people are going to be running the ruby script that edits this file at the same time. I have looked at Ruby cookbook recipe 6.13 and 20.11. …

---

## [Sorting by rand?](https://www.ruby-forum.com/t/sorting-by-rand/93252)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 21\
**Last updated:** [April 30, 2007, 10:02am UTC](https://www.ruby-forum.com/t/sorting-by-rand/93252 "2007-04-30T10:02:15Z")

</div>

Browsing something at a bookstore recently, I saw an example of an array shuffle allegedly implemented with x.sort { rand } or something to that effect. This seems sort of unlikely, to me, to be a correct shuffling …

---

## [\#guide](https://www.ruby-forum.com/t/guide/93263)

<div class="topic-metadata">

**Author:** [@geetha](https://www.ruby-forum.com/u/geetha)\
**Replies:** 3\
**Last updated:** [April 30, 2007, 7:34am UTC](https://www.ruby-forum.com/t/guide/93263 "2007-04-30T07:34:10Z")

</div>

hi, I wish to know about the links , which is used to learn ruby. Thanks, sangeetha.

---

## [\[QUIZ\] Checking Credit Cards (#122)](https://www.ruby-forum.com/t/quiz-checking-credit-cards-122/93221)

<div class="topic-metadata">

**Author:** [@toadkicker](https://www.ruby-forum.com/u/toadkicker)\
**Replies:** 1\
**Last updated:** [April 30, 2007, 5:53am UTC](https://www.ruby-forum.com/t/quiz-checking-credit-cards-122/93221 "2007-04-30T05:53:04Z")

</div>

Spartan solution (along with its obscure sister below) :slight\_smile: usage: ruby quiz122.rb \<credit card number with no dashes or spaces\> example: ruby quiz122.rb 341275084937123 some variables user\_input = $\*\[0\] su…

---

## [Swapping characters in a string](https://www.ruby-forum.com/t/swapping-characters-in-a-string/93255)

<div class="topic-metadata">

**Author:** [@Michael\_WSRyder](https://www.ruby-forum.com/u/Michael_WSRyder)\
**Replies:** 2\
**Last updated:** [April 30, 2007, 5:01am UTC](https://www.ruby-forum.com/t/swapping-characters-in-a-string/93255 "2007-04-30T05:01:01Z")

</div>

Is there any way in Ruby, short of stepping through a string character by character, to swap two characters? For example, if I want to replace all of the commas with periods and periods with commas.

---

## [Problem with YAML:load](https://www.ruby-forum.com/t/problem-with-yaml-load/93143)

<div class="topic-metadata">

**Author:** [@bino](https://www.ruby-forum.com/u/bino)\
**Replies:** 4\
**Last updated:** [April 30, 2007, 3:50am UTC](https://www.ruby-forum.com/t/problem-with-yaml-load/93143 "2007-04-30T03:50:00Z")

</div>

Dear All. I’m learning to use yaml4r A friend of me, give a simple script for starting point, i save it as lyaml01 ---------Start lyaml01----- Nota = Struct.new(:nomor, :items) Item = Struct.new(:description, :quan…

---

## [Looking for thoughts and opinions on Ruport, and reporting i](https://www.ruby-forum.com/t/looking-for-thoughts-and-opinions-on-ruport-and-reporting-i/93079)

<div class="topic-metadata">

**Author:** [@naething](https://www.ruby-forum.com/u/naething)\
**Replies:** 23\
**Last updated:** [April 30, 2007, 1:48am UTC](https://www.ruby-forum.com/t/looking-for-thoughts-and-opinions-on-ruport-and-reporting-i/93079 "2007-04-30T01:48:51Z")

</div>

Hi Folks, I announced Ruport 1.0 RC1 a few days ago, and a few folks here on RubyTalk were really helpful about pointing out some issues. Since we’ve only got a few weeks left before our scheduled ‘real’ release of 1…

---

## [Infix to Postfix Method](https://www.ruby-forum.com/t/infix-to-postfix-method/93193)

<div class="topic-metadata">

**Author:** [@dracos](https://www.ruby-forum.com/u/dracos)\
**Replies:** 9\
**Last updated:** [April 30, 2007, 1:32am UTC](https://www.ruby-forum.com/t/infix-to-postfix-method/93193 "2007-04-30T01:32:50Z")

</div>

I’m still getting to grips with Ruby, but I think I’m doing well. My last post generated a lot of positive comments/advice which really helped me, so I thought I’d post some more of my code to try and repeat that! Th…

---

## [Accessing gems from /home dir](https://www.ruby-forum.com/t/accessing-gems-from-home-dir/93023)

<div class="topic-metadata">

**Author:** [@jzakiya](https://www.ruby-forum.com/u/jzakiya)\
**Replies:** 3\
**Last updated:** [April 30, 2007, 12:56am UTC](https://www.ruby-forum.com/t/accessing-gems-from-home-dir/93023 "2007-04-30T00:56:48Z")

</div>

I have Linux on a Toshiba Satellite laptop. In my home dir I’m running Ruby 1.8.6. In my root dir I have Ruby 1.8.4 which was installed from my distro’s (PCLinuxOS) repositories. All my gems are loaded and run under …

---

## [Strange DRb and fork issues](https://www.ruby-forum.com/t/strange-drb-and-fork-issues/93215)

<div class="topic-metadata">

**Author:** [@Farrel\_L](https://www.ruby-forum.com/u/Farrel_L)\
**Replies:** 7\
**Last updated:** [April 30, 2007, 12:06am UTC](https://www.ruby-forum.com/t/strange-drb-and-fork-issues/93215 "2007-04-30T00:06:44Z")

</div>

Hi all, I’m busy experimenting with DRb and I’ve hit some strange behaviour which I can’t get seem to find the cause of. I think it might be something to do with DRb and forks but I’m unsure. The process I’m trying t…

---

## [Parsing text with regular expression](https://www.ruby-forum.com/t/parsing-text-with-regular-expression/93239)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 2\
**Last updated:** [April 29, 2007, 10:54pm UTC](https://www.ruby-forum.com/t/parsing-text-with-regular-expression/93239 "2007-04-29T22:54:59Z")

</div>

Hi I am writing a class that parses text. It checks each word and counts how many times they occur in the text. It also checks for ‘special’ words, that being words that are capitalized, all upper case or in mixed ca…

---

## [What is the best ruby on rails doc/guide/tutorial/book?](https://www.ruby-forum.com/t/what-is-the-best-ruby-on-rails-doc-guide-tutorial-book/93224)

<div class="topic-metadata">

**Author:** [@anansi](https://www.ruby-forum.com/u/anansi)\
**Replies:** 4\
**Last updated:** [April 29, 2007, 10:54pm UTC](https://www.ruby-forum.com/t/what-is-the-best-ruby-on-rails-doc-guide-tutorial-book/93224 "2007-04-29T22:54:37Z")

</div>

Hi, after playing a bit with ruby I also wanna put my head into ruby on rails. What is the best paper to learn from? What advice can you give me? – greets ( ) ( /\\ .-"""-. / //\\/ , //\\ |/| ,;;;;;, |/| //\\…

---

## [Fwd: Please Forward: Ruby Quiz Submission](https://www.ruby-forum.com/t/fwd-please-forward-ruby-quiz-submission/229092)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 1\
**Last updated:** [April 29, 2007, 10:46pm UTC](https://www.ruby-forum.com/t/fwd-please-forward-ruby-quiz-submission/229092 "2007-04-29T22:46:36Z")

</div>

Begin forwarded message:

---

## [Gem headache](https://www.ruby-forum.com/t/gem-headache/93213)

<div class="topic-metadata">

**Author:** [@fero](https://www.ruby-forum.com/u/fero)\
**Replies:** 4\
**Last updated:** [April 29, 2007, 9:02pm UTC](https://www.ruby-forum.com/t/gem-headache/93213 "2007-04-29T21:02:26Z")

</div>

hello. please help, i cannot install gem from local .gem file: gem install rmagick-1.14.1-win32 --local --install-dir c:/TEMP ERROR: Local gem file not found: rmagick-1.14.1-win32\*.gem ERROR: Could not install a loc…

---

## [Helping ri find rdoc](https://www.ruby-forum.com/t/helping-ri-find-rdoc/93225)

<div class="topic-metadata">

**Author:** [@sdsykes](https://www.ruby-forum.com/u/sdsykes)\
**Replies:** 1\
**Last updated:** [April 29, 2007, 8:18pm UTC](https://www.ruby-forum.com/t/helping-ri-find-rdoc/93225 "2007-04-29T20:18:22Z")

</div>

Hi, So I noticed that documentation for ri seems to be stored in yaml files in subdirectories of my opt/local/share/ri/1.8/system folder. And not in usr/local/bin or usr/bin with my tools. I always see rdoc generati…

---

## [Phoenix Ruby Users Group May Meeting](https://www.ruby-forum.com/t/phoenix-ruby-users-group-may-meeting/93234)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 0\
**Last updated:** [April 29, 2007, 7:53pm UTC](https://www.ruby-forum.com/t/phoenix-ruby-users-group-may-meeting/93234 "2007-04-29T19:53:20Z")

</div>

The Phoenix Ruby U. Group will hold its May meeting on Monday, May 14, at 6:30 pm, at MWA Intelligence (same place as last month) See http://rubyaz.org/groups/prug/ for location details The meeting will run until ~ …

---

## [Ruby must run in c:\\ruby in order to find libraries (xp sp2)](https://www.ruby-forum.com/t/ruby-must-run-in-c-ruby-in-order-to-find-libraries-xp-sp2/93172)

<div class="topic-metadata">

**Author:** [@zenix](https://www.ruby-forum.com/u/zenix)\
**Replies:** 1\
**Last updated:** [April 29, 2007, 7:37pm UTC](https://www.ruby-forum.com/t/ruby-must-run-in-c-ruby-in-order-to-find-libraries-xp-sp2/93172 "2007-04-29T19:37:19Z")

</div>

Microsoft Windows© XP SP2 with the latest patches, bugfixes, etc. Ruby 1.8.5 and .6, both did not work Rubygems 0.9.2 RUBYOPT = -rubygems PATH = c:\\ruby\\bin;c:\\perl… Installed via One-Click-Installer (both .5 and .6…

---

## [Connecting to a socket](https://www.ruby-forum.com/t/connecting-to-a-socket/93205)

<div class="topic-metadata">

**Author:** [@Petr](https://www.ruby-forum.com/u/Petr)\
**Replies:** 1\
**Last updated:** [April 29, 2007, 2:06pm UTC](https://www.ruby-forum.com/t/connecting-to-a-socket/93205 "2007-04-29T14:06:49Z")

</div>

Hi everyone, I’ve got a mailfilter (dspam) that runs in a daemon mode and thus can be connected to via a socket /tmp/dspam.sock. How do would I use Ruby to connect to this socket? Petr

---

## [Using Watir and Ruby2Exe together](https://www.ruby-forum.com/t/using-watir-and-ruby2exe-together/92878)

<div class="topic-metadata">

**Author:** [@jimc](https://www.ruby-forum.com/u/jimc)\
**Replies:** 12\
**Last updated:** [April 29, 2007, 12:09pm UTC](https://www.ruby-forum.com/t/using-watir-and-ruby2exe-together/92878 "2007-04-29T12:09:38Z")

</div>

I’ve been asked to help solve a browser issue that I think Watir and Ruby2Exe may be able to solve. However, I ask the group for a quick reality check before proposing a solution and heading into the deep unknown (at …

---

## [Output A File w/ Line Numbers?](https://www.ruby-forum.com/t/output-a-file-w-line-numbers/93078)

<div class="topic-metadata">

**Author:** [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Replies:** 17\
**Last updated:** [April 29, 2007, 11:35am UTC](https://www.ruby-forum.com/t/output-a-file-w-line-numbers/93078 "2007-04-29T11:35:35Z")

</div>

I’d like to read a file and output its contents (just to terminal is fine for simplicity) with line numbers. Is there a Ruby library method that handles this like unix cat? Of course we can write a looping one-liner, …

---

## [Ruby training materials suggestions required](https://www.ruby-forum.com/t/ruby-training-materials-suggestions-required/93195)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 9\
**Last updated:** [April 29, 2007, 9:46am UTC](https://www.ruby-forum.com/t/ruby-training-materials-suggestions-required/93195 "2007-04-29T09:46:26Z")

</div>

Hello, I am trying to learn Ruby, reading the “pickaxe” book v 2.0. It seems pretty decent. However, I am looking for something different. Firstly, I want something that has assignments in it - something to prove to m…

---

## [\[ANN\] ruby-msg-1.2.16](https://www.ruby-forum.com/t/ann-ruby-msg-1-2-16/93203)

<div class="topic-metadata">

**Author:** [@calande](https://www.ruby-forum.com/u/calande)\
**Replies:** 0\
**Last updated:** [April 29, 2007, 7:03am UTC](https://www.ruby-forum.com/t/ann-ruby-msg-1-2-16/93203 "2007-04-29T07:03:14Z")

</div>

Hi all, ruby-msg is “A library for reading Outlook msg files, and for converting them to RFC2822 emails.” I hadn’t yet announced this ruby library/tool of mine yet, but this release finally makes installation and use…

---

## [Unresolved external symbol \_\_DllMainCRTStartup@12](https://www.ruby-forum.com/t/unresolved-external-symbol-dllmaincrtstartup-12/93144)

<div class="topic-metadata">

**Author:** [@haoqi](https://www.ruby-forum.com/u/haoqi)\
**Replies:** 6\
**Last updated:** [April 29, 2007, 3:43am UTC](https://www.ruby-forum.com/t/unresolved-external-symbol-dllmaincrtstartup-12/93144 "2007-04-29T03:43:31Z")

</div>

Manifest file not generated for extensions with VC++ 2005 express. where is my losting? C:\\ext\>nmake Microsoft ® Program Maintenance Utility Version 7.00.8882 Copyright © Microsoft Corp 1988-2000. All rights reserv…

---

## [Need help to parse xml (foaf)](https://www.ruby-forum.com/t/need-help-to-parse-xml-foaf/93175)

<div class="topic-metadata">

**Author:** [@patcito](https://www.ruby-forum.com/u/patcito)\
**Replies:** 1\
**Last updated:** [April 29, 2007, 12:25am UTC](https://www.ruby-forum.com/t/need-help-to-parse-xml-foaf/93175 "2007-04-29T00:25:55Z")

</div>

hey all, I have a foaf.xml that looks like that: \<rdf:RDF xmlns:dc=“DCMI: DCMI Metadata Terms” xmlns:foaf=“FOAF Vocabulary Specification” xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#” xmlns:rdfs=“http://ww…

---

## [Valid name for a method](https://www.ruby-forum.com/t/valid-name-for-a-method/93186)

<div class="topic-metadata">

**Author:** [@German\_Monfort](https://www.ruby-forum.com/u/German_Monfort)\
**Replies:** 1\
**Last updated:** [April 28, 2007, 9:11pm UTC](https://www.ruby-forum.com/t/valid-name-for-a-method/93186 "2007-04-28T21:11:45Z")

</div>

Hi all, I’m trying to add a new method to a class but I want to name it like \<\<\<' or++’, etc but it seems that these characters are not allowed irb(main):001:0\> class A irb(main):002:1\> def \<\<\< arg irb(main):003:2\> …

---

## [Code block which allows dynamical numbers of arguments](https://www.ruby-forum.com/t/code-block-which-allows-dynamical-numbers-of-arguments/93173)

<div class="topic-metadata">

**Author:** [@anansi](https://www.ruby-forum.com/u/anansi)\
**Replies:** 3\
**Last updated:** [April 28, 2007, 7:10pm UTC](https://www.ruby-forum.com/t/code-block-which-allows-dynamical-numbers-of-arguments/93173 "2007-04-28T19:10:37Z")

</div>

Hi, let’s pretend I have a codeblock like this: #begin test = lambda {|c,d| @check = c if object.status == d} test.call(“GoodBoy”,12) #end So you see if object.status is 12 @check will be set to “Goodboy”. But how…

---

## [Java translation into Ruby](https://www.ruby-forum.com/t/java-translation-into-ruby/93171)

<div class="topic-metadata">

**Author:** [@vanderkerkoff](https://www.ruby-forum.com/u/vanderkerkoff)\
**Replies:** 0\
**Last updated:** [April 28, 2007, 5:21pm UTC](https://www.ruby-forum.com/t/java-translation-into-ruby/93171 "2007-04-28T17:21:14Z")

</div>

hi friends ; i have recenlty started Ruby; I have a java source code and it has two interface ; which are +widget ,+observer anologuetimer and digital timer implements both interface i also have generator class se…

---

## [Shiping headers with a ruby extension](https://www.ruby-forum.com/t/shiping-headers-with-a-ruby-extension/93162)

<div class="topic-metadata">

**Author:** [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Replies:** 0\
**Last updated:** [April 28, 2007, 3:34pm UTC](https://www.ruby-forum.com/t/shiping-headers-with-a-ruby-extension/93162 "2007-04-28T15:34:20Z")

</div>

Hi, i have written a ruby extension, that should be the base for other extensions. So i have to ship some of its header files. I use setup.rb in the main directory and extconf.rb (mkmf) in the extensions directory. I…

---

## [Using Ruby in a Corporate Environment](https://www.ruby-forum.com/t/using-ruby-in-a-corporate-environment/93051)

<div class="topic-metadata">

**Author:** [@sjmadsen](https://www.ruby-forum.com/u/sjmadsen)\
**Replies:** 9\
**Last updated:** [April 28, 2007, 3:02pm UTC](https://www.ruby-forum.com/t/using-ruby-in-a-corporate-environment/93051 "2007-04-28T15:02:18Z")

</div>

\---------- Forwarded message ---------- From: Curt H. removed\_email\_address@domain.invalid Date: Apr 26, 2007 12:41 PM Subject: Re: \[stlruby\] St. Louis Companies Using Ruby To: removed\_email\_address@domain.invalid C…

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

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