# Ruby

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

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

---

## [How to determine array element number in a each loop](https://www.ruby-forum.com/t/how-to-determine-array-element-number-in-a-each-loop/192357)

<div class="topic-metadata">

**Author:** [@kaged](https://www.ruby-forum.com/u/kaged)\
**Replies:** 3\
**Last updated:** [July 30, 2010, 5:51pm UTC](https://www.ruby-forum.com/t/how-to-determine-array-element-number-in-a-each-loop/192357 "2010-07-30T17:51:41Z")

</div>

Hello all, newbie here. The title is quite self explanatory: I am in dummy\_array.each do |a| #code here end and I want to know which element (the number n in nth element) of the dummy\_array. Thanks in advance :sli…

---

## [Getting wrong id](https://www.ruby-forum.com/t/getting-wrong-id/226072)

<div class="topic-metadata">

**Author:** [@upabibi](https://www.ruby-forum.com/u/upabibi)\
**Replies:** 2\
**Last updated:** [July 30, 2010, 5:47pm UTC](https://www.ruby-forum.com/t/getting-wrong-id/226072 "2010-07-30T17:47:35Z")

</div>

I have the follow method: def concluir @subtarefa = Subtarefa.find(params\[:id\]) @subtarefa.situacao\_subtarefa = “ConcluÃ­da” @subtarefa.data\_termino\_real = Date.current @subtarefa.update\_attributes(params\[:subtarefa…

---

## [Super(foo) doesn't work correctly when subclassing Ruby classes implemented in C#](https://www.ruby-forum.com/t/super-foo-doesnt-work-correctly-when-subclassing-ruby-classes-implemented-in-c/192374)

<div class="topic-metadata">

**Author:** [@valdar](https://www.ruby-forum.com/u/valdar)\
**Replies:** 1\
**Last updated:** [July 30, 2010, 4:40pm UTC](https://www.ruby-forum.com/t/super-foo-doesnt-work-correctly-when-subclassing-ruby-classes-implemented-in-c/192374 "2010-07-30T16:40:51Z")

</div>

I’ve found an odd bug. I think this is Tomas’ territory, but I could be wrong. I’ve already opened an issue on codeplex ( http://ironruby.codeplex.com/workitem/4957), but I figured I’d mention it here to generate s…

---

## [System works with CWD in windows](https://www.ruby-forum.com/t/system-works-with-cwd-in-windows/192454)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 2\
**Last updated:** [July 30, 2010, 3:28pm UTC](https://www.ruby-forum.com/t/system-works-with-cwd-in-windows/192454 "2010-07-30T15:28:15Z")

</div>

Hi all. I noticed that with MRI on windows, if you have ./xxx.bat and you do system(“xxx”) it fails because it refuses to run anything from the current working directory, citing it as a security concern. Jruby…

---

## [Show all files from a folder](https://www.ruby-forum.com/t/show-all-files-from-a-folder/75386)

<div class="topic-metadata">

**Author:** [@misiek](https://www.ruby-forum.com/u/misiek)\
**Replies:** 5\
**Last updated:** [July 30, 2010, 3:14pm UTC](https://www.ruby-forum.com/t/show-all-files-from-a-folder/75386 "2010-07-30T15:14:26Z")

</div>

I can not find nothing about files in google, how to create delete, how to show all files from a folder if you can redirect me to some web site I’d appreciate thanks

---

## [Swap contents in two files](https://www.ruby-forum.com/t/swap-contents-in-two-files/79350)

<div class="topic-metadata">

**Author:** [@christopherl](https://www.ruby-forum.com/u/christopherl)\
**Replies:** 17\
**Last updated:** [July 30, 2010, 3:02pm UTC](https://www.ruby-forum.com/t/swap-contents-in-two-files/79350 "2010-07-30T15:02:11Z")

</div>

I have two files, I want to swap the contents of the files in my program, suggestions?

---

## [How to read password from keyboard](https://www.ruby-forum.com/t/how-to-read-password-from-keyboard/192414)

<div class="topic-metadata">

**Author:** [@steux](https://www.ruby-forum.com/u/steux)\
**Replies:** 5\
**Last updated:** [July 30, 2010, 2:02pm UTC](https://www.ruby-forum.com/t/how-to-read-password-from-keyboard/192414 "2010-07-30T14:02:33Z")

</div>

Hi everyone! If I want to read a simple string from keyboard: simple\_text = gets What if a password needs to be read from keyboard (commando line)? How do I mask it with asterisks? Regards, Bruno

---

## [\[patch\] running Microsoft.Scripting.Metadata on Mono](https://www.ruby-forum.com/t/patch-running-microsoft-scripting-metadata-on-mono/192452)

<div class="topic-metadata">

**Author:** [@Jb\_Evain](https://www.ruby-forum.com/u/Jb_Evain)\
**Replies:** 0\
**Last updated:** [July 30, 2010, 1:45pm UTC](https://www.ruby-forum.com/t/patch-running-microsoft-scripting-metadata-on-mono/192452 "2010-07-30T13:45:49Z")

</div>

Hey, The attached patch makes the custom MemoryMapping work on Mono.

---

## [Thread.bind(sym, val) { ... }](https://www.ruby-forum.com/t/thread-bind-sym-val/192379)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 6\
**Last updated:** [July 30, 2010, 11:12am UTC](https://www.ruby-forum.com/t/thread-bind-sym-val/192379 "2010-07-30T11:12:59Z")

</div>

e$B%9%l%C%IJQ?t$r0l;~E\*$K@\_Dj$9$k%a%=%C%I$r2C$($k$N$O$I$&$G$7$g$&$+!#e(B e$B$?$H$($Pe(B Thread#bind(sym, val) { … } e$B$H$7$F!“e(B e$B%V%m%C%/$r8F$S=P$7$F$$$k$”$$$@!"%9%l%C%IJQ?te(B sym e$B$re(B val e$B$K@\_Dj$9$k!"$H$…

---

## [Accessing object in rescue block](https://www.ruby-forum.com/t/accessing-object-in-rescue-block/192326)

<div class="topic-metadata">

**Author:** [@odo](https://www.ruby-forum.com/u/odo)\
**Replies:** 3\
**Last updated:** [July 30, 2010, 10:52am UTC](https://www.ruby-forum.com/t/accessing-object-in-rescue-block/192326 "2010-07-30T10:52:48Z")

</div>

Hi, when I rescue an exception, is there a way to access the object where the exception was raised? For example: begin “something”.nonexistent rescue NoMethodError =\> e here end In the rescue block, can I access …

---

## [Dynamic insert of array data in mysql using DBI](https://www.ruby-forum.com/t/dynamic-insert-of-array-data-in-mysql-using-dbi/191882)

<div class="topic-metadata">

**Author:** [@arunvoip](https://www.ruby-forum.com/u/arunvoip)\
**Replies:** 2\
**Last updated:** [July 30, 2010, 10:26am UTC](https://www.ruby-forum.com/t/dynamic-insert-of-array-data-in-mysql-using-dbi/191882 "2010-07-30T10:26:08Z")

</div>

Hi All, I am trying to insert records from tab separated text file to mysql using dbi, please go through the following code below, It is working fine in the case of all string but not working fine for other data type…

---

## [Interactive ruby development](https://www.ruby-forum.com/t/interactive-ruby-development/192248)

<div class="topic-metadata">

**Author:** [@syamajala](https://www.ruby-forum.com/u/syamajala)\
**Replies:** 4\
**Last updated:** [July 30, 2010, 10:19am UTC](https://www.ruby-forum.com/t/interactive-ruby-development/192248 "2010-07-30T10:19:50Z")

</div>

As someone who has used lisp, emacs, and slime in the past, I get incredible frustrated with having to write ruby code. I do not find the language to be that bad, but the development environments just don’t compare. M…

---

## [Tool to compare DB schema against DDL file](https://www.ruby-forum.com/t/tool-to-compare-db-schema-against-ddl-file/192309)

<div class="topic-metadata">

**Author:** [@lonewolf](https://www.ruby-forum.com/u/lonewolf)\
**Replies:** 13\
**Last updated:** [July 30, 2010, 6:35am UTC](https://www.ruby-forum.com/t/tool-to-compare-db-schema-against-ddl-file/192309 "2010-07-30T06:35:21Z")

</div>

First of all any feedback from you guys will be of tremendous help. I’m looking for a good topic for my thesis (to major in Computer Engineering) and at the same time I’m encountering a problem in my current job. Sim…

---

## [\[Feature:trunk\] improvement of sample in lib/imap.rb: --starttls option](https://www.ruby-forum.com/t/feature-trunk-improvement-of-sample-in-lib-imap-rb-starttls-option/192369)

<div class="topic-metadata">

**Author:** [@nobu](https://www.ruby-forum.com/u/nobu)\
**Replies:** 2\
**Last updated:** [July 30, 2010, 6:06am UTC](https://www.ruby-forum.com/t/feature-trunk-improvement-of-sample-in-lib-imap-rb-starttls-option/192369 "2010-07-30T06:06:49Z")

</div>

e$B$J$+$@$G$9!#e(B lib/net/imap.rbe$B$rD\>@\<B9T$9$k$H;H$($k4J0We(BIMAPe$B%/%i%$%"%s%H$r!"e(B starttlse$B$KBP1~$5$;$F$\_$^$7$?!#e(B Index: lib/net/imap.rb — lib/net/imap.rb (revision 28780) +++ lib/net/imap.rb (workin…

---

## [\[Feature:trunk\] improvement of sample in lib/imap.rb: password input](https://www.ruby-forum.com/t/feature-trunk-improvement-of-sample-in-lib-imap-rb-password-input/192371)

<div class="topic-metadata">

**Author:** [@nobu](https://www.ruby-forum.com/u/nobu)\
**Replies:** 2\
**Last updated:** [July 30, 2010, 6:05am UTC](https://www.ruby-forum.com/t/feature-trunk-improvement-of-sample-in-lib-imap-rb-password-input/192371 "2010-07-30T06:05:03Z")

</div>

e$B$J$+$@$G$9!#e(B lib/net/imap.rbe$B$rD\>@\<B9T$9$k$H;H$($k4J0We(BIMAPe$B%/%i%$%"%s%H$r!"%Qe(B e$B%9%o!\<%I$NF~NO$Ke(BIO#noechoe$B$r;H$&$h$&$K$7$F$\_$^$7$?!#$^$?!"\<B:\]$Ke(B e$BI,MW$K$J$k$^$G%Q%9%o!\<%I$NF~NO$rCY$i$;$k$h$&$…

---

## [Undefined method \`each' for (installing gem)](https://www.ruby-forum.com/t/undefined-method-each-for-installing-gem/192367)

<div class="topic-metadata">

**Author:** [@Sonja\_Elen\_K](https://www.ruby-forum.com/u/Sonja_Elen_K)\
**Replies:** 1\
**Last updated:** [July 30, 2010, 2:13am UTC](https://www.ruby-forum.com/t/undefined-method-each-for-installing-gem/192367 "2010-07-30T02:13:17Z")

</div>

I frequently get this error. Halp? C:\\Documents and Settings\\Owner\\My Documents\\My Dropbox\\Code\>gem install sinatra Successfully installed sinatra-1.0 1 gem installed Installing ri documentation for sinatra-1.0… Up…

---

## [Ironruby forums?](https://www.ruby-forum.com/t/ironruby-forums/192318)

<div class="topic-metadata">

**Author:** [@xlar54](https://www.ruby-forum.com/u/xlar54)\
**Replies:** 3\
**Last updated:** [July 30, 2010, 1:27am UTC](https://www.ruby-forum.com/t/ironruby-forums/192318 "2010-07-30T01:27:25Z")

</div>

anyone know any good IronRuby specific forums? And am curious, how does the general community feel about this brand in general?

---

## [Documentation on embedding ruby?](https://www.ruby-forum.com/t/documentation-on-embedding-ruby/192399)

<div class="topic-metadata">

**Author:** [@arachnd](https://www.ruby-forum.com/u/arachnd)\
**Replies:** 1\
**Last updated:** [July 30, 2010, 1:25am UTC](https://www.ruby-forum.com/t/documentation-on-embedding-ruby/192399 "2010-07-30T01:25:29Z")

</div>

Hi. I would like to embed ruby interpreter into my C application, but I can’t find any info on this :frowning: Chapter in pickax book is very small and doesn’t provide enough information. I’ve also found couple of emb…

---

## [Code Review: ExecuteAndWrap](https://www.ruby-forum.com/t/code-review-executeandwrap/192412)

<div class="topic-metadata">

**Author:** [@grujildo](https://www.ruby-forum.com/u/grujildo)\
**Replies:** 0\
**Last updated:** [July 29, 2010, 7:42pm UTC](https://www.ruby-forum.com/t/code-review-executeandwrap/192412 "2010-07-29T19:42:51Z")

</div>

tfpt review “/shelveset:ExecuteAndWrap;REDMOND\\tomat” Comment : Implements ExecuteAndWrap on ScriptSource. Adds a Hosting API scenario. Tomas

---

## [London Ruby Contractor Needed](https://www.ruby-forum.com/t/london-ruby-contractor-needed/192411)

<div class="topic-metadata">

**Author:** [@richfuel](https://www.ruby-forum.com/u/richfuel)\
**Replies:** 0\
**Last updated:** [July 29, 2010, 7:26pm UTC](https://www.ruby-forum.com/t/london-ruby-contractor-needed/192411 "2010-07-29T19:26:30Z")

</div>

I need a ruby contractor for a high profile site in London. Initially 2 months but likely to extend to 6. If you’re interested please email call Richard on 01926 487487. Skills are: â€¢ Ruby â€¢ …

---

## [Hitimes 1.1.0 Released](https://www.ruby-forum.com/t/hitimes-1-1-0-released/192368)

<div class="topic-metadata">

**Author:** [@jeremyheiler](https://www.ruby-forum.com/u/jeremyheiler)\
**Replies:** 3\
**Last updated:** [July 29, 2010, 6:37pm UTC](https://www.ruby-forum.com/t/hitimes-1-1-0-released/192368 "2010-07-29T18:37:53Z")

</div>

hitimes version 1.1.0 has been released. {{ Release notes for Version 1.1.0 }} Add a pure java extension so hitimes may be used in JRuby exactly as it is used in MRI. http://copiousfreetime.rubyforge.org/hitimes/ …

---

## [How to use select](https://www.ruby-forum.com/t/how-to-use-select/192394)

<div class="topic-metadata">

**Author:** [@arachnd](https://www.ruby-forum.com/u/arachnd)\
**Replies:** 3\
**Last updated:** [July 29, 2010, 5:37pm UTC](https://www.ruby-forum.com/t/how-to-use-select/192394 "2010-07-29T17:37:10Z")

</div>

Hello people I have been looking around but i have not been able to run a succesful select it always failed on me. i also dont understand if there is a diference between IO.select or just select() Could you be so kin…

---

## [Wxruby dialog box, not centering on parent](https://www.ruby-forum.com/t/wxruby-dialog-box-not-centering-on-parent/192405)

<div class="topic-metadata">

**Author:** [@bxling](https://www.ruby-forum.com/u/bxling)\
**Replies:** 0\
**Last updated:** [July 29, 2010, 5:30pm UTC](https://www.ruby-forum.com/t/wxruby-dialog-box-not-centering-on-parent/192405 "2010-07-29T17:30:32Z")

</div>

Trying to center a messagebox on the parent instead of on whole screen. Read the docs, they say to use #center\_on\_parent before calling \_modal. Doesnt seem to work, any ideas? require ‘rubygems’ require ‘wx’ includ…

---

## [Adding an element to a copy of an array](https://www.ruby-forum.com/t/adding-an-element-to-a-copy-of-an-array/192404)

<div class="topic-metadata">

**Author:** [@jimb](https://www.ruby-forum.com/u/jimb)\
**Replies:** 2\
**Last updated:** [July 29, 2010, 4:48pm UTC](https://www.ruby-forum.com/t/adding-an-element-to-a-copy-of-an-array/192404 "2010-07-29T16:48:23Z")

</div>

Hi, array = \[“one”, “two”, “three”\] array\_copy = array array\_copy \<\< “four” p array p array\_copy #=\> \[“one”, “two”, “three”, “four”\] \[“one”, “two”, “three”, “four”\] How can I add an element to “array\_copy” and l…

---

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

<div class="topic-metadata">

**Author:** [@brentmc79](https://www.ruby-forum.com/u/brentmc79)\
**Replies:** 3\
**Last updated:** [July 29, 2010, 3:02pm UTC](https://www.ruby-forum.com/t/hash-key/192384 "2010-07-29T15:02:23Z")

</div>

Hiya Im going through the Ruby Cookbook. On page 51, there is the following example letter = { ?v =\> ‘aeiou’, ?c =\> ‘xyz’ } My question is, what does the key ?v do or mean. Kind Regards Brent C.

---

## [Problem with concurrency](https://www.ruby-forum.com/t/problem-with-concurrency/192373)

<div class="topic-metadata">

**Author:** [@zapotek](https://www.ruby-forum.com/u/zapotek)\
**Replies:** 5\
**Last updated:** [July 29, 2010, 11:42am UTC](https://www.ruby-forum.com/t/problem-with-concurrency/192373 "2010-07-29T11:42:09Z")

</div>

Hi guys, I’m having an issue with a multi-threaded system I’m developing. Sorry if my question sounds too generic and unspecific but: Are there any known pitfalls that one might come across when using threads? This …

---

## [Net/smtp](https://www.ruby-forum.com/t/net-smtp/192329)

<div class="topic-metadata">

**Author:** [@paradise](https://www.ruby-forum.com/u/paradise)\
**Replies:** 3\
**Last updated:** [July 29, 2010, 10:59am UTC](https://www.ruby-forum.com/t/net-smtp/192329 "2010-07-29T10:59:15Z")

</div>

I am not sure if I’ve properly understood things correctly but… I am trying to emulate sample code in the RDOC’s of ruby core. can some one assist? Error is… ./barcode\_class\_rpt\_email.rb:199:in \`send\_email’: wrong nu…

---

## [Implementing multiple "constructors" in ruby](https://www.ruby-forum.com/t/implementing-multiple-constructors-in-ruby/192364)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 2\
**Last updated:** [July 29, 2010, 9:07am UTC](https://www.ruby-forum.com/t/implementing-multiple-constructors-in-ruby/192364 "2010-07-29T09:07:36Z")

</div>

So I have a class that I may want to instantiate multiple ways. Here’s the signatures of the some so far: def create\_from\_file(absolute\_filename, archive\_filename, fsg=nil, verbose=false, debug=false) def create\_from…

---

## [Object#tap (was Nice algorithm for 'spreading' indexes across an array?)](https://www.ruby-forum.com/t/object-tap-was-nice-algorithm-for-spreading-indexes-across-an-array/192339)

<div class="topic-metadata">

**Author:** [@duffbeer](https://www.ruby-forum.com/u/duffbeer)\
**Replies:** 2\
**Last updated:** [July 29, 2010, 6:50am UTC](https://www.ruby-forum.com/t/object-tap-was-nice-algorithm-for-spreading-indexes-across-an-array/192339 "2010-07-29T06:50:38Z")

</div>

On Wed, Sep 2, 2009 at 1:41 AM, Max Williamsremoved\_email\_address@domain.invalid wrote: arr = (1…12).to\_a It feels like there should be a simple solution for this but i can’t think of a nice way. Anyone? thank…

---

## [Hard drive backup program in 100% pure ruby](https://www.ruby-forum.com/t/hard-drive-backup-program-in-100-pure-ruby/192347)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [July 29, 2010, 5:44am UTC](https://www.ruby-forum.com/t/hard-drive-backup-program-in-100-pure-ruby/192347 "2010-07-29T05:44:29Z")

</div>

Just figured I’d mention that I’m working on this: http://www.subspacefield.org/security/hdb/ I think that I’ll run into needing some features from the File or FileUtil classes (such as mapping from filename to inode …

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

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