# Ruby

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

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

---

## [Iterator/array question](https://www.ruby-forum.com/t/iterator-array-question/60578)

<div class="topic-metadata">

**Author:** [@Susan\_Sash](https://www.ruby-forum.com/u/Susan_Sash)\
**Replies:** 2\
**Last updated:** [May 15, 2006, 8:04pm UTC](https://www.ruby-forum.com/t/iterator-array-question/60578 "2006-05-15T20:04:31Z")

</div>

Is there a way to iterate through an array, getting the index and the object at the same time? For instance, right now I know two ways of going through an array: array.each do |element| print element end for i in 0…

---

## [Re: comp.lang.ruby FAQ](https://www.ruby-forum.com/t/re-comp-lang-ruby-faq/94822)

<div class="topic-metadata">

**Author:** [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Replies:** 0\
**Last updated:** [May 15, 2006, 7:48pm UTC](https://www.ruby-forum.com/t/re-comp-lang-ruby-faq/94822 "2006-05-15T19:48:50Z")

</div>

list, since it is mirrored to comp.lang.ruby.) I thought the gateway was down indefinitely. Too bad, because google groups offered the best searching of the archives. The search for the official ruby-talk archive …

---

## [Comp.lang.ruby FAQ](https://www.ruby-forum.com/t/comp-lang-ruby-faq/102770)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [May 15, 2006, 7:39pm UTC](https://www.ruby-forum.com/t/comp-lang-ruby-faq/102770 "2006-05-15T19:39:42Z")

</div>

RUBY NEWSGROUP FAQ – Welcome to comp.lang.ruby! (Revised 2005-4-14) This FAQ contains information for those who want to: learn more about Ruby, and want to post to comp.lang.ruby or to the ruby-lang mail list, or wan…

---

## [Re: Search an array](https://www.ruby-forum.com/t/re-search-an-array/94819)

<div class="topic-metadata">

**Author:** [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Replies:** 0\
**Last updated:** [May 15, 2006, 6:43pm UTC](https://www.ruby-forum.com/t/re-search-an-array/94819 "2006-05-15T18:43:11Z")

</div>

“C:/mhiqTest/testAdoConnection.rb” What is “pp”? BTW, I’m very new to Ruby! It’s short for “pretty print”. It’s meant to provide prettier inspection for objects (mostly used for STDOUT, I imagine). I use it for d…

---

## [Compiling Ruby w/ Profile Guided Optimization](https://www.ruby-forum.com/t/compiling-ruby-w-profile-guided-optimization/60564)

<div class="topic-metadata">

**Author:** [@Greg\_Buchholz](https://www.ruby-forum.com/u/Greg_Buchholz)\
**Replies:** 0\
**Last updated:** [May 15, 2006, 6:17pm UTC](https://www.ruby-forum.com/t/compiling-ruby-w-profile-guided-optimization/60564 "2006-05-15T18:17:05Z")

</div>

Since gcc-4.1 now has the option to perform profile guided optimization, I thought I’d try compiling a version of Ruby with this feature turned on. For the (somewhat contrived/synthetic) scenario below, it looks like…

---

## [Hobix install prob](https://www.ruby-forum.com/t/hobix-install-prob/60500)

<div class="topic-metadata">

**Author:** [@leslieviljoen](https://www.ruby-forum.com/u/leslieviljoen)\
**Replies:** 2\
**Last updated:** [May 15, 2006, 5:42pm UTC](https://www.ruby-forum.com/t/hobix-install-prob/60500 "2006-05-15T17:42:24Z")

</div>

Help, I can’t install hobix using the handy website url thing: /usr/local/lib/site\_ruby/1.8/hobix/base.rb:37:in require': no such file to load -- - hobix/storage/filesys - hobix/out/quick - hobix/out/erb - hobix/out/rss…

---

## [Mapping a String to Properties - A Better Way?](https://www.ruby-forum.com/t/mapping-a-string-to-properties-a-better-way/60507)

<div class="topic-metadata">

**Author:** [@afewtips](https://www.ruby-forum.com/u/afewtips)\
**Replies:** 6\
**Last updated:** [May 15, 2006, 4:46pm UTC](https://www.ruby-forum.com/t/mapping-a-string-to-properties-a-better-way/60507 "2006-05-15T16:46:21Z")

</div>

I have a piece of code that works fine, but I’m wondering if there is a better way to go about it. The method is receiving a hash (params) and in that hash are a group of items named item\_1, item\_2, item\_3, and so on.…

---

## [Re: Oddity with Win32API, RegQueryValueEx](https://www.ruby-forum.com/t/re-oddity-with-win32api-regqueryvalueex/60554)

<div class="topic-metadata">

**Author:** [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Replies:** 0\
**Last updated:** [May 15, 2006, 4:39pm UTC](https://www.ruby-forum.com/t/re-oddity-with-win32api-regqueryvalueex/60554 "2006-05-15T16:39:45Z")

</div>

From: Daniel B. removed\_email\_address@domain.invalid I noticed something curious when using the RegQueryValueEx() #include \<windows.h\> HKEY hk; rv = RegQueryValueEx(hk, val, NULL, NULL, buf, &size); RegCloseKey = …

---

## [Testing private methods](https://www.ruby-forum.com/t/testing-private-methods/60533)

<div class="topic-metadata">

**Author:** [@tekhne](https://www.ruby-forum.com/u/tekhne)\
**Replies:** 4\
**Last updated:** [May 15, 2006, 12:55pm UTC](https://www.ruby-forum.com/t/testing-private-methods/60533 "2006-05-15T12:55:50Z")

</div>

I have a class with a lot of private utility methods that makes the code a lot cleaner. However I want to test them with unit tests. How can I do this if they are private?

---

## [Oddity with Win32API, RegQueryValueEx](https://www.ruby-forum.com/t/oddity-with-win32api-regqueryvalueex/60535)

<div class="topic-metadata">

**Author:** [@danielb](https://www.ruby-forum.com/u/danielb)\
**Replies:** 1\
**Last updated:** [May 15, 2006, 12:31pm UTC](https://www.ruby-forum.com/t/oddity-with-win32api-regqueryvalueex/60535 "2006-05-15T12:31:32Z")

</div>

Hi all, Ruby 1.8.4 Windows XP I noticed something curious when using the RegQueryValueEx() function using straight C versus a Win32API wrapper. Whenever I call it via Win32API, it always returns ERROR\_MORE\_DATA (i.…

---

## [EventMachine releases version 0.5.2](https://www.ruby-forum.com/t/eventmachine-releases-version-0-5-2/60534)

<div class="topic-metadata">

**Author:** [@blackhedd](https://www.ruby-forum.com/u/blackhedd)\
**Replies:** 0\
**Last updated:** [May 15, 2006, 11:36am UTC](https://www.ruby-forum.com/t/eventmachine-releases-version-0-5-2/60534 "2006-05-15T11:36:01Z")

</div>

With this release, we have cleaned up some performance issues and some platform-specific build issues. The source-code gem has been tested and should work on Linux, Solaris, OS X, and Win32. We’ve also added a binary …

---

## [South African Ruby Programmers](https://www.ruby-forum.com/t/south-african-ruby-programmers/59653)

<div class="topic-metadata">

**Author:** [@leslieviljoen](https://www.ruby-forum.com/u/leslieviljoen)\
**Replies:** 5\
**Last updated:** [May 15, 2006, 10:49am UTC](https://www.ruby-forum.com/t/south-african-ruby-programmers/59653 "2006-05-15T10:49:50Z")

</div>

Hello! If you program in Ruby and stay in South Africa, I’d really appreciate it if you could add your name and location to my wiki page: http://mobeus.homelinux.org/eclectica/show/RubySouthAfrica I often need Ruby …

---

## [Test if file exists](https://www.ruby-forum.com/t/test-if-file-exists/94803)

<div class="topic-metadata">

**Author:** [@pieter-schutte](https://www.ruby-forum.com/u/pieter-schutte)\
**Replies:** 3\
**Last updated:** [May 15, 2006, 10:22am UTC](https://www.ruby-forum.com/t/test-if-file-exists/94803 "2006-05-15T10:22:17Z")

</div>

Hi, Look at this : if (ARGV.size != 2) puts ‘usage: ./compare file1 file2’ else filename1 = ARGV\[0\] filename2 = ARGV\[1\] How would I test if the arguments given (filename1 and 2) are actually files that exist? T…

---

## [Dialing modem using ruby](https://www.ruby-forum.com/t/dialing-modem-using-ruby/94797)

<div class="topic-metadata">

**Author:** [@Kirk\_Colenbrander](https://www.ruby-forum.com/u/Kirk_Colenbrander)\
**Replies:** 0\
**Last updated:** [May 15, 2006, 4:51am UTC](https://www.ruby-forum.com/t/dialing-modem-using-ruby/94797 "2006-05-15T04:51:32Z")

</div>

Is there a ruby library to dial modems?

---

## [Vim reindent/beautify tip](https://www.ruby-forum.com/t/vim-reindent-beautify-tip/60478)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 3\
**Last updated:** [May 14, 2006, 10:41pm UTC](https://www.ruby-forum.com/t/vim-reindent-beautify-tip/60478 "2006-05-14T22:41:45Z")

</div>

Many of you might already know this but if not here’s an interesting tip I just discovered over on vim.org/tips. Base assumption: you have installed the ruby-vim gem and the vim files are in the correct places. If yo…

---

## [Namespace conflicts](https://www.ruby-forum.com/t/namespace-conflicts/60480)

<div class="topic-metadata">

**Author:** [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Replies:** 2\
**Last updated:** [May 14, 2006, 6:22pm UTC](https://www.ruby-forum.com/t/namespace-conflicts/60480 "2006-05-14T18:22:18Z")

</div>

Good morning, everyone. I’m curious as to how I can resolve some namespace conflicts. I’m writing a Rails app (although this problem should be agnostic), and wrote a Payment model (which is a class for those that d…

---

## [Shebang woes / syntax check weirdness?](https://www.ruby-forum.com/t/shebang-woes-syntax-check-weirdness/60476)

<div class="topic-metadata">

**Author:** [@Benjamin\_Andresen](https://www.ruby-forum.com/u/Benjamin_Andresen)\
**Replies:** 2\
**Last updated:** [May 14, 2006, 6:17pm UTC](https://www.ruby-forum.com/t/shebang-woes-syntax-check-weirdness/60476 "2006-05-14T18:17:23Z")

</div>

Hello everyone, I just noticed that even though I call ruby form the command line with a file as an argument it will execute the shebang line. Is this intentional behaviour? Because for me it doesn’t hold to the POLS…

---

## [I can't believe it ate the whole thing!](https://www.ruby-forum.com/t/i-cant-believe-it-ate-the-whole-thing/60401)

<div class="topic-metadata">

**Author:** [@jeffpritchard](https://www.ruby-forum.com/u/jeffpritchard)\
**Replies:** 5\
**Last updated:** [May 14, 2006, 5:42pm UTC](https://www.ruby-forum.com/t/i-cant-believe-it-ate-the-whole-thing/60401 "2006-05-14T17:42:22Z")

</div>

At work, to dispel some of the tedium of writing yet another layer of C on top of twenty years of rotting but seemingly irreplaceable legacy C code…I’ve taken to writing something I call “coding standards lint” in rub…

---

## ["Seeing Metaclasses Clearly"](https://www.ruby-forum.com/t/seeing-metaclasses-clearly/60464)

<div class="topic-metadata">

**Author:** [@pergesu](https://www.ruby-forum.com/u/pergesu)\
**Replies:** 7\
**Last updated:** [May 14, 2006, 5:01pm UTC](https://www.ruby-forum.com/t/seeing-metaclasses-clearly/60464 "2006-05-14T17:01:07Z")

</div>

I saw a link for why’s article “Seeing Metaclasses Clearly” \[1\] earlier this week. Been looking at it, and honestly I can’t say it’s making things more clear for me. The final example is: class MailTruck def self.c…

---

## [Making sense of the various Ruby "eval"s](https://www.ruby-forum.com/t/making-sense-of-the-various-ruby-eval-s/94742)

<div class="topic-metadata">

**Author:** [@eliben](https://www.ruby-forum.com/u/eliben)\
**Replies:** 13\
**Last updated:** [May 14, 2006, 1:08pm UTC](https://www.ruby-forum.com/t/making-sense-of-the-various-ruby-eval-s/94742 "2006-05-14T13:08:21Z")

</div>

Hi all, Unlike other dynamic languages I’m familiar with (Perl, Lisp), Ruby has more than one form of ‘eval’, which is quite confusing for Ruby nubies like myself. I’m trying to make some sense of all the possibilitie…

---

## [An inherent mismatch when creating dynamic classes](https://www.ruby-forum.com/t/an-inherent-mismatch-when-creating-dynamic-classes/60359)

<div class="topic-metadata">

**Author:** [@eliben](https://www.ruby-forum.com/u/eliben)\
**Replies:** 5\
**Last updated:** [May 14, 2006, 12:28pm UTC](https://www.ruby-forum.com/t/an-inherent-mismatch-when-creating-dynamic-classes/60359 "2006-05-14T12:28:45Z")

</div>

Class names in Ruby must begin with a capital litter, like constants: class poke end ==\> ERROR: class/module name must be CONSTANT On the other hand, dynamic assignment to constants is illegal: def foo Joe = 5 p J…

---

## [Win32api](https://www.ruby-forum.com/t/win32api/94760)

<div class="topic-metadata">

**Author:** [@ckonrad](https://www.ruby-forum.com/u/ckonrad)\
**Replies:** 5\
**Last updated:** [May 14, 2006, 1:36am UTC](https://www.ruby-forum.com/t/win32api/94760 "2006-05-14T01:36:15Z")

</div>

hello does this mean i dont have the WIN32API irb(main):008:0\> require ‘win32api’ LoadError: 127: The specified procedure could not be found. - Init\_win32api C:/ruby/lib/ruby/1.8/i386-mswin32/win32api.so from C:/…

---

## [Rational 1.01](https://www.ruby-forum.com/t/rational-1-01/93962)

<div class="topic-metadata">

**Author:** [@Shin-ichiro\_HARA](https://www.ruby-forum.com/u/Shin-ichiro_HARA)\
**Replies:** 15\
**Last updated:** [May 14, 2006, 12:59am UTC](https://www.ruby-forum.com/t/rational-1-01/93962 "2006-05-14T00:59:07Z")

</div>

e$B86$G$9!#e(B rational 1.01 e$B$r%Q%C%1!\<%8$7$^$7$?!#e(B http://blade.nagaokaut.ac.jp/~sinara/ruby/rational/ e$B$KCV$$$F$"$j$^$9!#e(B e$B:#;W$$=P$7$?$N$G$9$,!"e(Brational.c e$B$O!"85!9$ON)@P$5$s$Ne(B frac (\[ruby-li…

---

## [Using alias\_method in mixin module](https://www.ruby-forum.com/t/using-alias-method-in-mixin-module/60448)

<div class="topic-metadata">

**Author:** [@justincollins](https://www.ruby-forum.com/u/justincollins)\
**Replies:** 2\
**Last updated:** [May 14, 2006, 12:50am UTC](https://www.ruby-forum.com/t/using-alias-method-in-mixin-module/60448 "2006-05-14T00:50:01Z")

</div>

Hi all, I have a mixin module that needs to redefine a particular method if it already exists and retain a reference to it for later use. This is what I came up with: module Example def Example.included(klass) …

---

## [Ruby-VPI 0.5](https://www.ruby-forum.com/t/ruby-vpi-0-5/94773)

<div class="topic-metadata">

**Author:** [@Suraj\_NSKurapati](https://www.ruby-forum.com/u/Suraj_NSKurapati)\
**Replies:** 0\
**Last updated:** [May 13, 2006, 9:07pm UTC](https://www.ruby-forum.com/t/ruby-vpi-0-5/94773 "2006-05-13T21:07:57Z")

</div>

\-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ruby-VPI is a Ruby interface to Verilog VPI. With it, you can create complex Verilog test benches easily and wholly in Ruby. http://ruby-vpi.rubyforge.org/ = Version 0.5…

---

## [List folder content from win directory -\> xml output](https://www.ruby-forum.com/t/list-folder-content-from-win-directory-xml-output/60436)

<div class="topic-metadata">

**Author:** [@memetical](https://www.ruby-forum.com/u/memetical)\
**Replies:** 6\
**Last updated:** [May 13, 2006, 8:36pm UTC](https://www.ruby-forum.com/t/list-folder-content-from-win-directory-xml-output/60436 "2006-05-13T20:36:45Z")

</div>

hi everybody, I’ve been searching all over the place but found nothing helpful yet. I need to list a directory with all its subdirectories and files and output that information into an xml file. I think Ruby might be…

---

## [Ruby Skype bindings](https://www.ruby-forum.com/t/ruby-skype-bindings/60440)

<div class="topic-metadata">

**Author:** [@Peter\_CSVerhage](https://www.ruby-forum.com/u/Peter_CSVerhage)\
**Replies:** 0\
**Last updated:** [May 13, 2006, 7:49pm UTC](https://www.ruby-forum.com/t/ruby-skype-bindings/60440 "2006-05-13T19:49:01Z")

</div>

Hi, Does anyone know of a Ruby project that provides Ruby bindings for the Skype API (by using Ruby/DL or something else)? Thanks, Peter

---

## [Class \<\< self](https://www.ruby-forum.com/t/class-self/94698)

<div class="topic-metadata">

**Author:** [@Tim\_U](https://www.ruby-forum.com/u/Tim_U)\
**Replies:** 7\
**Last updated:** [May 13, 2006, 5:01pm UTC](https://www.ruby-forum.com/t/class-self/94698 "2006-05-13T17:01:16Z")

</div>

I was reading through the source code of the DBI module and I saw this line there. class \<\< self What does this statement do?

---

## [Hash key formatter](https://www.ruby-forum.com/t/hash-key-formatter/94706)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 2\
**Last updated:** [May 13, 2006, 4:18pm UTC](https://www.ruby-forum.com/t/hash-key-formatter/94706 "2006-05-13T16:18:55Z")

</div>

Add an attribute to Hash to store transformation of keys. For instance: h = Hash.new h.key\_format do |k| k.to\_s.downcase.to\_sym } h\[‘BIG’\] = 10 h #=\> { :big =\> 10 } Good little RCR.

---

## [Lightweigth lexer?](https://www.ruby-forum.com/t/lightweigth-lexer/60398)

<div class="topic-metadata">

**Author:** [@Meador\_I](https://www.ruby-forum.com/u/Meador_I)\
**Replies:** 10\
**Last updated:** [May 13, 2006, 3:44pm UTC](https://www.ruby-forum.com/t/lightweigth-lexer/60398 "2006-05-13T15:44:56Z")

</div>

Is there lightweight lexer for Ruby? I have seen a few lexer generators out there, but I want something simple that can be used without generating the lexer first. I really just need the basic functionaliy of matching…

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

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