# Ruby

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

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

---

## [Can't require 'socket' on Windows (JRuby 1.1.5)](https://www.ruby-forum.com/t/cant-require-socket-on-windows-jruby-1-1-5/155357)

<div class="topic-metadata">

**Author:** [@adammontgomery](https://www.ruby-forum.com/u/adammontgomery)\
**Replies:** 1\
**Last updated:** [December 11, 2008, 1:42am UTC](https://www.ruby-forum.com/t/cant-require-socket-on-windows-jruby-1-1-5/155357 "2008-12-11T01:42:45Z")

</div>

I have a JRuby 1.1.5 program that works fine on OS X but I can’t get it to work on Windows. When I try to require ‘webrick’ I get the following error: C:/Program Files/path with ‘quote/java/lib/ruby/1.8/webrick/confi…

---

## [Ruby equivalent to \`find . -perm -g+rw -ls\`](https://www.ruby-forum.com/t/ruby-equivalent-to-find-perm-g-rw-ls/153459)

<div class="topic-metadata">

**Author:** [@Bil\_K](https://www.ruby-forum.com/u/Bil_K)\
**Replies:** 8\
**Last updated:** [December 11, 2008, 12:34am UTC](https://www.ruby-forum.com/t/ruby-equivalent-to-find-perm-g-rw-ls/153459 "2008-12-11T00:34:20Z")

</div>

Hi, I can’t find a Ruby equivalent to find . -perm -g+rw -ls Currently, it looks like I’ll need to combine, File.stat(file).mode with something like Hal F.'s sym2oct, http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ru…

---

## [Thread safety resources](https://www.ruby-forum.com/t/thread-safety-resources/155352)

<div class="topic-metadata">

**Author:** [@tjholowaychuk](https://www.ruby-forum.com/u/tjholowaychuk)\
**Replies:** 2\
**Last updated:** [December 10, 2008, 11:48pm UTC](https://www.ruby-forum.com/t/thread-safety-resources/155352 "2008-12-10T23:48:49Z")

</div>

What would you consider the cleanest, yet effective way to produce thread-safe libraries? any tips or suggestions for a Ruby newb would be fantastic

---

## [JRuby 1.1.6RC1 in maven repo seems to be compiled by JDK 1.6](https://www.ruby-forum.com/t/jruby-1-1-6rc1-in-maven-repo-seems-to-be-compiled-by-jdk-1-6/155249)

<div class="topic-metadata">

**Author:** [@Yoko\_H](https://www.ruby-forum.com/u/Yoko_H)\
**Replies:** 3\
**Last updated:** [December 10, 2008, 11:43pm UTC](https://www.ruby-forum.com/t/jruby-1-1-6rc1-in-maven-repo-seems-to-be-compiled-by-jdk-1-6/155249 "2008-12-10T23:43:25Z")

</div>

Hi, When I ran a program below from maven project, which has dependecy to JRuby 1.1.6RC1, I got a “bad version number” exception. My maven project is set up to run on JDK 1.5. This exception is never raised if I inst…

---

## [Given a string find the matching class](https://www.ruby-forum.com/t/given-a-string-find-the-matching-class/155263)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 2\
**Last updated:** [December 10, 2008, 9:07pm UTC](https://www.ruby-forum.com/t/given-a-string-find-the-matching-class/155263 "2008-12-10T21:07:54Z")

</div>

I have a situation where I desire to pass a string to a method that then: Capitalizes the the string value Finds a class by that name Something like: def findmyclass(m) find\_class\_by\_name(m.capitalize) end I…

---

## [Extracing the URL from hpricot element](https://www.ruby-forum.com/t/extracing-the-url-from-hpricot-element/155343)

<div class="topic-metadata">

**Author:** [@nratlos](https://www.ruby-forum.com/u/nratlos)\
**Replies:** 1\
**Last updated:** [December 10, 2008, 7:56pm UTC](https://www.ruby-forum.com/t/extracing-the-url-from-hpricot-element/155343 "2008-12-10T19:56:09Z")

</div>

I want to get a list of URLs from a webpage as follows: First I create the Hpricot element as follows doc = Hpricot(open(searchurl)) links = doc/"//html//body//div\[6\]//div\[2\]//a\[@id=‘p-1’\]" +# Next I want to append t…

---

## [Strange ruby documentation ?!](https://www.ruby-forum.com/t/strange-ruby-documentation/155323)

<div class="topic-metadata">

**Author:** [@chucky](https://www.ruby-forum.com/u/chucky)\
**Replies:** 2\
**Last updated:** [December 10, 2008, 6:42pm UTC](https://www.ruby-forum.com/t/strange-ruby-documentation/155323 "2008-12-10T18:42:48Z")

</div>

Hi, I noticed soon something weird about Object documentation (in fact, one of my colleagues saw it and he asked me what’s the catch): Object class (class Object - RDoc Documentation) have one method called to\_yaml.…

---

## [The Ruport Book completely free after New Years](https://www.ruby-forum.com/t/the-ruport-book-completely-free-after-new-years/155330)

<div class="topic-metadata">

**Author:** [@naething](https://www.ruby-forum.com/u/naething)\
**Replies:** 0\
**Last updated:** [December 10, 2008, 5:56pm UTC](https://www.ruby-forum.com/t/the-ruport-book-completely-free-after-new-years/155330 "2008-12-10T17:56:16Z")

</div>

Hi folks, It’s no secret that self-publishing a book and putting it under a creative commons license while providing an HTML version for free, and not marketing the paid version to anyone and giving 25% of your reven…

---

## [Compare 2 text files - check for difference - Please help](https://www.ruby-forum.com/t/compare-2-text-files-check-for-difference-please-help/155239)

<div class="topic-metadata">

**Author:** [@mmcolli00](https://www.ruby-forum.com/u/mmcolli00)\
**Replies:** 11\
**Last updated:** [December 10, 2008, 5:53pm UTC](https://www.ruby-forum.com/t/compare-2-text-files-check-for-difference-please-help/155239 "2008-12-10T17:53:05Z")

</div>

Hi. I want to take two files that are supposed to be identical, then ook for any difference in the two. Text1.txt Text2.txt aaaaaa aaaaab For example, the above text files comparison would return that ‘b’ was …

---

## [\[Bug #846\] thread.c:2981: warning: format not a string literal and no format arguments](https://www.ruby-forum.com/t/bug-846-thread-c-warning-format-not-a-string-literal-and-no-format-arguments/155305)

<div class="topic-metadata">

**Author:** [@Kazuhiro\_NISHIYAMA](https://www.ruby-forum.com/u/Kazuhiro_NISHIYAMA)\
**Replies:** 1\
**Last updated:** [December 10, 2008, 5:38pm UTC](https://www.ruby-forum.com/t/bug-846-thread-c-warning-format-not-a-string-literal-and-no-format-arguments/155305 "2008-12-10T17:38:05Z")

</div>

Bug #846: thread.c:2981: warning: format not a string literal and no format arguments http://redmine.ruby-lang.org/issues/show/846 e$B5/I\<\<Te(B: Kazuhiro NISHIYAMA e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Low http://ww…

---

## [Want only the working hours(9am-5pm) between two dates](https://www.ruby-forum.com/t/want-only-the-working-hours-9am-5pm-between-two-dates/155309)

<div class="topic-metadata">

**Author:** [@srikanth\_j](https://www.ruby-forum.com/u/srikanth_j)\
**Replies:** 5\
**Last updated:** [December 10, 2008, 5:11pm UTC](https://www.ruby-forum.com/t/want-only-the-working-hours-9am-5pm-between-two-dates/155309 "2008-12-10T17:11:03Z")

</div>

want only the working hours(9am-5pm) between two dates, weekends should be omitted… i did this code… require ‘time’ require ‘date’ class Date def calc(date1,date2) d1=Time.parse(date1).strftime('%d').to\_i m1=Time.…

---

## [\[Bug #845\] warning: "RUBY\_VERSION\_CODE" is not defined](https://www.ruby-forum.com/t/bug-845-warning-ruby-version-code-is-not-defined/155302)

<div class="topic-metadata">

**Author:** [@Kazuhiro\_NISHIYAMA](https://www.ruby-forum.com/u/Kazuhiro_NISHIYAMA)\
**Replies:** 1\
**Last updated:** [December 10, 2008, 4:15pm UTC](https://www.ruby-forum.com/t/bug-845-warning-ruby-version-code-is-not-defined/155302 "2008-12-10T16:15:05Z")

</div>

Bug #845: warning: “RUBY\_VERSION\_CODE” is not defined http://redmine.ruby-lang.org/issues/show/845 e$B5/I\<\<Te(B: Kazuhiro NISHIYAMA e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal rational.ce$B$He(Bcomplex.ce$B$Ge(Bwarn…

---

## [Getting by without a server](https://www.ruby-forum.com/t/getting-by-without-a-server/155204)

<div class="topic-metadata">

**Author:** [@scudco](https://www.ruby-forum.com/u/scudco)\
**Replies:** 4\
**Last updated:** [December 10, 2008, 4:03pm UTC](https://www.ruby-forum.com/t/getting-by-without-a-server/155204 "2008-12-10T16:03:54Z")

</div>

ive made a simple budgeting script that takes receipts (with the generous help of this community) and one thing i want to add to it is the ability to be able to record receipts as they are made i.e. straight after pay…

---

## [Deploy class-files of a RoR-Application in a .war File](https://www.ruby-forum.com/t/deploy-class-files-of-a-ror-application-in-a-war-file/154965)

<div class="topic-metadata">

**Author:** [@cneuhaus](https://www.ruby-forum.com/u/cneuhaus)\
**Replies:** 7\
**Last updated:** [December 10, 2008, 3:10pm UTC](https://www.ruby-forum.com/t/deploy-class-files-of-a-ror-application-in-a-war-file/154965 "2008-12-10T15:10:56Z")

</div>

\-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I’d like to package a RoR app using warble in such a way that the main part of the application is being precompiled into Java bytecode using jrubyc. What I currently…

---

## [Ruby Test Frameworks](https://www.ruby-forum.com/t/ruby-test-frameworks/155224)

<div class="topic-metadata">

**Author:** [@mifi](https://www.ruby-forum.com/u/mifi)\
**Replies:** 5\
**Last updated:** [December 10, 2008, 1:08pm UTC](https://www.ruby-forum.com/t/ruby-test-frameworks/155224 "2008-12-10T13:08:36Z")

</div>

I’m looking for a Ruby Framework that I can use to aid in testing a filter driver, we currently use a Perl based set of scripts that has some wrapping and does system events for files, directories and registry change…

---

## [Need only time](https://www.ruby-forum.com/t/need-only-time/155297)

<div class="topic-metadata">

**Author:** [@shanmu](https://www.ruby-forum.com/u/shanmu)\
**Replies:** 2\
**Last updated:** [December 10, 2008, 12:21pm UTC](https://www.ruby-forum.com/t/need-only-time/155297 "2008-12-10T12:21:39Z")

</div>

hi all, how to get time alone from this format (1986, 1, 28, 17, 39, 18)

---

## [UnicodeUtils 0.5.0 - case conversion, normalization and more](https://www.ruby-forum.com/t/unicodeutils-0-5-0-case-conversion-normalization-and-more/155090)

<div class="topic-metadata">

**Author:** [@stefanl38](https://www.ruby-forum.com/u/stefanl38)\
**Replies:** 1\
**Last updated:** [December 10, 2008, 12:10pm UTC](https://www.ruby-forum.com/t/unicodeutils-0-5-0-case-conversion-normalization-and-more/155090 "2008-12-10T12:10:30Z")

</div>

UnicodeUtils is a pure Ruby library that implements Unicode algorithms for Ruby 1.9. Install with RubyGems: $ gem install unicode\_utils Example code: require “unicode\_utils” UnicodeUtils.upcase(“i”, :tr) =\> “Ä°” U…

---

## [Want to search value in nested arrays and return other value](https://www.ruby-forum.com/t/want-to-search-value-in-nested-arrays-and-return-other-value/155269)

<div class="topic-metadata">

**Author:** [@yankees26](https://www.ruby-forum.com/u/yankees26)\
**Replies:** 4\
**Last updated:** [December 10, 2008, 11:48am UTC](https://www.ruby-forum.com/t/want-to-search-value-in-nested-arrays-and-return-other-value/155269 "2008-12-10T11:48:28Z")

</div>

Hi. I have following problem: VALUES = \[\[‘value 1’, 1\], \[‘value 2’, 2\], \[‘value 3’, 3\]\] I need a function that returns ‘value 1’ if I call the function with parameter 1. I tried this: def value\_name(value) VALUES.…

---

## [Rb\_thread\_critical in 1.9.1](https://www.ruby-forum.com/t/rb-thread-critical-in-1-9-1/155213)

<div class="topic-metadata">

**Author:** [@Kouhei\_S](https://www.ruby-forum.com/u/Kouhei_S)\
**Replies:** 2\
**Last updated:** [December 10, 2008, 11:35am UTC](https://www.ruby-forum.com/t/rb-thread-critical-in-1-9-1/155213 "2008-12-10T11:35:40Z")

</div>

e$B?\\F#$G$9!#e(B Ruby/GLibe$B$Ge(Brb\_thread\_criticale$B$r;H$C$F$$$k$N$G$9$,!“e(B rb\_thread\_criticale$B$,e(B1.9.1e$B$G$O$J$/$J$C$F$$$k$?$a!”%S%k%I$G$-e(B e$B$J$$\>uBV$K$J$C$F$$$^$9!#e(B 1.9.1e$B$G$bF0$/$h$&$K$7$?$$$N$G…

---

## [Netbeans ruby book is done](https://www.ruby-forum.com/t/netbeans-ruby-book-is-done/155268)

<div class="topic-metadata">

**Author:** [@khaled.habache](https://www.ruby-forum.com/u/khaled.habache)\
**Replies:** 2\
**Last updated:** [December 10, 2008, 10:51am UTC](https://www.ruby-forum.com/t/netbeans-ruby-book-is-done/155268 "2008-12-10T10:51:27Z")

</div>

http://www.dzone.com/links/rss/our\_netbeans\_ruby\_book\_is\_done.html

---

## [Undefined method \`parse' for Time:Class Error](https://www.ruby-forum.com/t/undefined-method-parse-for-time-class-error/155207)

<div class="topic-metadata">

**Author:** [@srikanth\_j](https://www.ruby-forum.com/u/srikanth_j)\
**Replies:** 9\
**Last updated:** [December 10, 2008, 10:30am UTC](https://www.ruby-forum.com/t/undefined-method-parse-for-time-class-error/155207 "2008-12-10T10:30:56Z")

</div>

hi,. i used this code … Time.parse(“October 20th, 2008, 7:48 pm”) got this error… NoMethodError: undefined method \`parse’ for Time:Class can any one help , how to install the parse method??? I’m using ruby version…

---

## [Way to many calls to Dir#\[\]](https://www.ruby-forum.com/t/way-to-many-calls-to-dir/155240)

<div class="topic-metadata">

**Author:** [@tjholowaychuk](https://www.ruby-forum.com/u/tjholowaychuk)\
**Replies:** 9\
**Last updated:** [December 10, 2008, 10:11am UTC](https://www.ruby-forum.com/t/way-to-many-calls-to-dir/155240 "2008-12-10T10:11:17Z")

</div>

I cannot seem to debug this issue… my entire library does not call Dir#\[\] a single time, however when I used ruby-prof I get: 17.26 0.14 0.14 0.00 0.00 594 Class::Dir#\[\] unnecessarily slowing th…

---

## [Open.popen3(cmd) generates always Error::PIPE](https://www.ruby-forum.com/t/open-popen3-cmd-generates-always-error-pipe/155291)

<div class="topic-metadata">

**Author:** [@Jun\_YSKim](https://www.ruby-forum.com/u/Jun_YSKim)\
**Replies:** 0\
**Last updated:** [December 10, 2008, 9:51am UTC](https://www.ruby-forum.com/t/open-popen3-cmd-generates-always-error-pipe/155291 "2008-12-10T09:51:41Z")

</div>

Hi, The below example code shows all thing I have. cmd = ‘my\_command options’ begin Open.popen3(cmd) do | stdin, stdout, stderr| while line = stdout.gets $stdout.write(line) end end rescue =\> e STDERR.puts(e) …

---

## [How can I use Trapping signals in Windows?](https://www.ruby-forum.com/t/how-can-i-use-trapping-signals-in-windows/155289)

<div class="topic-metadata">

**Author:** [@Jarod\_Z](https://www.ruby-forum.com/u/Jarod_Z)\
**Replies:** 0\
**Last updated:** [December 10, 2008, 9:41am UTC](https://www.ruby-forum.com/t/how-can-i-use-trapping-signals-in-windows/155289 "2008-12-10T09:41:08Z")

</div>

Hi, all I am using ruby 1.8.6-26 in Windows and I want to trapping siganls in a process, like Deamon Process: loop do Signal.trap(“USR1”) do puts “catch signal” do some work… end sleep 1 end But when runni…

---

## [Pop3 body email](https://www.ruby-forum.com/t/pop3-body-email/155200)

<div class="topic-metadata">

**Author:** [@erika](https://www.ruby-forum.com/u/erika)\
**Replies:** 4\
**Last updated:** [December 10, 2008, 9:22am UTC](https://www.ruby-forum.com/t/pop3-body-email/155200 "2008-12-10T09:22:23Z")

</div>

Hi, I have to check the body of the email which is a html code, like the following: Text1: Text2 I have to check that for “Text1” what “Text2” is shown, which can vary for different reasons. I managed to get the e…

---

## [Need only the tags which are at the first level](https://www.ruby-forum.com/t/need-only-the-tags-which-are-at-the-first-level/154749)

<div class="topic-metadata">

**Author:** [@shanmu](https://www.ruby-forum.com/u/shanmu)\
**Replies:** 3\
**Last updated:** [December 10, 2008, 7:05am UTC](https://www.ruby-forum.com/t/need-only-the-tags-which-are-at-the-first-level/154749 "2008-12-10T07:05:30Z")

</div>

require ‘rubygems’ require ‘hpricot’ elements = Hpricot(" ...stuff I don't want... ------------rows i want Field 0 …

---

## [How to find whether a day, is weekend](https://www.ruby-forum.com/t/how-to-find-whether-a-day-is-weekend/155282)

<div class="topic-metadata">

**Author:** [@srikanth\_j](https://www.ruby-forum.com/u/srikanth_j)\
**Replies:** 3\
**Last updated:** [December 10, 2008, 6:20am UTC](https://www.ruby-forum.com/t/how-to-find-whether-a-day-is-weekend/155282 "2008-12-10T06:20:42Z")

</div>

hi, can any one give me the idea., how to find whether a given date is a weekend, that is saturday or sunday. is there any inbuilt methods or we have to write the code. Thanks… Regards, Srikanth J

---

## [Code Review: MoreSites4](https://www.ruby-forum.com/t/code-review-moresites4/155276)

<div class="topic-metadata">

**Author:** [@grujildo](https://www.ruby-forum.com/u/grujildo)\
**Replies:** 2\
**Last updated:** [December 10, 2008, 4:14am UTC](https://www.ruby-forum.com/t/code-review-moresites4/155276 "2008-12-10T04:14:06Z")

</div>

tfpt review “/shelveset:MoreSites4;REDMOND\\tomat” DLR change: Inherits SiteLocalStorage from SiteLocalStorage class and enables any subclass of SiteLocalStorage to be created as a storage for data in a rule. Ruby: …

---

## [\[Bug #751\] Regexp.new(dummy\_encoding\_string)](https://www.ruby-forum.com/t/bug-751-regexp-new-dummy-encoding-string/153201)

<div class="topic-metadata">

**Author:** [@Kazuhiro\_NISHIYAMA](https://www.ruby-forum.com/u/Kazuhiro_NISHIYAMA)\
**Replies:** 2\
**Last updated:** [December 10, 2008, 3:37am UTC](https://www.ruby-forum.com/t/bug-751-regexp-new-dummy-encoding-string/153201 "2008-12-10T03:37:48Z")

</div>

Bug #751: Regexp.new(dummy\_encoding\_string) http://redmine.ruby-lang.org/issues/show/751 e$B5/I\<\<Te(B: Kazuhiro NISHIYAMA e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal http://mono.kmc.gr.jp/~yhara/d/?date=20081101#p03 …

---

## [Scraping 3rd element with hpricot](https://www.ruby-forum.com/t/scraping-3rd-element-with-hpricot/155251)

<div class="topic-metadata">

**Author:** [@scorintha](https://www.ruby-forum.com/u/scorintha)\
**Replies:** 2\
**Last updated:** [December 10, 2008, 2:44am UTC](https://www.ruby-forum.com/t/scraping-3rd-element-with-hpricot/155251 "2008-12-10T02:44:08Z")

</div>

I don’t know why I’m struggling with this (not a Ruby expert) but using the standard scraping example: doc = Hpricot(@response) puts (doc/"#{xpath}").first.inner\_html puts (doc/"#{xpath}").last.inner\_html What could…

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

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