# Ruby

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

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

---

## [Housie (#114)](https://www.ruby-forum.com/t/housie-114/85834)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 24\
**Last updated:** [September 25, 2007, 11:09pm UTC](https://www.ruby-forum.com/t/housie-114/85834 "2007-09-25T23:09:57Z")

</div>

The three rules of Ruby Q.: Please do not post any solutions or spoiler discussion for this quiz until 48 hours have passed from the time on this message. Support Ruby Q. by submitting ideas as often as you can: …

---

## [How to get the unix login name of the calling user?](https://www.ruby-forum.com/t/how-to-get-the-unix-login-name-of-the-calling-user/83865)

<div class="topic-metadata">

**Author:** [@crytyca](https://www.ruby-forum.com/u/crytyca)\
**Replies:** 9\
**Last updated:** [September 25, 2007, 11:09pm UTC](https://www.ruby-forum.com/t/how-to-get-the-unix-login-name-of-the-calling-user/83865 "2007-09-25T23:09:56Z")

</div>

Hi, I am writing a script which uses a configuration file. I already managed that it is possible for the caller to specify the location of the config file as a command line parameter (which was pretty easy with optpar…

---

## [Inverse scanf: finding format specifers of existing fields](https://www.ruby-forum.com/t/inverse-scanf-finding-format-specifers-of-existing-fields/103149)

<div class="topic-metadata">

**Author:** [@Bil\_K](https://www.ruby-forum.com/u/Bil_K)\
**Replies:** 16\
**Last updated:** [September 25, 2007, 11:09pm UTC](https://www.ruby-forum.com/t/inverse-scanf-finding-format-specifers-of-existing-fields/103149 "2007-09-25T23:09:55Z")

</div>

Hi, I have files full of numbers that I need to twiddle, but the format of the numbers cannot change\[1\], e.g., ‘0.4577’ → ‘0.7728’ or ‘-2.345e-02’ → ’ 1.232e-03’ Using scanf for the output seems to be the solution …

---

## [Bypassing XML inconsistencies with REXML::StreamListener](https://www.ruby-forum.com/t/bypassing-xml-inconsistencies-with-rexml-streamlistener/114759)

<div class="topic-metadata">

**Author:** [@nutsmuggler](https://www.ruby-forum.com/u/nutsmuggler)\
**Replies:** 3\
**Last updated:** [September 25, 2007, 11:09pm UTC](https://www.ruby-forum.com/t/bypassing-xml-inconsistencies-with-rexml-streamlistener/114759 "2007-09-25T23:09:52Z")

</div>

Hello folks. I am trying to build a simple XML parser to extract data from IBM translation manager memories. Here is a sample os such memory files: 0000000001 00012200000001178876638English(U.S.)ITALIANIBMIDDOCBB1…

---

## [Source a javascript and stylesheet into rhtml file](https://www.ruby-forum.com/t/source-a-javascript-and-stylesheet-into-rhtml-file/114557)

<div class="topic-metadata">

**Author:** [@2tcreative](https://www.ruby-forum.com/u/2tcreative)\
**Replies:** 4\
**Last updated:** [September 25, 2007, 11:09pm UTC](https://www.ruby-forum.com/t/source-a-javascript-and-stylesheet-into-rhtml-file/114557 "2007-09-25T23:09:50Z")

</div>

Hi all, I’m trying to do a quick dump of a javascript and style sheet located in their respective /public directories into an rhtml file. I want to include the entire text of the file in my rhtml file. How do I do thi…

---

## [David Black's book \_Ruby for Rails](https://www.ruby-forum.com/t/david-blacks-book-ruby-for-rails/106021)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 16\
**Last updated:** [September 25, 2007, 11:09pm UTC](https://www.ruby-forum.com/t/david-blacks-book-ruby-for-rails/106021 "2007-09-25T23:09:48Z")

</div>

Hi all Anyone of you have read the book, David Black’s book \_Ruby for Rails? I 'd like to know what you think about the book from a professional perspective. Your insight some might find it useful. -Jimmy

---

## [Openobject-0.0.1](https://www.ruby-forum.com/t/openobject-0-0-1/114204)

<div class="topic-metadata">

**Author:** [@ara.t.howard](https://www.ruby-forum.com/u/ara.t.howard)\
**Replies:** 13\
**Last updated:** [September 25, 2007, 11:09pm UTC](https://www.ruby-forum.com/t/openobject-0-0-1/114204 "2007-09-25T23:09:48Z")

</div>

NAME openobject SYNOPSIS a simple property based container that’s much more capable than a blankslate but far less polluted than ruby’s built-in OpenStruct. openobject is a tiny lib that couples the power of the …

---

## [FizzBuzz (#126)](https://www.ruby-forum.com/t/fizzbuzz-126/105696)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 178\
**Last updated:** [September 25, 2007, 11:09pm UTC](https://www.ruby-forum.com/t/fizzbuzz-126/105696 "2007-09-25T23:09:48Z")

</div>

The three rules of Ruby Q.: Please do not post any solutions or spoiler discussion for this quiz until 48 hours have passed from the time on this message. Support Ruby Q. by submitting ideas as often as you can: …

---

## [Requiring Files while working Remotely](https://www.ruby-forum.com/t/requiring-files-while-working-remotely/109749)

<div class="topic-metadata">

**Author:** [@parvg](https://www.ruby-forum.com/u/parvg)\
**Replies:** 5\
**Last updated:** [September 25, 2007, 11:09pm UTC](https://www.ruby-forum.com/t/requiring-files-while-working-remotely/109749 "2007-09-25T23:09:43Z")

</div>

Hello, I’m trying to execute a script on my local machine which requires a file on a remote machine. When i run the program on my local machine i get an error saying that ruby couldn’t load a file that is being requi…

---

## [Multiple matching with ()\*](https://www.ruby-forum.com/t/multiple-matching-with/110850)

<div class="topic-metadata">

**Author:** [@Alessandro\_Re](https://www.ruby-forum.com/u/Alessandro_Re)\
**Replies:** 17\
**Last updated:** [September 25, 2007, 11:09pm UTC](https://www.ruby-forum.com/t/multiple-matching-with/110850 "2007-09-25T23:09:39Z")

</div>

Hi there! I’m Alessandro from Italy and I started using ruby some days ago, so… Hello, Community! :slight\_smile: Well, I was trying to match a pattern multiple times. I tried both with normal match() and scan(), but …

---

## [Bug with assignment?](https://www.ruby-forum.com/t/bug-with-assignment/114762)

<div class="topic-metadata">

**Author:** [@Mukund](https://www.ruby-forum.com/u/Mukund)\
**Replies:** 3\
**Last updated:** [September 25, 2007, 11:09pm UTC](https://www.ruby-forum.com/t/bug-with-assignment/114762 "2007-09-25T23:09:39Z")

</div>

The snippet illustrates my question. a={} b={} a\[“alpha”\]=b\[“alpha”\]=\[\] a\[“alpha”\]\<\<23 b\[“alpha”\]\<\<100 puts a\[“alpha”\] puts b\[“alpha”\] Here a\[“alpha”\] and b\[“alpha”\] both contain an array of \[23,100\]. Why?? If …

---

## [Cross-platform Home Directory?](https://www.ruby-forum.com/t/cross-platform-home-directory/114647)

<div class="topic-metadata">

**Author:** [@Trans](https://www.ruby-forum.com/u/Trans)\
**Replies:** 18\
**Last updated:** [September 25, 2007, 11:09pm UTC](https://www.ruby-forum.com/t/cross-platform-home-directory/114647 "2007-09-25T23:09:39Z")

</div>

I have a little app that needs to store session data. I assume the best place to store it is in one’s home directory, but I need this app to be cross-platform. I glanced through all rbconfig.rb’s Config::CONFIG settin…

---

## [Ruby entities and relationships?](https://www.ruby-forum.com/t/ruby-entities-and-relationships/86315)

<div class="topic-metadata">

**Author:** [@iceburgh](https://www.ruby-forum.com/u/iceburgh)\
**Replies:** 7\
**Last updated:** [September 25, 2007, 11:09pm UTC](https://www.ruby-forum.com/t/ruby-entities-and-relationships/86315 "2007-09-25T23:09:38Z")

</div>

Can anyone point me to an overview or ontology of the major entities and relationships in the Ruby language? I’m digging a lot of this out of RDoc and assorted books, but I haven’t seen anything that addresses this p…

---

## [HELP: Installed libxml via Fink, can't 'require' it](https://www.ruby-forum.com/t/help-installed-libxml-via-fink-cant-require-it/84829)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 3\
**Last updated:** [September 25, 2007, 11:09pm UTC](https://www.ruby-forum.com/t/help-installed-libxml-via-fink-cant-require-it/84829 "2007-09-25T23:09:38Z")

</div>

I’m using MacOS X, and I’ve installed libxml via Fink. Although spotlight can find the files, no matter what I’ve tried, “require ‘xml/ libxml’” and variants do not work. I’ve done my best to follow instructions and…

---

## [Subject line](https://www.ruby-forum.com/t/subject-line/113622)

<div class="topic-metadata">

**Author:** [@Devi\_Web\_D](https://www.ruby-forum.com/u/Devi_Web_D)\
**Replies:** 104\
**Last updated:** [September 25, 2007, 11:09pm UTC](https://www.ruby-forum.com/t/subject-line/113622 "2007-09-25T23:09:23Z")

</div>

I don’t know who would make this sort of decision, but could we put \[RubyTalk\] or \[Ruby\] or something at the beginning of all messages? It’s a fairly common practice on listserves.

---

## [Regexp and Prime numbers](https://www.ruby-forum.com/t/regexp-and-prime-numbers/89352)

<div class="topic-metadata">

**Author:** [@timperrett](https://www.ruby-forum.com/u/timperrett)\
**Replies:** 4\
**Last updated:** [September 25, 2007, 11:09pm UTC](https://www.ruby-forum.com/t/regexp-and-prime-numbers/89352 "2007-09-25T23:09:22Z")

</div>

This is a one-liner Ruby script that will tell you if a given number is prime. ruby -wle ‘puts “Prime” unless (“1” \* ARGV\[0\].to\_i) =~ /^1$|^(11+?)\\1+$/’ \[number\] I cannot take credit for this one – it originally came…

---

## [Newbie: what's Ruby idiom for word-by-word input?](https://www.ruby-forum.com/t/newbie-whats-ruby-idiom-for-word-by-word-input/114668)

<div class="topic-metadata">

**Author:** [@asoto](https://www.ruby-forum.com/u/asoto)\
**Replies:** 15\
**Last updated:** [September 25, 2007, 11:09pm UTC](https://www.ruby-forum.com/t/newbie-whats-ruby-idiom-for-word-by-word-input/114668 "2007-09-25T23:09:22Z")

</div>

Hi, What is the Ruby idiom for reading input word-by-word? In other words – how to process input while skipping all of the whitespace. I would use this code in C++: //std::istream& stream; while (!stream.eof()) { …

---

## [Slow RAILS testing](https://www.ruby-forum.com/t/slow-rails-testing/114752)

<div class="topic-metadata">

**Author:** [@kevin\_cline](https://www.ruby-forum.com/u/kevin_cline)\
**Replies:** 9\
**Last updated:** [September 25, 2007, 11:09pm UTC](https://www.ruby-forum.com/t/slow-rails-testing/114752 "2007-09-25T23:09:22Z")

</div>

My RAILS unit tests take approximately one minute to run. This may not sound like much, but it’s a real drag on incremental development. I imagine most of the slowness in spent in applying the database schema to the …

---

## [Help DRY a couple ifs](https://www.ruby-forum.com/t/help-dry-a-couple-ifs/83701)

<div class="topic-metadata">

**Author:** [@Bil\_K](https://www.ruby-forum.com/u/Bil_K)\
**Replies:** 5\
**Last updated:** [September 25, 2007, 11:09pm UTC](https://www.ruby-forum.com/t/help-dry-a-couple-ifs/83701 "2007-09-25T23:09:22Z")

</div>

The following snippet is simply nasty, but I can’t see a simple way to DRY it: if data\[‘medium’\].has\_key? xyz medium = data\[‘medium’\]\[xyz\] else $stderr.print "Warning: Did not locate point in medium mesh: " $stderr…

---

## [Super return changed in 1.8.6](https://www.ruby-forum.com/t/super-return-changed-in-1-8-6/108438)

<div class="topic-metadata">

**Author:** [@hanholl](https://www.ruby-forum.com/u/hanholl)\
**Replies:** 3\
**Last updated:** [September 25, 2007, 11:09pm UTC](https://www.ruby-forum.com/t/super-return-changed-in-1-8-6/108438 "2007-09-25T23:09:18Z")

</div>

Hello, The following snippet: #!/usr/bin/ruby -w require ‘date’ class MyDate \< Date def self.today super end end puts MyDate.today.class end prints out ‘MyDate’ with ruby 1.8.4 and 1.8.5, but ‘Date’ with 1.8.6 …

---

## [Groklaw says "Watch out, Ruby!"](https://www.ruby-forum.com/t/groklaw-says-watch-out-ruby/110783)

<div class="topic-metadata">

**Author:** [@timhunter](https://www.ruby-forum.com/u/timhunter)\
**Replies:** 43\
**Last updated:** [September 25, 2007, 11:09pm UTC](https://www.ruby-forum.com/t/groklaw-says-watch-out-ruby/110783 "2007-09-25T23:09:10Z")

</div>

PJ raises a warning cry about IronRuby: “Uh Oh. Another Smooth Move from Microsoft: Watch out, Ruby. Watch out OSI.” \[http:// Groklaw - Uh Oh. Another Smooth Move from Microsoft: Watch out, Ruby. Watch out OSI. -- Upda…

---

## [Modifying a hash key](https://www.ruby-forum.com/t/modifying-a-hash-key/114723)

<div class="topic-metadata">

**Author:** [@asoto](https://www.ruby-forum.com/u/asoto)\
**Replies:** 8\
**Last updated:** [September 25, 2007, 11:08pm UTC](https://www.ruby-forum.com/t/modifying-a-hash-key/114723 "2007-09-25T23:08:19Z")

</div>

Hi, I’m totally new to Ruby, so please forgive me if I’m asking a trivial question. :slight\_smile: I’ve wrote this simple program to demonstrate my first major astonishment with Ruby: $ cat test-hash.rb hash={} ke…

---

## [File exists - /tmp/bootstraptest.tmpwd](https://www.ruby-forum.com/t/file-exists-tmp-bootstraptest-tmpwd/111900)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 6\
**Last updated:** [September 25, 2007, 11:08pm UTC](https://www.ruby-forum.com/t/file-exists-tmp-bootstraptest-tmpwd/111900 "2007-09-25T23:08:18Z")

</div>

e$B$R$H$D$N%^%7%s$G!"$"$k%f!\<%6$,e(B btest e$B$7$?8e!"B\>$N%f!\<%6$,e(B btest e$B$9$k$H!"0J2\<$N$h$&$J%(%i!\<$K$J$j$^$9!#e(B $ make btest ruby “./bootstraptest/runner.rb” --ruby="./miniruby " Mon Aug 13 12:59:14 +0900 20…

---

## [Arrayfields-4.0.0](https://www.ruby-forum.com/t/arrayfields-4-0-0/114613)

<div class="topic-metadata">

**Author:** [@ara.t.howard](https://www.ruby-forum.com/u/ara.t.howard)\
**Replies:** 3\
**Last updated:** [September 25, 2007, 11:08pm UTC](https://www.ruby-forum.com/t/arrayfields-4-0-0/114613 "2007-09-25T23:08:15Z")

</div>

NAME arrayfields.rb URIS http://www.codeforpeople.com/lib/ruby/ http://rubyforge.org/projects/codeforpeople/ SYNOPSIS require ‘arrayfields’ a = Arrayfields.new :k, :v, :a, :b p a\[:k\] #=\> :v p a\[:a\] …

---

## [Is it possible to make system use bash instead of sh?](https://www.ruby-forum.com/t/is-it-possible-to-make-system-use-bash-instead-of-sh/92910)

<div class="topic-metadata">

**Author:** [@sneptune](https://www.ruby-forum.com/u/sneptune)\
**Replies:** 11\
**Last updated:** [September 25, 2007, 11:08pm UTC](https://www.ruby-forum.com/t/is-it-possible-to-make-system-use-bash-instead-of-sh/92910 "2007-09-25T23:08:14Z")

</div>

Hi, Does anyone know if it is possible to use bash instead of sh as the default shell when “system” is executed? For example, system(“java --version”) is executing java --version in sh, instead of bash, which can be …

---

## [What's the most ruby-ish way to write this python code?](https://www.ruby-forum.com/t/whats-the-most-ruby-ish-way-to-write-this-python-code/103745)

<div class="topic-metadata">

**Author:** [@dfg59](https://www.ruby-forum.com/u/dfg59)\
**Replies:** 9\
**Last updated:** [September 25, 2007, 11:08pm UTC](https://www.ruby-forum.com/t/whats-the-most-ruby-ish-way-to-write-this-python-code/103745 "2007-09-25T23:08:10Z")

</div>

All - I’ve been using ruby for quite some time and I’m only beginning to look at python. I really like the way ruby flows as compared to python and I can’t see myself getting pulled away from ruby. However, there is o…

---

## [Help with multiple file upload](https://www.ruby-forum.com/t/help-with-multiple-file-upload/92727)

<div class="topic-metadata">

**Author:** [@arjun\_ghosh](https://www.ruby-forum.com/u/arjun_ghosh)\
**Replies:** 3\
**Last updated:** [September 25, 2007, 11:08pm UTC](https://www.ruby-forum.com/t/help-with-multiple-file-upload/92727 "2007-09-25T23:08:09Z")

</div>

Hi, I am a newbie and am trying to make a system which needs multiple file upload…i saw lot of different methods on the net when i googld it such as act as attachment, using js, using flash,etc. But i am quite confu…

---

## [XML parser; maybe ruby is too slow?](https://www.ruby-forum.com/t/xml-parser-maybe-ruby-is-too-slow/114681)

<div class="topic-metadata">

**Author:** [@nutsmuggler](https://www.ruby-forum.com/u/nutsmuggler)\
**Replies:** 3\
**Last updated:** [September 25, 2007, 11:08pm UTC](https://www.ruby-forum.com/t/xml-parser-maybe-ruby-is-too-slow/114681 "2007-09-25T23:08:09Z")

</div>

Hello folks. I managed to write a SGML parser with the hpricot library. As I explained in a previous thread, I just need to compare source and traget tags of translation memory files from IBM Translation manager. The…

---

## [Maths in Ruby](https://www.ruby-forum.com/t/maths-in-ruby/87695)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 13\
**Last updated:** [September 25, 2007, 11:08pm UTC](https://www.ruby-forum.com/t/maths-in-ruby/87695 "2007-09-25T23:08:09Z")

</div>

Hello to everyone! I have a mathematic problem I need to solve, and it involves finding the values of three consecutive numbers, x, y and z. I need to be able to find every instance of these from negative one million…

---

## [A method to search and cut in Ruby](https://www.ruby-forum.com/t/a-method-to-search-and-cut-in-ruby/110405)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 6\
**Last updated:** [September 25, 2007, 11:08pm UTC](https://www.ruby-forum.com/t/a-method-to-search-and-cut-in-ruby/110405 "2007-09-25T23:08:07Z")

</div>

Hello all, I’m trying to parse some EXIF data and return certain fields of text. If I wanted to parsed a document looking for text and then locating it take everything after a colon : delimitator what is the best meth…

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

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