# Ruby

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

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

---

## [\[Bug #779\] Time#strftime $B$,@5$7$/5!G=$7$J$$(B](https://www.ruby-forum.com/t/bug-779-time-strftime-b-5-7-5-g-7-j-b/153987)

<div class="topic-metadata">

**Author:** [@tadayoshi\_funaba](https://www.ruby-forum.com/u/tadayoshi_funaba)\
**Replies:** 0\
**Last updated:** [November 24, 2008, 12:15pm UTC](https://www.ruby-forum.com/t/bug-779-time-strftime-b-5-7-5-g-7-j-b/153987 "2008-11-24T12:15:12Z")

</div>

Bug #779: Time#strftime e$B$,@5$7$/5!G=$7$J$$e(B http://redmine.ruby-lang.org/issues/show/779 e$B5/I\<\<Te(B: tadayoshi funaba e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal e$B0J2\<$N$h$&$K!“e(B%w e$B$N7k2L$,F@$i$l$J$$;v…

---

## [\[Bug:1.9\] 1+1+1+...+1 dumps core](https://www.ruby-forum.com/t/bug-1-9-1-1-1-1-dumps-core/152231)

<div class="topic-metadata">

**Author:** [@Yusuke\_ENDOH](https://www.ruby-forum.com/u/Yusuke_ENDOH)\
**Replies:** 12\
**Last updated:** [November 24, 2008, 10:30am UTC](https://www.ruby-forum.com/t/bug-1-9-1-1-1-1-dumps-core/152231 "2008-11-24T10:30:40Z")

</div>

e$B1sF#$G$9!#e(B e$B0J2\<$Ge(B SEGV e$B$7$^$9!#e(B $ ./ruby -e ‘eval(“1+” \* 100000 + “1”)’ e$B%;%0%a%s%F!\<%7%g%s0cH?$G$9e(B iseq\_compile\_each e$B$N:F5"$G%9%?%C%/%\*!\<%P!\<%U%m!\<$9$k$?$a$G$9!#e(B e$B:F5"?t$N%A%’%C%/$rF~…

---

## [How does Ruby handle namespace?](https://www.ruby-forum.com/t/how-does-ruby-handle-namespace/153452)

<div class="topic-metadata">

**Author:** [@youhaodeyi](https://www.ruby-forum.com/u/youhaodeyi)\
**Replies:** 4\
**Last updated:** [November 24, 2008, 1:28am UTC](https://www.ruby-forum.com/t/how-does-ruby-handle-namespace/153452 "2008-11-24T01:28:43Z")

</div>

In Java, it uses import to include other classes from other packages. In ruby, I only found that require statement can do this. When the ruby scripts are located in different directories, I have to use the “…/…/” to i…

---

## [Printing right arrow vs. a sane progressbar library](https://www.ruby-forum.com/t/printing-right-arrow-vs-a-sane-progressbar-library/153922)

<div class="topic-metadata">

**Author:** [@Shot\_SPiotr\_S.S](https://www.ruby-forum.com/u/Shot_SPiotr_S.S)\
**Replies:** 4\
**Last updated:** [November 24, 2008, 1:05am UTC](https://www.ruby-forum.com/t/printing-right-arrow-vs-a-sane-progressbar-library/153922 "2008-11-24T01:05:39Z")

</div>

I want to track the progress of a set of (forkoffâ€™d) processes in a simple way. What I have in mind is a line of dots equal in length to the number of processes, and once a process number X finishes, it prints \\r, t…

---

## [Need script for the following problem](https://www.ruby-forum.com/t/need-script-for-the-following-problem/153076)

<div class="topic-metadata">

**Author:** [@Sita\_Rami\_R](https://www.ruby-forum.com/u/Sita_Rami_R)\
**Replies:** 4\
**Last updated:** [November 23, 2008, 8:40pm UTC](https://www.ruby-forum.com/t/need-script-for-the-following-problem/153076 "2008-11-23T20:40:50Z")

</div>

Hi, My problem is folows Opened google and entered pickaxe and clicked search in the page followed, i want to collect all the page titles which are in green color and all the corresponding links in a log file. i wan…

---

## [Storing Array in Hash](https://www.ruby-forum.com/t/storing-array-in-hash/153945)

<div class="topic-metadata">

**Author:** [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Replies:** 4\
**Last updated:** [November 23, 2008, 3:28pm UTC](https://www.ruby-forum.com/t/storing-array-in-hash/153945 "2008-11-23T15:28:29Z")

</div>

I am having the most insane time with Ruby’s Hash class. I have Array’s of varied length, but whenever they are stored and then retrieved from a Hash they become length of 1 and all the values are somehow combined in …

---

## [Getting on the rubyforge announce list](https://www.ruby-forum.com/t/getting-on-the-rubyforge-announce-list/153927)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 1\
**Last updated:** [November 23, 2008, 3:27pm UTC](https://www.ruby-forum.com/t/getting-on-the-rubyforge-announce-list/153927 "2008-11-23T15:27:44Z")

</div>

Hi all. Question: how does one get an announcement onto the rubyforge.org home page? I’m using newgem, and was…kind of thinking rake announce would do the trick but it never seems to. Thoughts? -=R

---

## [Using Hpricot with HTML's](https://www.ruby-forum.com/t/using-hpricot-with-htmls/153909)

<div class="topic-metadata">

**Author:** [@ukbell](https://www.ruby-forum.com/u/ukbell)\
**Replies:** 3\
**Last updated:** [November 23, 2008, 2:57pm UTC](https://www.ruby-forum.com/t/using-hpricot-with-htmls/153909 "2008-11-23T14:57:50Z")

</div>

I have been working on this program for class all day and am not getting anywhere, so I figured I would try to ask you guys on the forum. Here is my code so far: #!/usr/bin/ruby Lab 19 require ‘rubygems’ require ‘f…

---

## [How can I set default value for each column in a Database?](https://www.ruby-forum.com/t/how-can-i-set-default-value-for-each-column-in-a-database/153933)

<div class="topic-metadata">

**Author:** [@youhaodeyi](https://www.ruby-forum.com/u/youhaodeyi)\
**Replies:** 2\
**Last updated:** [November 23, 2008, 12:06pm UTC](https://www.ruby-forum.com/t/how-can-i-set-default-value-for-each-column-in-a-database/153933 "2008-11-23T12:06:14Z")

</div>

I created a database in my rails project and want to set default value for each column. I have read the self.up method of the file db\\migrate\\20081123094926\_create\_bay\_infos.rb and thought that this is where I need to…

---

## [Can I package a Ruby library?](https://www.ruby-forum.com/t/can-i-package-a-ruby-library/153930)

<div class="topic-metadata">

**Author:** [@youhaodeyi](https://www.ruby-forum.com/u/youhaodeyi)\
**Replies:** 1\
**Last updated:** [November 23, 2008, 10:19am UTC](https://www.ruby-forum.com/t/can-i-package-a-ruby-library/153930 "2008-11-23T10:19:15Z")

</div>

I made a Ruby project which includes may Ruby source files. I’d like to package them into one file and let other applications use them. (Just like jar files in Java). Can I do this in Ruby? If yes, how? If no, what do…

---

## [JMaglev public available](https://www.ruby-forum.com/t/jmaglev-public-available/153912)

<div class="topic-metadata">

**Author:** [@fabiokr](https://www.ruby-forum.com/u/fabiokr)\
**Replies:** 3\
**Last updated:** [November 23, 2008, 6:38am UTC](https://www.ruby-forum.com/t/jmaglev-public-available/153912 "2008-11-23T06:38:50Z")

</div>

Hi all, I’m releasing my experiments with JRuby and Terracotta ( JRuby, sharing objects across multiple runtimes. JMagLev? | Fabio Kung), so you can play with JMaglev and contribute some code. :wink: I had to patch…

---

## [Super dynamic class definition causes infinite loop](https://www.ruby-forum.com/t/super-dynamic-class-definition-causes-infinite-loop/152891)

<div class="topic-metadata">

**Author:** [@Kouhei\_S](https://www.ruby-forum.com/u/Kouhei_S)\
**Replies:** 1\
**Last updated:** [November 23, 2008, 5:36am UTC](https://www.ruby-forum.com/t/super-dynamic-class-definition-causes-infinite-loop/152891 "2008-11-23T05:36:52Z")

</div>

e$B?\\F#$G$9!#e(B e$B0J2\<$N%9%/%j%W%H$Ne(B2e$B2sL$Ne(Bdefined\_class.newe$B$GL58B%k!\<%W$K$J$Ce(B e$B$F$7$^$$$^$9!#e(B def define\_class(parent=nil) Class.new(parent || Object) do def initialize super end end end d…

---

## [Perl quoting convention that avoids excessive backslashes](https://www.ruby-forum.com/t/perl-quoting-convention-that-avoids-excessive-backslashes/153911)

<div class="topic-metadata">

**Author:** [@Kelly\_J](https://www.ruby-forum.com/u/Kelly_J)\
**Replies:** 1\
**Last updated:** [November 22, 2008, 10:27pm UTC](https://www.ruby-forum.com/t/perl-quoting-convention-that-avoids-excessive-backslashes/153911 "2008-11-22T22:27:30Z")

</div>

Perl lets you quote strings like this: $foo = qq%This string has both “quotes” and ‘apostrophes’%; to avoid excessive backslashing. Does ruby have anything similar?

---

## [Need help understand an expression](https://www.ruby-forum.com/t/need-help-understand-an-expression/153900)

<div class="topic-metadata">

**Author:** [@buzz](https://www.ruby-forum.com/u/buzz)\
**Replies:** 3\
**Last updated:** [November 22, 2008, 7:30pm UTC](https://www.ruby-forum.com/t/need-help-understand-an-expression/153900 "2008-11-22T19:30:35Z")

</div>

Hi, Can someone explain the role of the “?” before the “x” s = “abcdefg” s\[0\] = ?x # s == “xbcdef” I know this will accomplish the same thing. s\[0\] = ‘x’ Thanks, Buzz

---

## [Mutlilingual rdoc](https://www.ruby-forum.com/t/mutlilingual-rdoc/153882)

<div class="topic-metadata">

**Author:** [@macario](https://www.ruby-forum.com/u/macario)\
**Replies:** 1\
**Last updated:** [November 22, 2008, 7:28pm UTC](https://www.ruby-forum.com/t/mutlilingual-rdoc/153882 "2008-11-22T19:28:11Z")

</div>

Hi forum, is it posible to generate rdocs versions from the same lib in diferent languages?

---

## [JavaOne call for papers: we need you!](https://www.ruby-forum.com/t/javaone-call-for-papers-we-need-you/153834)

<div class="topic-metadata">

**Author:** [@headius](https://www.ruby-forum.com/u/headius)\
**Replies:** 10\
**Last updated:** [November 22, 2008, 4:25pm UTC](https://www.ruby-forum.com/t/javaone-call-for-papers-we-need-you/153834 "2008-11-22T16:25:57Z")

</div>

JavaOne call for papers is open, and we’re really looking for JRuby users to submit more talks this year. No topic is too small! No project is too weird! And feel free to run ideas by this list. I think Tom and I woul…

---

## [Fwd: no logging from Rails apps](https://www.ruby-forum.com/t/fwd-no-logging-from-rails-apps/153861)

<div class="topic-metadata">

**Author:** [@lennylmiller](https://www.ruby-forum.com/u/lennylmiller)\
**Replies:** 3\
**Last updated:** [November 22, 2008, 4:18pm UTC](https://www.ruby-forum.com/t/fwd-no-logging-from-rails-apps/153861 "2008-11-22T16:18:53Z")

</div>

Here is a message I just sent internally. Thought it might be an interesting FYI for some on this list. We have multiple Rails 2.1.0 apps deployed in Tomcat 5.5 using Warbler-0.9.11/jruby-rack-0.9.2. Below is the last…

---

## [Latent semantic analysis in Ruby](https://www.ruby-forum.com/t/latent-semantic-analysis-in-ruby/153886)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [November 22, 2008, 1:00pm UTC](https://www.ruby-forum.com/t/latent-semantic-analysis-in-ruby/153886 "2008-11-22T13:00:43Z")

</div>

Hello, For anyone that’s interested I’ve just put together an article on a Ruby implementation of Latent semantic analysis. It contains explanations, examples and code. There is also a gem to play around with.

---

## [Error opening a file when filename is passed thru a variable](https://www.ruby-forum.com/t/error-opening-a-file-when-filename-is-passed-thru-a-variable/153851)

<div class="topic-metadata">

**Author:** [@raju\_k](https://www.ruby-forum.com/u/raju_k)\
**Replies:** 1\
**Last updated:** [November 22, 2008, 11:56am UTC](https://www.ruby-forum.com/t/error-opening-a-file-when-filename-is-passed-thru-a-variable/153851 "2008-11-22T11:56:49Z")

</div>

Hi, I have a script as below. Can you please tell me if something is wrong here ? It errors out for this code where as if I pass full name instead of variable, it is working. cat readfile5.rb #!/usr/bin/env ruby lo…

---

## [Search reg-exp for exact match](https://www.ruby-forum.com/t/search-reg-exp-for-exact-match/153722)

<div class="topic-metadata">

**Author:** [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Replies:** 2\
**Last updated:** [November 22, 2008, 11:55am UTC](https://www.ruby-forum.com/t/search-reg-exp-for-exact-match/153722 "2008-11-22T11:55:39Z")

</div>

Hi, I have a regular expression /\\b2003|\\2004|\\2005|\\2006|\\2007|\\2008|\\2009\\b/ and i want to check if various years are present. “2003” =~ /\\b2003|\\2004|\\2005|\\2006|\\2007|\\2008|\\2009\\b/ returns 0 as expected “2010…

---

## [1.1.3 & 1.1.5 nearly identical benchmark wit Rails app?](https://www.ruby-forum.com/t/1-1-3-1-1-5-nearly-identical-benchmark-wit-rails-app/153631)

<div class="topic-metadata">

**Author:** [@ghoti143](https://www.ruby-forum.com/u/ghoti143)\
**Replies:** 8\
**Last updated:** [November 22, 2008, 4:54am UTC](https://www.ruby-forum.com/t/1-1-3-1-1-5-nearly-identical-benchmark-wit-rails-app/153631 "2008-11-22T04:54:05Z")

</div>

I’m doing some tuning of our JRuby/Rails app, TriSano (www.trisano.org). We were still on 1.1.3 so one of the first things I did was upgrade to 1.1.5. Interestingly? the benchmarks are virtually identical between 1.1.…

---

## [ANN: ThirdBase: A Fast and Easy Date/DateTime Class for Ruby](https://www.ruby-forum.com/t/ann-thirdbase-a-fast-and-easy-date-datetime-class-for-ruby/153873)

<div class="topic-metadata">

**Author:** [@nerdmaster](https://www.ruby-forum.com/u/nerdmaster)\
**Replies:** 0\
**Last updated:** [November 22, 2008, 3:56am UTC](https://www.ruby-forum.com/t/ann-thirdbase-a-fast-and-easy-date-datetime-class-for-ruby/153873 "2008-11-22T03:56:34Z")

</div>

= ThirdBase: A Fast and Easy Date/DateTime Class for Ruby ThirdBase differs from Ruby’s standard Date/DateTime class in the following ways: ThirdBase is roughly 2-12 times faster depending on usage ThirdBase has a lo…

---

## [WhoIs lookup using Ruby](https://www.ruby-forum.com/t/whois-lookup-using-ruby/153857)

<div class="topic-metadata">

**Author:** [@pond](https://www.ruby-forum.com/u/pond)\
**Replies:** 1\
**Last updated:** [November 22, 2008, 12:06am UTC](https://www.ruby-forum.com/t/whois-lookup-using-ruby/153857 "2008-11-22T00:06:48Z")

</div>

Is there a Ruby class or an API I could use for conducting WhoIs lookups on domain names? I found whois-ruby, but it looks like it only does ipwhois lookups, which isn’t what I’m looking for. Any ideas? I’ve been look…

---

## [Append new line to textfile](https://www.ruby-forum.com/t/append-new-line-to-textfile/153859)

<div class="topic-metadata">

**Author:** [@mmcolli00](https://www.ruby-forum.com/u/mmcolli00)\
**Replies:** 4\
**Last updated:** [November 21, 2008, 11:37pm UTC](https://www.ruby-forum.com/t/append-new-line-to-textfile/153859 "2008-11-21T23:37:37Z")

</div>

I want to create a text file and append a new line to the text file everytime a new logline is completed, my program iterates and gives a new log every few hours. this is an example of my logline: logline: ‘completed…

---

## [Question about initialize](https://www.ruby-forum.com/t/question-about-initialize/106644)

<div class="topic-metadata">

**Author:** [@mschwab](https://www.ruby-forum.com/u/mschwab)\
**Replies:** 5\
**Last updated:** [November 21, 2008, 10:01pm UTC](https://www.ruby-forum.com/t/question-about-initialize/106644 "2008-11-21T22:01:23Z")

</div>

Why is the constructor method named initialize? Why not name it new to be consistent? Mike S.

---

## [How to use include? on an array of objects](https://www.ruby-forum.com/t/how-to-use-include-on-an-array-of-objects/153838)

<div class="topic-metadata">

**Author:** [@fipa](https://www.ruby-forum.com/u/fipa)\
**Replies:** 4\
**Last updated:** [November 21, 2008, 8:57pm UTC](https://www.ruby-forum.com/t/how-to-use-include-on-an-array-of-objects/153838 "2008-11-21T20:57:54Z")

</div>

I have the following array: \[ product1, product2, product3 \] All products are of type Product. The Product class defines isntance attributes such as: title, description, price. Can I use include? to check if the arra…

---

## [Unit Conversion (#183)](https://www.ruby-forum.com/t/unit-conversion-183/153302)

<div class="topic-metadata">

**Author:** [@mansfiem](https://www.ruby-forum.com/u/mansfiem)\
**Replies:** 36\
**Last updated:** [November 21, 2008, 8:49pm UTC](https://www.ruby-forum.com/t/unit-conversion-183/153302 "2008-11-21T20:49:06Z")

</div>

\-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- The three rules of Ruby Q. 2: Please do not post any solutions or spoiler discussion for this quiz until 48 hours have passed from the time on th…

---

## [How to wrap method of singleton class](https://www.ruby-forum.com/t/how-to-wrap-method-of-singleton-class/153828)

<div class="topic-metadata">

**Author:** [@ittayd](https://www.ruby-forum.com/u/ittayd)\
**Replies:** 2\
**Last updated:** [November 21, 2008, 8:45pm UTC](https://www.ruby-forum.com/t/how-to-wrap-method-of-singleton-class/153828 "2008-11-21T20:45:00Z")

</div>

Hi, Given a class: class Foo class \<\< self def foo puts 'foo' end end end How do I write a module, so that when included in Foo it will wrap the method foo so that Foo.foo will print: bar foo ? Thank you …

---

## [Putting string values into array](https://www.ruby-forum.com/t/putting-string-values-into-array/153844)

<div class="topic-metadata">

**Author:** [@jackster](https://www.ruby-forum.com/u/jackster)\
**Replies:** 2\
**Last updated:** [November 21, 2008, 8:20pm UTC](https://www.ruby-forum.com/t/putting-string-values-into-array/153844 "2008-11-21T20:20:50Z")

</div>

I have a string that contians about 20 names that are all seperated by a single white space. What is the easiest way to get those 20 names into an array of 20 elements? a = “first\_name second\_name third\_name etc” tha…

---

## [Can't convert Hash into String](https://www.ruby-forum.com/t/cant-convert-hash-into-string/153799)

<div class="topic-metadata">

**Author:** [@rajatgarg](https://www.ruby-forum.com/u/rajatgarg)\
**Replies:** 2\
**Last updated:** [November 21, 2008, 7:37pm UTC](https://www.ruby-forum.com/t/cant-convert-hash-into-string/153799 "2008-11-21T19:37:18Z")

</div>

Hi, I get an XML like this from a hotel API - \<name\>Oriental Riverside Hotel - Pudong Shanghai\</name\> \<address1\>No. 2727, Riverside Ave., Pu\</address1\> \<address2/\> \<address3/\> \<city\>SHANGHAI\</city\> \<stateProvince/\> \<co…

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

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