# Ruby

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

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

---

## [Quicker finding strings? Alternative for array, hash, set?](https://www.ruby-forum.com/t/quicker-finding-strings-alternative-for-array-hash-set/159204)

<div class="topic-metadata">

**Author:** [@pjpatten](https://www.ruby-forum.com/u/pjpatten)\
**Replies:** 9\
**Last updated:** [February 3, 2009, 4:52pm UTC](https://www.ruby-forum.com/t/quicker-finding-strings-alternative-for-array-hash-set/159204 "2009-02-03T16:52:06Z")

</div>

I’ve been searching for this information already, but cannot really find the answer I’m looking for. I have to find values in a list of some 40,000 strings. Putting all these in an array is not likely to be the quicke…

---

## [Analyzer.rb cannot run](https://www.ruby-forum.com/t/analyzer-rb-cannot-run/159311)

<div class="topic-metadata">

**Author:** [@cryxpride](https://www.ruby-forum.com/u/cryxpride)\
**Replies:** 3\
**Last updated:** [February 3, 2009, 4:18pm UTC](https://www.ruby-forum.com/t/analyzer-rb-cannot-run/159311 "2009-02-03T16:18:24Z")

</div>

Hi, I’m kinda new to this programmin thing and I’m currently using windows vista and it seems whenever I run this file: line = File.readlines(“text.txt”) lines\_count = lines.size text = lines.join puts “#{line\_count…

---

## [Variable declarations on one line](https://www.ruby-forum.com/t/variable-declarations-on-one-line/159213)

<div class="topic-metadata">

**Author:** [@frisco](https://www.ruby-forum.com/u/frisco)\
**Replies:** 10\
**Last updated:** [February 3, 2009, 2:54pm UTC](https://www.ruby-forum.com/t/variable-declarations-on-one-line/159213 "2009-02-03T14:54:06Z")

</div>

a=“al”, b=“bob”, c=“carl” Why is a an array containing al, bob, carl, and not a string “al”?

---

## [Dump format error - stale\_session\_check](https://www.ruby-forum.com/t/dump-format-error-stale-session-check/154708)

<div class="topic-metadata">

**Author:** [@vmvipin](https://www.ruby-forum.com/u/vmvipin)\
**Replies:** 3\
**Last updated:** [February 3, 2009, 2:50pm UTC](https://www.ruby-forum.com/t/dump-format-error-stale-session-check/154708 "2009-02-03T14:50:57Z")

</div>

Hi all, Am using jruby with rails 2.2.2. Its starting successfully and running. After 3 or 4 clicks am getting this error. vipin$ jruby -S jetty\_rails -e production -p 3000 JRuby limited openssl loaded. gem install j…

---

## [\[Bug #1097\] Ruby 1.9.1 $B$K$\*$1$k(B sqlite3-ruby $B$N%$%s%9%H!\<%k;~$N%(%i!\<(B](https://www.ruby-forum.com/t/bug-1097-ruby-1-9-1-b-k-1-k-b-sqlite3-ruby-b-n-s-9-h-k-n-i-b/159326)

<div class="topic-metadata">

**Author:** [@Jun\_Kudo](https://www.ruby-forum.com/u/Jun_Kudo)\
**Replies:** 0\
**Last updated:** [February 3, 2009, 2:34pm UTC](https://www.ruby-forum.com/t/bug-1097-ruby-1-9-1-b-k-1-k-b-sqlite3-ruby-b-n-s-9-h-k-n-i-b/159326 "2009-02-03T14:34:27Z")

</div>

e$B%A%1%C%He(B #1097 e$B$,99?7$5$l$^$7$?!#e(B (by Jun Kudo) e$B1~Ez$"$j$,$H$&$4$6$$$^$9!#6D$kDL$j!"e(Bsqlite3-ruby 1.2.4 e$B$Ne(B mswin32 e$BHG%P%$%J%j$O$^$@G\[I\[$5$l$F$$$^$;$s$G$7$?!#e(B e$BD4$Y$F$\_$?$H$3$m!"e(Bsqlite…

---

## [Choose parameter to solve for](https://www.ruby-forum.com/t/choose-parameter-to-solve-for/159290)

<div class="topic-metadata">

**Author:** [@leveille](https://www.ruby-forum.com/u/leveille)\
**Replies:** 7\
**Last updated:** [February 3, 2009, 2:05pm UTC](https://www.ruby-forum.com/t/choose-parameter-to-solve-for/159290 "2009-02-03T14:05:04Z")

</div>

I’m looking for a clean way to write a function that allows me to choose which parameter to solve for assuming all others are known. Is it good design to do something like this: ? class Foo def initialize(x, y, z) @…

---

## [Extensions and 'require'](https://www.ruby-forum.com/t/extensions-and-require/159232)

<div class="topic-metadata">

**Author:** [@alby](https://www.ruby-forum.com/u/alby)\
**Replies:** 6\
**Last updated:** [February 3, 2009, 1:43pm UTC](https://www.ruby-forum.com/t/extensions-and-require/159232 "2009-02-03T13:43:18Z")

</div>

Hello! I’m creating a ‘gem’ package for a ruby extension written in C. I have a little problem: First, let’s suppose the package is called “Mambo”. Now, the “.so” (or “.dll”, or whatever) is called “mambo.so”. In ad…

---

## [\[Bug #1097\](Rejected) Ruby 1.9.1 $B$K$\*$1$k(B sqlite3-ruby $B$N%$%s%9%H!\<%k;~$N%(%i!\<(B](https://www.ruby-forum.com/t/bug-1097-rejected-ruby-1-9-1-b-k-1-k-b-sqlite3-ruby-b-n-s-9-h-k-n-i-b/159324)

<div class="topic-metadata">

**Author:** [@Usaku\_NAKAMURA](https://www.ruby-forum.com/u/Usaku_NAKAMURA)\
**Replies:** 0\
**Last updated:** [February 3, 2009, 1:32pm UTC](https://www.ruby-forum.com/t/bug-1097-rejected-ruby-1-9-1-b-k-1-k-b-sqlite3-ruby-b-n-s-9-h-k-n-i-b/159324 "2009-02-03T13:32:10Z")

</div>

e$B%A%1%C%He(B #1097 e$B$,99?7$5$l$^$7$?!#e(B (by Usaku NAKAMURA) e$B%9%F!\<%?%9e(B Opene$B$+$ie(BRejectede$B$KJQ99e(B e$B$?$V$se(Bsqlite3-rubye$B$Ne(B1.9.1-p0-mswin32e$BMQ$N%P%$%J%j$,G\[I\[$5$l$F$$$J$$$N$G!“\<+A0$G3HD%%i%…

---

## [Test\_etc.rb $B$N=$@5Ds0F(B](https://www.ruby-forum.com/t/test-etc-rb-b-n-5ds0f-b/159308)

<div class="topic-metadata">

**Author:** [@Tomoyuki\_C](https://www.ruby-forum.com/u/Tomoyuki_C)\
**Replies:** 2\
**Last updated:** [February 3, 2009, 1:27pm UTC](https://www.ruby-forum.com/t/test-etc-rb-b-n-5ds0f-b/159308 "2009-02-03T13:27:27Z")

</div>

e$B6a1J$H?=$7$^$9!#e(B e$B8=:\_e(B trunk e$B$N%=!\<%9%D%j!\<$r%A%’%C%/%"%&%H$7$F\<j85$N4D6-$Ge(B make test-all e$B$9$k$H3HD%%i%$%V%i%je(B etc e$B$N%F%9%H$Ge(B 2 failures e$B$Ke(B e$B$J$j$^$9e(B(e$BB\>$K$b$"$j$^$9$,$H$j$"$…

---

## [\[FEATURE:trunk\] Readline.completion\_proc = nil $B$r5v2D$9$k!#(B](https://www.ruby-forum.com/t/feature-trunk-readline-completion-proc-nil-b-r5v2d-9-k-b/159289)

<div class="topic-metadata">

**Author:** [@Takao\_K](https://www.ruby-forum.com/u/Takao_K)\
**Replies:** 2\
**Last updated:** [February 3, 2009, 1:17pm UTC](https://www.ruby-forum.com/t/feature-trunk-readline-completion-proc-nil-b-r5v2d-9-k-b/159289 "2009-02-03T13:17:29Z")

</div>

e$B9bHx9(\<#$G$9!#e(B Readline.readlinee$B$NJd408uJd$r\<hF@$9$ke(B Proc e$B$re(B Readline.completion\_proc= e$B$G;XDj$G$-$^$9!#e(B e$B$7$+$7!“Jd408uJd$r\<hF@$9$k=hM}$r%G%U%)%k%H$N$b$N$KLa$9J}K!$,$”$j$^$;$s!#e(B Readline.…

---

## [\[Bug #1097\] Ruby 1.9.1 $B$K$\*$1$k(B sqlite3-ruby $B$N%$%s%9%H!\<%k;~$N%(%i!\<(B](https://www.ruby-forum.com/t/bug-1097-ruby-1-9-1-b-k-1-k-b-sqlite3-ruby-b-n-s-9-h-k-n-i-b/159322)

<div class="topic-metadata">

**Author:** [@Jun\_Kudo](https://www.ruby-forum.com/u/Jun_Kudo)\
**Replies:** 0\
**Last updated:** [February 3, 2009, 1:10pm UTC](https://www.ruby-forum.com/t/bug-1097-ruby-1-9-1-b-k-1-k-b-sqlite3-ruby-b-n-s-9-h-k-n-i-b/159322 "2009-02-03T13:10:27Z")

</div>

Bug #1097: Ruby 1.9.1 e$B$K$\*$1$ke(B sqlite3-ruby e$B$N%$%s%9%H!\<%k;~$N%(%i!\<e(B http://redmine.ruby-lang.org/issues/show/1097 e$B5/I\<\<Te(B: Jun Kudo e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal Target version: 1.9.…

---

## [Is this possible in Ruby](https://www.ruby-forum.com/t/is-this-possible-in-ruby/159276)

<div class="topic-metadata">

**Author:** [@ther](https://www.ruby-forum.com/u/ther)\
**Replies:** 4\
**Last updated:** [February 3, 2009, 11:06am UTC](https://www.ruby-forum.com/t/is-this-possible-in-ruby/159276 "2009-02-03T11:06:41Z")

</div>

Just an idea which may come in handy. Can this be done and how in Ruby. def calc(what) some\_eval(what) end a=10 b=12 calc(‘a+b’) # expression as parameters =\> 12 # would return a=‘aa’ b=‘bb’ calc(‘a+b’) =\> ‘…

---

## [Extending Ruby](https://www.ruby-forum.com/t/extending-ruby/159287)

<div class="topic-metadata">

**Author:** [@orlick](https://www.ruby-forum.com/u/orlick)\
**Replies:** 0\
**Last updated:** [February 3, 2009, 4:02am UTC](https://www.ruby-forum.com/t/extending-ruby/159287 "2009-02-03T04:02:34Z")

</div>

Hi, I am using the mkmf module to create a Makefile that will generate a shared object library. How can I list source files to be used that do not reside in the same directory as the ruby file that generates the Mak…

---

## [SJIS conversion question](https://www.ruby-forum.com/t/sjis-conversion-question/159284)

<div class="topic-metadata">

**Author:** [@thomasmaas](https://www.ruby-forum.com/u/thomasmaas)\
**Replies:** 0\
**Last updated:** [February 3, 2009, 3:36am UTC](https://www.ruby-forum.com/t/sjis-conversion-question/159284 "2009-02-03T03:36:26Z")

</div>

I’m working on a project in which I need to convert some text with X0208 alphabet characters to ascii and back. NKF does the former efficiently, but I can’t find any options for doing the latter. Does anyone know a go…

---

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

<div class="topic-metadata">

**Author:** [@manisha](https://www.ruby-forum.com/u/manisha)\
**Replies:** 3\
**Last updated:** [February 3, 2009, 3:30am UTC](https://www.ruby-forum.com/t/problem-with-ruby-classes/159233 "2009-02-03T03:30:56Z")

</div>

Can Anyone please tell me how can we create an object of a class that is present in one ruby file, in another ruby file? I tried using .new() method but that doesn’t seem to work.It simply cannot find the required fil…

---

## [Is there any Plugins for log file analysis in ruby?](https://www.ruby-forum.com/t/is-there-any-plugins-for-log-file-analysis-in-ruby/159073)

<div class="topic-metadata">

**Author:** [@vikas](https://www.ruby-forum.com/u/vikas)\
**Replies:** 3\
**Last updated:** [February 2, 2009, 11:15pm UTC](https://www.ruby-forum.com/t/is-there-any-plugins-for-log-file-analysis-in-ruby/159073 "2009-02-02T23:15:50Z")

</div>

Hello all, Problem - 1) I want to retrieve some info from development.log file using plugins. In early stage i decided to use Regular Expression to retrieve required data but i want to use plugin for that. So …

---

## [Question on reading text files in Windows](https://www.ruby-forum.com/t/question-on-reading-text-files-in-windows/159247)

<div class="topic-metadata">

**Author:** [@bigjimmyk3](https://www.ruby-forum.com/u/bigjimmyk3)\
**Replies:** 5\
**Last updated:** [February 2, 2009, 10:54pm UTC](https://www.ruby-forum.com/t/question-on-reading-text-files-in-windows/159247 "2009-02-02T22:54:08Z")

</div>

I am running Ruby 1.86 on Windows, and having trouble reading in some text files. For some text files, if I do something simple like: myfile = File.open(“logfile.log”) contents = myfile.read() puts contents I get e…

---

## [Logging 0.9.6](https://www.ruby-forum.com/t/logging-0-9-6/159267)

<div class="topic-metadata">

**Author:** [@timperrett](https://www.ruby-forum.com/u/timperrett)\
**Replies:** 0\
**Last updated:** [February 2, 2009, 9:28pm UTC](https://www.ruby-forum.com/t/logging-0-9-6/159267 "2009-02-02T21:28:54Z")

</div>

logging version 0.9.6 by Tim P. http://logging.rubyforge.org/ == DESCRIPTION Logging is a flexible logging library for use in Ruby programs based on the design of Java’s log4j library. It features a hierarchical lo…

---

## [Noob question: while or for loop within a list](https://www.ruby-forum.com/t/noob-question-while-or-for-loop-within-a-list/159259)

<div class="topic-metadata">

**Author:** [@dginther](https://www.ruby-forum.com/u/dginther)\
**Replies:** 9\
**Last updated:** [February 2, 2009, 9:26pm UTC](https://www.ruby-forum.com/t/noob-question-while-or-for-loop-within-a-list/159259 "2009-02-02T21:26:14Z")

</div>

Essentially I want to do the following: list = “url1, irl2, url3, url4, url5” while \[ list \]; #in other words, we loop 5 times or = # things in list do #A Bunch of Stuff 1 #A Bunch of Stuff 2 done My list is esse…

---

## [Example JDBC database.yml files and other questions](https://www.ruby-forum.com/t/example-jdbc-database-yml-files-and-other-questions/159107)

<div class="topic-metadata">

**Author:** [@Joseph\_A](https://www.ruby-forum.com/u/Joseph_A)\
**Replies:** 3\
**Last updated:** [February 2, 2009, 9:24pm UTC](https://www.ruby-forum.com/t/example-jdbc-database-yml-files-and-other-questions/159107 "2009-02-02T21:24:12Z")

</div>

Could anyone send me some example jdbc database.yml files for these databases:derby h2 hsqldb I don’t have any experience with them and there aren’t already version of these in the rails source. Also I’m having tr…

---

## [Remove all class methods via remove\_method](https://www.ruby-forum.com/t/remove-all-class-methods-via-remove-method/159171)

<div class="topic-metadata">

**Author:** [@dodeantn](https://www.ruby-forum.com/u/dodeantn)\
**Replies:** 1\
**Last updated:** [February 2, 2009, 9:21pm UTC](https://www.ruby-forum.com/t/remove-all-class-methods-via-remove-method/159171 "2009-02-02T21:21:15Z")

</div>

Hi, how do I remove all my class methods like in the following example? – class Parent class \<\< self def class\_stuff puts “Stuff from my class” end end end class Child \< Parent remove all the class methods; sho…

---

## [Which behaves correctly, Hpricot or Nokogiri?](https://www.ruby-forum.com/t/which-behaves-correctly-hpricot-or-nokogiri/159197)

<div class="topic-metadata">

**Author:** [@maz](https://www.ruby-forum.com/u/maz)\
**Replies:** 3\
**Last updated:** [February 2, 2009, 9:01pm UTC](https://www.ruby-forum.com/t/which-behaves-correctly-hpricot-or-nokogiri/159197 "2009-02-02T21:01:14Z")

</div>

I’ve been considering switching to Nokogiri instead of Hpricot, mostly 'cause Mechanize has switched. However, the two actually behave quite differently. The Nokogiri objects don’t simulate standard container behavi…

---

## [Eruby and caching](https://www.ruby-forum.com/t/eruby-and-caching/159262)

<div class="topic-metadata">

**Author:** [@Kasper\_Johansen](https://www.ruby-forum.com/u/Kasper_Johansen)\
**Replies:** 0\
**Last updated:** [February 2, 2009, 8:25pm UTC](https://www.ruby-forum.com/t/eruby-and-caching/159262 "2009-02-02T20:25:51Z")

</div>

Hi group. First of all, I am new in Ruby. I have tried to set up my Apache webserver (Debian) with mod\_ruby and erubi. At first everything seemed fine, but when I began developing, I noticed that some pages didnt upd…

---

## [Clarrification about "trap"](https://www.ruby-forum.com/t/clarrification-about-trap/159256)

<div class="topic-metadata">

**Author:** [@shamika](https://www.ruby-forum.com/u/shamika)\
**Replies:** 1\
**Last updated:** [February 2, 2009, 8:17pm UTC](https://www.ruby-forum.com/t/clarrification-about-trap/159256 "2009-02-02T20:17:36Z")

</div>

Hi, I know in ruby we use “trap” command to handle OS signals while passing the signal and the proc object as parameters respectively. when i call this trap function before any infinite loop it does work perfectly. M…

---

## [Membership settings for ruby talk](https://www.ruby-forum.com/t/membership-settings-for-ruby-talk/159249)

<div class="topic-metadata">

**Author:** [@codeinnova](https://www.ruby-forum.com/u/codeinnova)\
**Replies:** 2\
**Last updated:** [February 2, 2009, 8:14pm UTC](https://www.ruby-forum.com/t/membership-settings-for-ruby-talk/159249 "2009-02-02T20:14:05Z")

</div>

Hi All, I have been trying to set my membership for this group such that i receive only one email per day. And although i selected that setting, i still get a lot of emails instead of an abridged one. Can someone tel…

---

## [Quoting problem with %x](https://www.ruby-forum.com/t/quoting-problem-with-x/158415)

<div class="topic-metadata">

**Author:** [@will\_p](https://www.ruby-forum.com/u/will_p)\
**Replies:** 2\
**Last updated:** [February 2, 2009, 7:35pm UTC](https://www.ruby-forum.com/t/quoting-problem-with-x/158415 "2009-02-02T19:35:50Z")

</div>

I’m having a problem invoking external programs from ruby that are passed arguments containing spaces. I have a program that I would invoke outside of ruby like: progname -o ‘something with spaces’ How do I get th…

---

## [JRuby - Invoke Dynamic Status](https://www.ruby-forum.com/t/jruby-invoke-dynamic-status/159251)

<div class="topic-metadata">

**Author:** [@philswenson](https://www.ruby-forum.com/u/philswenson)\
**Replies:** 0\
**Last updated:** [February 2, 2009, 7:35pm UTC](https://www.ruby-forum.com/t/jruby-invoke-dynamic-status/159251 "2009-02-02T19:35:14Z")

</div>

Guess this is mostly directed to Charles. Could you clue us in on the status of Invoke Dynamic in the JVM, in JRuby, and when there will be a development build of both that we can try out? I know Java 7 probably won’…

---

## [JVM Crash while running build on trunk](https://www.ruby-forum.com/t/jvm-crash-while-running-build-on-trunk/159245)

<div class="topic-metadata">

**Author:** [@Joseph\_A](https://www.ruby-forum.com/u/Joseph_A)\
**Replies:** 2\
**Last updated:** [February 2, 2009, 7:17pm UTC](https://www.ruby-forum.com/t/jvm-crash-while-running-build-on-trunk/159245 "2009-02-02T19:17:01Z")

</div>

Should I file a bug for this? Can’t say I’m an expert on reading these JVM error logs, but it looks like there was a problem invoking a native function while running the FFI tests. Joe

---

## [Kernel.xxx interferes with method\_missing](https://www.ruby-forum.com/t/kernel-xxx-interferes-with-method-missing/159239)

<div class="topic-metadata">

**Author:** [@axyd80](https://www.ruby-forum.com/u/axyd80)\
**Replies:** 4\
**Last updated:** [February 2, 2009, 7:01pm UTC](https://www.ruby-forum.com/t/kernel-xxx-interferes-with-method-missing/159239 "2009-02-02T19:01:10Z")

</div>

Hello! I’m using method\_missing to create DSL, the problem is that Kernel.xxx methods are interferes with it. How this issue can be solved? It seems that one solution is to explicitly define all global methods (p, s…

---

## [How to know the index value on the each method](https://www.ruby-forum.com/t/how-to-know-the-index-value-on-the-each-method/159241)

<div class="topic-metadata">

**Author:** [@elioncho](https://www.ruby-forum.com/u/elioncho)\
**Replies:** 3\
**Last updated:** [February 2, 2009, 6:42pm UTC](https://www.ruby-forum.com/t/how-to-know-the-index-value-on-the-each-method/159241 "2009-02-02T18:42:08Z")

</div>

Hello, I was wondering if there is a way to access the current index value when using the each method to iterate over an array. For example, @pancakes.each do |pancake| puts pancake How can I ask which is the curren…

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

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