# Ruby

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

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

---

## [Regular exressions and arguments](https://www.ruby-forum.com/t/regular-exressions-and-arguments/155965)

<div class="topic-metadata">

**Author:** [@ukbell](https://www.ruby-forum.com/u/ukbell)\
**Replies:** 2\
**Last updated:** [December 18, 2008, 5:09pm UTC](https://www.ruby-forum.com/t/regular-exressions-and-arguments/155965 "2008-12-18T17:09:57Z")

</div>

This should be (and probably will be) a simple answer, but if I have the very basic program of: #!/usr/bin/ruby require arg = ARGV\[0\] regex = /"#{arg}"/ regex1 = /Test/ a = “this is a Test” if regex =~ a puts “t…

---

## [Why Hash corrupts 'key' object?](https://www.ruby-forum.com/t/why-hash-corrupts-key-object/155360)

<div class="topic-metadata">

**Author:** [@dimkaspb](https://www.ruby-forum.com/u/dimkaspb)\
**Replies:** 12\
**Last updated:** [December 18, 2008, 4:39pm UTC](https://www.ruby-forum.com/t/why-hash-corrupts-key-object/155360 "2008-12-18T16:39:22Z")

</div>

Hi, I have next script: t.rb: class TestStr \< String attr\_accessor :dupstr def initialize ( str ) @dupstr = str super(str) end end ts=TestStr.new(“aaa”) puts ts.dupstr h=Hash.new() h\[ts\]=true puts h.keys.firs…

---

## [Gem update on Windows is broken?](https://www.ruby-forum.com/t/gem-update-on-windows-is-broken/149485)

<div class="topic-metadata">

**Author:** [@scrajesh](https://www.ruby-forum.com/u/scrajesh)\
**Replies:** 16\
**Last updated:** [December 18, 2008, 4:12pm UTC](https://www.ruby-forum.com/t/gem-update-on-windows-is-broken/149485 "2008-12-18T16:12:50Z")

</div>

When I issue the “gem update” command on Windows, whenever it gets to a gem whose latest version DOESN’T have Windows binaries, it’ll attempt to build the native extention which will, of course, fail. For example: Upd…

---

## [Getting test method names when getting output](https://www.ruby-forum.com/t/getting-test-method-names-when-getting-output/155957)

<div class="topic-metadata">

**Author:** [@Hunt\_J](https://www.ruby-forum.com/u/Hunt_J)\
**Replies:** 2\
**Last updated:** [December 18, 2008, 4:06pm UTC](https://www.ruby-forum.com/t/getting-test-method-names-when-getting-output/155957 "2008-12-18T16:06:22Z")

</div>

When I run a test file (e.g., ruby test\_user.rb), I get the test output about error and failure and about the overall number of tests, assertions, pass and so on. But I would like to see all the test method names incl…

---

## [Create delay loop in ruby?](https://www.ruby-forum.com/t/create-delay-loop-in-ruby/155961)

<div class="topic-metadata">

**Author:** [@pietia](https://www.ruby-forum.com/u/pietia)\
**Replies:** 1\
**Last updated:** [December 18, 2008, 4:05pm UTC](https://www.ruby-forum.com/t/create-delay-loop-in-ruby/155961 "2008-12-18T16:05:12Z")

</div>

i am trying to run an executable file(say a.exe) which will produce a a.log once finish.so i create the algo below to analyze the log file. if(a.exe exist) execute a.exe if(a.log exist) analyze a.log end end but…

---

## [\[RubyCocoa\] C pointers, and documentation](https://www.ruby-forum.com/t/rubycocoa-c-pointers-and-documentation/155865)

<div class="topic-metadata">

**Author:** [@polypus](https://www.ruby-forum.com/u/polypus)\
**Replies:** 1\
**Last updated:** [December 18, 2008, 3:23pm UTC](https://www.ruby-forum.com/t/rubycocoa-c-pointers-and-documentation/155865 "2008-12-18T15:23:27Z")

</div>

hi, how are C pointers handled on the rubycocoa side? for example a method like the following: (BOOL)validateValue:(id \*)ioValue forKey:(NSString \*)key error:(NSError \*\*)outError is there a standard way of handlin…

---

## [Daemons lib not dong much?](https://www.ruby-forum.com/t/daemons-lib-not-dong-much/155958)

<div class="topic-metadata">

**Author:** [@sa125](https://www.ruby-forum.com/u/sa125)\
**Replies:** 0\
**Last updated:** [December 18, 2008, 3:12pm UTC](https://www.ruby-forum.com/t/daemons-lib-not-dong-much/155958 "2008-12-18T15:12:40Z")

</div>

Hello - I’m trying to run a background daemon that will monitor changes in a mysql database. The file to monitor the changes works fine when run by itself from the prompt as $ ruby changes.rb However, when I try to u…

---

## [Speed up require on win32](https://www.ruby-forum.com/t/speed-up-require-on-win32/155609)

<div class="topic-metadata">

**Author:** [@alex\_2k8](https://www.ruby-forum.com/u/alex_2k8)\
**Replies:** 9\
**Last updated:** [December 18, 2008, 3:11pm UTC](https://www.ruby-forum.com/t/speed-up-require-on-win32/155609 "2008-12-18T15:11:10Z")

</div>

Hello, I am trying to speedup the ruby1.8.6 ‘require’ function for Windows. I’ve noticed that for file that successfully found FileMon reports too many such errors: DeviceIoControl, FAST IO DISALLOWED, Control: 0x120…

---

## [Problem converting a System Time to DateTime](https://www.ruby-forum.com/t/problem-converting-a-system-time-to-datetime/155953)

<div class="topic-metadata">

**Author:** [@Marc\_Howell](https://www.ruby-forum.com/u/Marc_Howell)\
**Replies:** 1\
**Last updated:** [December 18, 2008, 2:10pm UTC](https://www.ruby-forum.com/t/problem-converting-a-system-time-to-datetime/155953 "2008-12-18T14:10:26Z")

</div>

Hi All I am new to Ruby and working on a project which needs to read a SystemTime (milliseconds from 1 Jan 1970) from an xml file and convert it to a DateTime. Unfortunately I cant seem to find any method for doing s…

---

## [Q: HOWTO: install a gem using rake?](https://www.ruby-forum.com/t/q-howto-install-a-gem-using-rake/155869)

<div class="topic-metadata">

**Author:** [@jeremyheiler](https://www.ruby-forum.com/u/jeremyheiler)\
**Replies:** 1\
**Last updated:** [December 18, 2008, 1:16pm UTC](https://www.ruby-forum.com/t/q-howto-install-a-gem-using-rake/155869 "2008-12-18T13:16:21Z")

</div>

Is there a standard way to write a gem install task if you build it with GemPackageTask? AFAICT GemPackageTask doesn’t supply one which surprises me a little. I use ‘sh “gem install …”’ and I’m worried about …

---

## [New Version of IBM\_DB Rails Adapter/Driver for IBM DataServers now available](https://www.ruby-forum.com/t/new-version-of-ibm-db-rails-adapter-driver-for-ibm-dataservers-now-available/196864)

<div class="topic-metadata">

**Author:** [@praveen](https://www.ruby-forum.com/u/praveen)\
**Replies:** 0\
**Last updated:** [December 18, 2008, 1:05pm UTC](https://www.ruby-forum.com/t/new-version-of-ibm-db-rails-adapter-driver-for-ibm-dataservers-now-available/196864 "2008-12-18T13:05:47Z")

</div>

Hi All, IBM\_DB 1.0.1 gem refresh is now available. To download the new version visit http://rubyforge.org/projects/rubyibm/ This release of the gem has made made clear the environment variables to be set during the i…

---

## [Ruby to create GUI](https://www.ruby-forum.com/t/ruby-to-create-gui/155945)

<div class="topic-metadata">

**Author:** [@pietia](https://www.ruby-forum.com/u/pietia)\
**Replies:** 1\
**Last updated:** [December 18, 2008, 12:40pm UTC](https://www.ruby-forum.com/t/ruby-to-create-gui/155945 "2008-12-18T12:40:31Z")

</div>

i already installed ruby one-click installer and would like to create simple application with GUI. Can ruby do this? or do i need to install any software? Any documentation about this? thanks in advance! :slight\_smil…

---

## [JRuby Co-Developer to conduct Workshop on JRuby, Testing Java with Ruby](https://www.ruby-forum.com/t/jruby-co-developer-to-conduct-workshop-on-jruby-testing-java-with-ruby/197184)

<div class="topic-metadata">

**Author:** [@shaguf](https://www.ruby-forum.com/u/shaguf)\
**Replies:** 0\
**Last updated:** [December 18, 2008, 11:30am UTC](https://www.ruby-forum.com/t/jruby-co-developer-to-conduct-workshop-on-jruby-testing-java-with-ruby/197184 "2008-12-18T11:30:43Z")

</div>

JRuby Co-Developer to conduct Workshop on JRuby, Testing Java with Ruby JRuby’s tight integration with Java technology, together with outstanding libraries and frameworks from the Ruby world, makes development easier…

---

## [Help with Hpricot and collect](https://www.ruby-forum.com/t/help-with-hpricot-and-collect/155900)

<div class="topic-metadata">

**Author:** [@giantpanda77](https://www.ruby-forum.com/u/giantpanda77)\
**Replies:** 1\
**Last updated:** [December 18, 2008, 11:22am UTC](https://www.ruby-forum.com/t/help-with-hpricot-and-collect/155900 "2008-12-18T11:22:30Z")

</div>

Hi and thanks for the help, I am new to ruby and I am trying to get some data from a website using the Hpricot library.I am doing this: links = Hpricot(index\_page).search(“td.det\_movie”).collect{ |link| link\[“href”\] }…

---

## [JRuby Co-Developer to conduct Workshop on JRuby, Testing Java with Ruby](https://www.ruby-forum.com/t/jruby-co-developer-to-conduct-workshop-on-jruby-testing-java-with-ruby/196862)

<div class="topic-metadata">

**Author:** [@shaguf](https://www.ruby-forum.com/u/shaguf)\
**Replies:** 0\
**Last updated:** [December 18, 2008, 11:15am UTC](https://www.ruby-forum.com/t/jruby-co-developer-to-conduct-workshop-on-jruby-testing-java-with-ruby/196862 "2008-12-18T11:15:25Z")

</div>

JRuby Co-Developer to conduct Workshop on JRuby, Testing Java with Ruby JRuby’s tight integration with Java technology, together with outstanding libraries and frameworks from the Ruby world, makes development easier…

---

## [\[Feature:trunk\] C API reference with Doxygen](https://www.ruby-forum.com/t/feature-trunk-c-api-reference-with-doxygen/155936)

<div class="topic-metadata">

**Author:** [@Yugui\_SYuki\_S.S](https://www.ruby-forum.com/u/Yugui_SYuki_S.S)\
**Replies:** 1\
**Last updated:** [December 18, 2008, 10:44am UTC](https://www.ruby-forum.com/t/feature-trunk-c-api-reference-with-doxygen/155936 "2008-12-18T10:44:57Z")

</div>

Yuguiã§ã™ã€‚ å¸¸ã€…ã€C APIãƒªãƒ•ã‚¡ãƒ¬ãƒ³ã‚¹ã‚’Doxygenã§ä½œã‚ŠãŸã„ã¨æ€ã£ã¦ã„ã¾ã—ãŸã€‚YARVã§å‘¼ã³å‡º ã—äº‹å‰æ¡ä»¶ã‚’æŒã¤ã‚ˆã†ãªé–¢æ•°ã‚‚ã‹ãªã‚Šå¢—ãˆãŸã“ã¨ã§ã™ã—ã€ãã†ã—ãŸæƒ…å ±ã‚’æ›¸…

---

## [Array problem](https://www.ruby-forum.com/t/array-problem/155912)

<div class="topic-metadata">

**Author:** [@giantpanda77](https://www.ruby-forum.com/u/giantpanda77)\
**Replies:** 12\
**Last updated:** [December 18, 2008, 10:44am UTC](https://www.ruby-forum.com/t/array-problem/155912 "2008-12-18T10:44:21Z")

</div>

I have an array like this: array = \[ “manyThings.mp3”, “myLike.gif”, “moreCoco.bmp”, “theFormat.bmp”\] and I want to make some comparison to eliminate all the words in the array that are NOT of the bmp format. So at …

---

## [JRuby Co-Developer to conduct Workshop on JRuby, Testing Java with Ruby](https://www.ruby-forum.com/t/jruby-co-developer-to-conduct-workshop-on-jruby-testing-java-with-ruby/155938)

<div class="topic-metadata">

**Author:** [@shaguf](https://www.ruby-forum.com/u/shaguf)\
**Replies:** 0\
**Last updated:** [December 18, 2008, 10:30am UTC](https://www.ruby-forum.com/t/jruby-co-developer-to-conduct-workshop-on-jruby-testing-java-with-ruby/155938 "2008-12-18T10:30:51Z")

</div>

JRuby Co-Developer to conduct Workshop on JRuby, Testing Java with Ruby JRuby’s tight integration with Java technology, together with outstanding libraries and frameworks from the Ruby world, makes development easier…

---

## [Minitest/spec, minitest/mock $B$rI8=\`E:IU$+$i30$7$^$;$s$+!)(B](https://www.ruby-forum.com/t/minitest-spec-minitest-mock-b-ri8-e-iu-i30-7-s-b/155924)

<div class="topic-metadata">

**Author:** [@okkez](https://www.ruby-forum.com/u/okkez)\
**Replies:** 3\
**Last updated:** [December 18, 2008, 8:59am UTC](https://www.ruby-forum.com/t/minitest-spec-minitest-mock-b-ri8-e-iu-i30-7-s-b/155924 "2008-12-18T08:59:19Z")

</div>

okkez e$B$G$9!#e(B e$B!V2?$r:#$5$i!W$H;W$o$l$k$+$b$7$l$^$;$s$,!"Ej9F$7$^$9!#e(B e$B%j%U%!%l%s%9%^%K%e%"%k$r=q$/$?$a$K!"e(Bminitest e$B$K4^$^$l$k%i%$%V%i%j$rFI$s$G$$$?$N$G$9$,!"e(B minitest/spec, minitest/mock e$B$OI8…

---

## [Rake command to drop a table using migration file](https://www.ruby-forum.com/t/rake-command-to-drop-a-table-using-migration-file/155918)

<div class="topic-metadata">

**Author:** [@kumar\_a](https://www.ruby-forum.com/u/kumar_a)\
**Replies:** 0\
**Last updated:** [December 18, 2008, 7:25am UTC](https://www.ruby-forum.com/t/rake-command-to-drop-a-table-using-migration-file/155918 "2008-12-18T07:25:32Z")

</div>

Hi, Please send me the information regarding how to drop a table using regarding rake command. Thanks in Advance, kumar

---

## [How to run .rb file in ruby](https://www.ruby-forum.com/t/how-to-run-rb-file-in-ruby/155678)

<div class="topic-metadata">

**Author:** [@sp00nyg](https://www.ruby-forum.com/u/sp00nyg)\
**Replies:** 1\
**Last updated:** [December 18, 2008, 6:40am UTC](https://www.ruby-forum.com/t/how-to-run-rb-file-in-ruby/155678 "2008-12-18T06:40:51Z")

</div>

Hi, we are real noobs and have to program in ruby on rail for a study project. We want ti start a second server (chatserver) How are we able to run an ruby file ( like in netrail: Run-\>run File) in our view or contro…

---

## [Writing a good spec](https://www.ruby-forum.com/t/writing-a-good-spec/155909)

<div class="topic-metadata">

**Author:** [@navouri](https://www.ruby-forum.com/u/navouri)\
**Replies:** 2\
**Last updated:** [December 18, 2008, 6:08am UTC](https://www.ruby-forum.com/t/writing-a-good-spec/155909 "2008-12-18T06:08:04Z")

</div>

So I have a piece of code that I didn’t write a spec for, and now rcov is yelling at me about it. The problem is that I’m not really sure how I should do it. def build\_structure(paths) unless File::exists?(‘specdoc’) …

---

## [Win32-security 0.1.0](https://www.ruby-forum.com/t/win32-security-0-1-0/155914)

<div class="topic-metadata">

**Author:** [@danielb](https://www.ruby-forum.com/u/danielb)\
**Replies:** 0\
**Last updated:** [December 18, 2008, 5:59am UTC](https://www.ruby-forum.com/t/win32-security-0-1-0/155914 "2008-12-18T05:59:40Z")

</div>

Hi everyone, The Win32Utils Team is happy to announce the first release of the win32-security library. Haha, yes, I know, Windows “Security”. Get it out of your system now. Done? Ok. = What is it? A library that e…

---

## [M17n of irb](https://www.ruby-forum.com/t/m17n-of-irb/154001)

<div class="topic-metadata">

**Author:** [@Yugui\_SYuki\_S.S](https://www.ruby-forum.com/u/Yugui_SYuki_S.S)\
**Replies:** 34\
**Last updated:** [December 18, 2008, 5:16am UTC](https://www.ruby-forum.com/t/m17n-of-irb/154001 "2008-12-18T05:16:25Z")

</div>

Yuguiã§ã™ã€‚ irbã®å¤šè¨€èªžåŒ–ã‚’è©¦ã¿ã¦ã¿ã¾ã—ãŸã€‚ãƒ‘ãƒƒãƒã‚’æ·»ä»˜ã—ã¾ã™ã€‚ã“ã®å¤‰æ›´ã«ã‚ˆã‚Šã€ ãƒ•ã‚¡ã‚¤ãƒ«ã‹ã‚‰ã‚³ãƒ¼ãƒ‰ã‚’èª­ã‚€éš›ã«magic commentã‚’è§£é‡ˆã—ã¾ã™ã€‚ lexçµæžœã«æ­£ã—ãenco…

---

## [Proper jruby.home setting for an embedded app? (NPE in 1.1.6)](https://www.ruby-forum.com/t/proper-jruby-home-setting-for-an-embedded-app-npe-in-1-1-6/155905)

<div class="topic-metadata">

**Author:** [@Peter\_K\_Chan](https://www.ruby-forum.com/u/Peter_K_Chan)\
**Replies:** 3\
**Last updated:** [December 18, 2008, 5:05am UTC](https://www.ruby-forum.com/t/proper-jruby-home-setting-for-an-embedded-app-npe-in-1-1-6/155905 "2008-12-18T05:05:19Z")

</div>

What is the proper value for jruby.home in an embedded runtime? It seems that in 1.1.5, the value defaults at being HOME/.jruby. In 1.1.6, the value ends up being null and causing a NPE. I tried to provide a default …

---

## [Zlib.so (LoadError)](https://www.ruby-forum.com/t/zlib-so-loaderror/155895)

<div class="topic-metadata">

**Author:** [@mike343](https://www.ruby-forum.com/u/mike343)\
**Replies:** 3\
**Last updated:** [December 18, 2008, 3:10am UTC](https://www.ruby-forum.com/t/zlib-so-loaderror/155895 "2008-12-18T03:10:45Z")

</div>

I’m getting the error below when trying to install ruby gems on Windows Vista. My Ruby version is 1.8.7 and gems 1.3.1. I installed Ruby from the zip file ruby-1.8.7-i386-mswin32.zip and gems by running ruby setup.rb…

---

## [Error list](https://www.ruby-forum.com/t/error-list/155901)

<div class="topic-metadata">

**Author:** [@asetzler](https://www.ruby-forum.com/u/asetzler)\
**Replies:** 1\
**Last updated:** [December 18, 2008, 2:46am UTC](https://www.ruby-forum.com/t/error-list/155901 "2008-12-18T02:46:37Z")

</div>

I am a Ruby newbie. In my learning attempts, I often run across errors-obviously. I am finding it hard to look the errors up online. For example, if I search the net for nomethoderror, I don’t get a good explanatio…

---

## [Your word frequency calculator?](https://www.ruby-forum.com/t/your-word-frequency-calculator/155823)

<div class="topic-metadata">

**Author:** [@CSPohjanraito](https://www.ruby-forum.com/u/CSPohjanraito)\
**Replies:** 2\
**Last updated:** [December 18, 2008, 2:34am UTC](https://www.ruby-forum.com/t/your-word-frequency-calculator/155823 "2008-12-18T02:34:20Z")

</div>

Hi! I am studying various texts and code. Word frequency calculator is one basic tool. I find it an interesting, elementary problem to solve. I found this word frequency analyser by William J.: freq = Hash.new(0) lo…

---

## [What's wrong with my method and regular expression?](https://www.ruby-forum.com/t/whats-wrong-with-my-method-and-regular-expression/155899)

<div class="topic-metadata">

**Author:** [@equinox](https://www.ruby-forum.com/u/equinox)\
**Replies:** 3\
**Last updated:** [December 18, 2008, 2:23am UTC](https://www.ruby-forum.com/t/whats-wrong-with-my-method-and-regular-expression/155899 "2008-12-18T02:23:14Z")

</div>

The code is http://pastie.org/341880 And i want it to return nil www.yahoo.co.in /~testing/i.html but when I run this code, why doesn’t the www.yahoo.co.in detected?

---

## [A question about ruby array](https://www.ruby-forum.com/t/a-question-about-ruby-array/155822)

<div class="topic-metadata">

**Author:** [@youhaodeyi](https://www.ruby-forum.com/u/youhaodeyi)\
**Replies:** 3\
**Last updated:** [December 18, 2008, 2:03am UTC](https://www.ruby-forum.com/t/a-question-about-ruby-array/155822 "2008-12-18T02:03:23Z")

</div>

I read some ruby examples and found there is a syntax I don’t understand. When getting an array element, it uses “array\[:id\]”. I wander why there is a colon before the index. What does this mean?

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

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