# Ruby

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

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

---

## [Regular expression](https://www.ruby-forum.com/t/regular-expression/145165)

<div class="topic-metadata">

**Author:** [@vanight](https://www.ruby-forum.com/u/vanight)\
**Replies:** 1\
**Last updated:** [August 6, 2008, 4:55pm UTC](https://www.ruby-forum.com/t/regular-expression/145165 "2008-08-06T16:55:02Z")

</div>

Hi, I need a regular expression for a filename : it must be composed with the following letters : a to z A to Z 0 to 9 dash sign - underscore sign \_ then how can I compare a string with it : mystring =~ /myregex…

---

## [Is there a way to AutoParse a string to another type - e.g. if a Date format then date, else if inte](https://www.ruby-forum.com/t/is-there-a-way-to-autoparse-a-string-to-another-type-e-g-if-a-date-format-then-date-else-if-inte/145120)

<div class="topic-metadata">

**Author:** [@greg](https://www.ruby-forum.com/u/greg)\
**Replies:** 6\
**Last updated:** [August 6, 2008, 3:52pm UTC](https://www.ruby-forum.com/t/is-there-a-way-to-autoparse-a-string-to-another-type-e-g-if-a-date-format-then-date-else-if-inte/145120 "2008-08-06T15:52:54Z")

</div>

Hi, Is there a way to AutoParse a string to another type - e.g. if a Date format then date, else if integer than Integer etc I’m wanting to pass search parameters via a URL, however since everything in the URL will…

---

## [Optimizing runtimes in Rails](https://www.ruby-forum.com/t/optimizing-runtimes-in-rails/144897)

<div class="topic-metadata">

**Author:** [@ADADAD](https://www.ruby-forum.com/u/ADADAD)\
**Replies:** 8\
**Last updated:** [August 6, 2008, 3:38pm UTC](https://www.ruby-forum.com/t/optimizing-runtimes-in-rails/144897 "2008-08-06T15:38:51Z")

</div>

Hello, Is there a recommended way to determine how many JRuby runtimes to configure for a tomcat app running rails under JRuby? I know that the equivalent of multiple mongrels with JRuby under Tomcat is the JRuby ru…

---

## [While loop with fixnum - not working](https://www.ruby-forum.com/t/while-loop-with-fixnum-not-working/145082)

<div class="topic-metadata">

**Author:** [@mmcolli00](https://www.ruby-forum.com/u/mmcolli00)\
**Replies:** 4\
**Last updated:** [August 6, 2008, 2:33pm UTC](https://www.ruby-forum.com/t/while-loop-with-fixnum-not-working/145082 "2008-08-06T14:33:10Z")

</div>

I can’t get the while loop to work. When I set ErrorCount.Class it outputs Fixnum. Do you think that this is the reason that that the while will not execute? Thanks in advance. Mom Mcolli00 it (“Search for FieldId Tag…

---

## [Redirect\_to vs render](https://www.ruby-forum.com/t/redirect-to-vs-render/145141)

<div class="topic-metadata">

**Author:** [@palani](https://www.ruby-forum.com/u/palani)\
**Replies:** 1\
**Last updated:** [August 6, 2008, 2:08pm UTC](https://www.ruby-forum.com/t/redirect-to-vs-render/145141 "2008-08-06T14:08:00Z")

</div>

Can any one explain me what is the difference between redirect\_to and render.I am newbie. i am bit confuesd about those two.

---

## [Reverse DNS lookup?](https://www.ruby-forum.com/t/reverse-dns-lookup/145102)

<div class="topic-metadata">

**Author:** [@garg](https://www.ruby-forum.com/u/garg)\
**Replies:** 2\
**Last updated:** [August 6, 2008, 2:01pm UTC](https://www.ruby-forum.com/t/reverse-dns-lookup/145102 "2008-08-06T14:01:16Z")

</div>

I’m in an environment with a lot of computers that haven’t been properly inventoried. Basically, no one knows which IP goes with which mac address and which hostname. So I wrote the following: This script goes down th…

---

## [Get Previous month](https://www.ruby-forum.com/t/get-previous-month/145131)

<div class="topic-metadata">

**Author:** [@ganana\_srishti](https://www.ruby-forum.com/u/ganana_srishti)\
**Replies:** 2\
**Last updated:** [August 6, 2008, 1:32pm UTC](https://www.ruby-forum.com/t/get-previous-month/145131 "2008-08-06T13:32:22Z")

</div>

Hi, I want previous month name for example Time.now.strftime("%B") will result the month name “August” But i need to find the previous month if anybody knows reply me…

---

## [$SAFE=4$B$N\>l9g$N(BReadline::HISTORY.each](https://www.ruby-forum.com/t/safe-4-b-n-l9g-n-breadline-history-each/144742)

<div class="topic-metadata">

**Author:** [@Takao\_K](https://www.ruby-forum.com/u/Takao_K)\
**Replies:** 5\
**Last updated:** [August 6, 2008, 1:04pm UTC](https://www.ruby-forum.com/t/safe-4-b-n-l9g-n-breadline-history-each/144742 "2008-08-06T13:04:04Z")

</div>

knu e$B$5$s$Xe(B e$B9bHx9(\<#$G$9!#e(B knu e$B$5$s$,e(B r16125 e$B$K$F!"e(B Readline::HISTORY.each e$B%a%=%C%I$r%V%m%C%/$J$7$G8F$S=P$7$?$H$-$K!"e(B Enumerable::Enumerator e$B$rJV$9$h$&$K=$@5$5$l$?$HG’\<1$7$F$$$^$9!#e(B …

---

## [Rails incredibly slow (update)](https://www.ruby-forum.com/t/rails-incredibly-slow-update/120150)

<div class="topic-metadata">

**Author:** [@rjeffries](https://www.ruby-forum.com/u/rjeffries)\
**Replies:** 80\
**Last updated:** [August 6, 2008, 12:41pm UTC](https://www.ruby-forum.com/t/rails-incredibly-slow-update/120150 "2008-08-06T12:41:53Z")

</div>

After 24 minutes of waiting, the Welcome Aboard window came up in my browser. The command window now contains 22:20:51.78 C:\\InstantRails\\rails\_apps\\demo\>ruby script/server =\> Booting Mongrel (use ‘script/server webri…

---

## [Whose fault is my problem?](https://www.ruby-forum.com/t/whose-fault-is-my-problem/144946)

<div class="topic-metadata">

**Author:** [@pod](https://www.ruby-forum.com/u/pod)\
**Replies:** 9\
**Last updated:** [August 6, 2008, 12:39pm UTC](https://www.ruby-forum.com/t/whose-fault-is-my-problem/144946 "2008-08-06T12:39:45Z")

</div>

I’ve recently started to write an appliaction in Ruby. It’s the first time I’m using the language. Infact, the only reason I’m using it is because it’s all my friends EEE laptop had on it at the time :slight\_smile: (Wh…

---

## [Break if status =~ /variable/ wildcard possible in Ruby?](https://www.ruby-forum.com/t/break-if-status-variable-wildcard-possible-in-ruby/145049)

<div class="topic-metadata">

**Author:** [@mmcolli00](https://www.ruby-forum.com/u/mmcolli00)\
**Replies:** 3\
**Last updated:** [August 6, 2008, 11:50am UTC](https://www.ruby-forum.com/t/break-if-status-variable-wildcard-possible-in-ruby/145049 "2008-08-06T11:50:48Z")

</div>

Can you use a wild card with a variable? I have StrgErrFieldName as a variable that will hold a number of possible status ids. I want to search on what is in the variable. However =~ only works with strings so I have …

---

## [Dokkit 0.4.3 released](https://www.ruby-forum.com/t/dokkit-0-4-3-released/145136)

<div class="topic-metadata">

**Author:** [@gendag](https://www.ruby-forum.com/u/gendag)\
**Replies:** 0\
**Last updated:** [August 6, 2008, 11:46am UTC](https://www.ruby-forum.com/t/dokkit-0-4-3-released/145136 "2008-08-06T11:46:06Z")

</div>

Hi Folks, dokkit 0.4.3 has been released! 1 Changes from version 0.4.2 fixed haml dependency in gem package 2 What’s dokkit? dokkit is a document generator written in ruby that is suitable for static websites gene…

---

## [\[Ruby 1.9 - Bug #369\] (Open) Ruby 1.9.0-3$B$G(B R](https://www.ruby-forum.com/t/ruby-1-9-bug-369-open-ruby-1-9-0-3-b-g-b-r/144394)

<div class="topic-metadata">

**Author:** [@Akira\_M](https://www.ruby-forum.com/u/Akira_M)\
**Replies:** 4\
**Last updated:** [August 6, 2008, 11:11am UTC](https://www.ruby-forum.com/t/ruby-1-9-bug-369-open-ruby-1-9-0-3-b-g-b-r/144394 "2008-08-06T11:11:31Z")

</div>

e$B%A%1%C%He(B #369 e$B$,Js9p$5$l$^$7$?!#e(B (by Akira M.) Bug #369: Ruby 1.9.0-3e$B$Ge(B R http://redmine.ruby-lang.org/issues/show/369 e$B5/I\<\<Te(B: Akira M. e$B%9%F!\<%?%9e(B: Open e$BM%@hEYe(B: Normal e$BC4Ev\<T…

---

## [Strange result using String#split](https://www.ruby-forum.com/t/strange-result-using-string-split/145098)

<div class="topic-metadata">

**Author:** [@Ryan\_Wallace](https://www.ruby-forum.com/u/Ryan_Wallace)\
**Replies:** 1\
**Last updated:** [August 6, 2008, 9:54am UTC](https://www.ruby-forum.com/t/strange-result-using-string-split/145098 "2008-08-06T09:54:44Z")

</div>

I am trying to split a string on all occurrences of ’ AND ’ except where it appears within quotes. I have a regular expression which works but generates strange output in a certain case: “text\_search ‘(large red spear…

---

## [Processing code file inline](https://www.ruby-forum.com/t/processing-code-file-inline/145130)

<div class="topic-metadata">

**Author:** [@S-gw](https://www.ruby-forum.com/u/S-gw)\
**Replies:** 2\
**Last updated:** [August 6, 2008, 9:48am UTC](https://www.ruby-forum.com/t/processing-code-file-inline/145130 "2008-08-06T09:48:17Z")

</div>

I need to have a script load a file and execute that file as if it was code inline to the script. The file being loaded is not a class, not a module. It is code that has been dynamically written by another process. Ex…

---

## [RubyWeekend #2 game contest this weekend](https://www.ruby-forum.com/t/rubyweekend-2-game-contest-this-weekend/143942)

<div class="topic-metadata">

**Author:** [@amin1426](https://www.ruby-forum.com/u/amin1426)\
**Replies:** 4\
**Last updated:** [August 6, 2008, 9:42am UTC](https://www.ruby-forum.com/t/rubyweekend-2-game-contest-this-weekend/143942 "2008-08-06T09:42:25Z")

</div>

The second RubyWeekend game creation contest is this weekend. The official rules and time have been posted \[1\], and everybody’s gearing up for some programming fun this weekend! The contest starts at Friday, July 25, …

---

## [Any one working on...C# to IronRuby Converter...?](https://www.ruby-forum.com/t/any-one-working-on-c-to-ironruby-converter/145042)

<div class="topic-metadata">

**Author:** [@webreservoir](https://www.ruby-forum.com/u/webreservoir)\
**Replies:** 4\
**Last updated:** [August 6, 2008, 8:58am UTC](https://www.ruby-forum.com/t/any-one-working-on-c-to-ironruby-converter/145042 "2008-08-06T08:58:09Z")

</div>

Hello, We have C# to Vb.Net and Vb.Net to C# converter at the moment. This make our life as a programmer more easy. Just wondering, if any one is working or thinking to implement a Converter that deals with C# to Iro…

---

## [Problems with rb-gsl on ubuntu](https://www.ruby-forum.com/t/problems-with-rb-gsl-on-ubuntu/145024)

<div class="topic-metadata">

**Author:** [@Axel\_E](https://www.ruby-forum.com/u/Axel_E)\
**Replies:** 2\
**Last updated:** [August 6, 2008, 8:18am UTC](https://www.ruby-forum.com/t/problems-with-rb-gsl-on-ubuntu/145024 "2008-08-06T08:18:09Z")

</div>

Dear all, I am having problems with rb-gsl on ubuntu 8.04: the (older) 1.9.2 version does not install its path anywhere, so it cannot be used without specially arranging the path, the actual 1.10.3 version does not …

---

## ["\\x01\\x00\\x00\\x00".encode("utf-8","utf-32le")](https://www.ruby-forum.com/t/x01-x00-x00-x00-encode-utf-8-utf-32le/145114)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 0\
**Last updated:** [August 6, 2008, 6:27am UTC](https://www.ruby-forum.com/t/x01-x00-x00-x00-encode-utf-8-utf-32le/145114 "2008-08-06T06:27:03Z")

</div>

e$B0J2\<$N$h$&$K!"e(BUTF-32LE e$B$+$ie(B UTF-8 e$B$X$NJQ49$,IT0BDj$J5sF0$r\<($7$^$9!#e(B % ./ruby -ve ‘10.times { p “\\x01\\x00\\x00\\x00”.encode(“utf-8”,“utf-32le”) }’ ruby 1.9.0 (2008-08-06 revision 18381) \[i686-linux\] …

---

## [Conversion undefined by "\\xdc\\x00".encode("EUC-JP", "UTF-16BE", :invalid=\>:replace)](https://www.ruby-forum.com/t/conversion-undefined-by-xdc-x00-encode-euc-jp-utf-16be-invalid-replace/145115)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 0\
**Last updated:** [August 6, 2008, 6:22am UTC](https://www.ruby-forum.com/t/conversion-undefined-by-xdc-x00-encode-euc-jp-utf-16be-invalid-replace/145115 "2008-08-06T06:22:23Z")

</div>

“\\xdc\\x00” e$B$re(B UTF-16BE e$B$+$ie(B EUC-JP e$B$Ke(B :invalid=\>:replace e$B$r$D$1$FJQ49$9$k$He(B conversion undefined for byte sequence e$B$K$J$j$^$9!#e(B % ./ruby -ve ‘p “\\xdc\\x00”.encode(“EUC-JP”, “UTF-16BE”, :i…

---

## [Rdoc reinstall breaks fast-ri - now what?](https://www.ruby-forum.com/t/rdoc-reinstall-breaks-fast-ri-now-what/144951)

<div class="topic-metadata">

**Author:** [@matt\_neuburg](https://www.ruby-forum.com/u/matt_neuburg)\
**Replies:** 2\
**Last updated:** [August 6, 2008, 2:20am UTC](https://www.ruby-forum.com/t/rdoc-reinstall-breaks-fast-ri-now-what/144951 "2008-08-06T02:20:54Z")

</div>

I am really just not having any luck with rdoc / ri these days. Because the new version of rdoc promised that File#read would finally succeed (automatic lookup of methods in the supercclass), I downloaded it. It didn’…

---

## [Encoding and the windows environment, a question](https://www.ruby-forum.com/t/encoding-and-the-windows-environment-a-question/145096)

<div class="topic-metadata">

**Author:** [@AD60](https://www.ruby-forum.com/u/AD60)\
**Replies:** 0\
**Last updated:** [August 6, 2008, 12:21am UTC](https://www.ruby-forum.com/t/encoding-and-the-windows-environment-a-question/145096 "2008-08-06T00:21:01Z")

</div>

Contrary to established wisdom I named my user on my windows (Vista) system “André” (with an e-acute). It is my name after all. The Dir.glob method shows my home directory using ISO-8859-15 encoding. The thing that pu…

---

## [Update: NoMethodError?](https://www.ruby-forum.com/t/update-nomethoderror/145095)

<div class="topic-metadata">

**Author:** [@laredotornado](https://www.ruby-forum.com/u/laredotornado)\
**Replies:** 0\
**Last updated:** [August 6, 2008, 12:10am UTC](https://www.ruby-forum.com/t/update-nomethoderror/145095 "2008-08-06T00:10:30Z")

</div>

Hi, I’m trying to update an existing model from form data, by doing def update # Get the subscriber corresponding to the client. params\[:form\]\[:user\_id\] = session\[:user\_id\] @user…

---

## [Missing AbstractScriptEngine](https://www.ruby-forum.com/t/missing-abstractscriptengine/144327)

<div class="topic-metadata">

**Author:** [@wet](https://www.ruby-forum.com/u/wet)\
**Replies:** 4\
**Last updated:** [August 6, 2008, 12:09am UTC](https://www.ruby-forum.com/t/missing-abstractscriptengine/144327 "2008-08-06T00:09:19Z")

</div>

Hi,I am using jruby version 1.1.3 in Mac with JDK 5.0 and the reference implementation of JSR 223, when I run code to load the JRubyScriptEngine, I get the following error: Exception in thread “main” java.lang.NoClas…

---

## [Code Review: interpret1](https://www.ruby-forum.com/t/code-review-interpret1/145090)

<div class="topic-metadata">

**Author:** [@raker\_t](https://www.ruby-forum.com/u/raker_t)\
**Replies:** 2\
**Last updated:** [August 5, 2008, 11:44pm UTC](https://www.ruby-forum.com/t/code-review-interpret1/145090 "2008-08-05T23:44:09Z")

</div>

tfpt review “/shelveset:interpret1;REDMOND\\jdeville” Comment : Modifies run.rb and common.rb to clean up command line flags and run tests under -D -X:Interpret, -D and -D -X:SaveAssemblies. All three are ran in snap…

---

## [Dokkit 0.4.2 released](https://www.ruby-forum.com/t/dokkit-0-4-2-released/145054)

<div class="topic-metadata">

**Author:** [@gendag](https://www.ruby-forum.com/u/gendag)\
**Replies:** 2\
**Last updated:** [August 5, 2008, 10:36pm UTC](https://www.ruby-forum.com/t/dokkit-0-4-2-released/145054 "2008-08-05T22:36:44Z")

</div>

Hi Folks, dokkit 0.4.2 has been released! 1 Changes from version 0.4.1 added ‘formatter’ configuration key With the ‘formatter’ key, users can select the formatter to use for rendering the current document. The ex…

---

## [No such file to load -- rubygems](https://www.ruby-forum.com/t/no-such-file-to-load-rubygems/145063)

<div class="topic-metadata">

**Author:** [@padmapriya](https://www.ruby-forum.com/u/padmapriya)\
**Replies:** 1\
**Last updated:** [August 5, 2008, 10:11pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-rubygems/145063 "2008-08-05T22:11:51Z")

</div>

I am trying to call ruby (User.rb)\[Which uses ActiveRecord and will return List of Table Rows\] My Environment is java(using spring framework - Tomcat) running In Windows. \[Basically trying to run BSF part of http://…

---

## [Watir with javascript/css menus and events](https://www.ruby-forum.com/t/watir-with-javascript-css-menus-and-events/145084)

<div class="topic-metadata">

**Author:** [@chadmontplaisir](https://www.ruby-forum.com/u/chadmontplaisir)\
**Replies:** 1\
**Last updated:** [August 5, 2008, 9:09pm UTC](https://www.ruby-forum.com/t/watir-with-javascript-css-menus-and-events/145084 "2008-08-05T21:09:07Z")

</div>

Hi everyone, So I have a small problem. I need to create a mock up of a Watir test against a site that uses both javascript drop down menus as well as CSS based drop down menus. I am unable to figure out how to get …

---

## [Earworm 0.0.2 Released](https://www.ruby-forum.com/t/earworm-0-0-2-released/145078)

<div class="topic-metadata">

**Author:** [@aaronpowell](https://www.ruby-forum.com/u/aaronpowell)\
**Replies:** 0\
**Last updated:** [August 5, 2008, 8:11pm UTC](https://www.ruby-forum.com/t/earworm-0-0-2-released/145078 "2008-08-05T20:11:42Z")

</div>

earworm version 0.0.2 has been released! http://earworm.rubyforge.org Earworm can identify unknown music using MusicDNS and libofa. FEATURES/PROBLEMS: Identifies mp3, ogg, and wav files. SYNOPSIS: Identify an unk…

---

## [Windows-31J \<-\> UTF-8 roundtrip](https://www.ruby-forum.com/t/windows-31j-utf-8-roundtrip/144735)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 9\
**Last updated:** [August 5, 2008, 8:08pm UTC](https://www.ruby-forum.com/t/windows-31j-utf-8-roundtrip/144735 "2008-08-05T20:08:11Z")

</div>

e$B0J2\<$N$h$&$Ke(B Windows-31J e$B$He(B UTF-8 e$B$,e(B roundtrip e$B$9$k$+$I$&$+e(B e$B$rD4$Y$k$H!"$7$J$$J8;z$,$$$/$D$+$"$j$^$9$,!"$=$&$$$&$b$N$G$7e(B e$B$?$C$1e(B? % ./ruby -ve ’ hi\_bytes = (0x81…0x9f).to\_a + (0xe0…

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

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