# Ruby

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

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

---

## ["rescue Postgres::PGError" not working](https://www.ruby-forum.com/t/rescue-postgres-pgerror-not-working/153605)

<div class="topic-metadata">

**Author:** [@mandeepbaruah](https://www.ruby-forum.com/u/mandeepbaruah)\
**Replies:** 4\
**Last updated:** [November 19, 2008, 3:40pm UTC](https://www.ruby-forum.com/t/rescue-postgres-pgerror-not-working/153605 "2008-11-19T15:40:11Z")

</div>

I am trying to rescue exceptions from a PostgreSQL query (see bellow code) begin res = @pgconn.exec(querystring) # some query rescue Postgres::PGError =\> e puts “Error code: #{e.err}” puts “Error message: #{e.errstr…

---

## [Idiomatic status check](https://www.ruby-forum.com/t/idiomatic-status-check/153618)

<div class="topic-metadata">

**Author:** [@enduro](https://www.ruby-forum.com/u/enduro)\
**Replies:** 1\
**Last updated:** [November 19, 2008, 3:35pm UTC](https://www.ruby-forum.com/t/idiomatic-status-check/153618 "2008-11-19T15:35:05Z")

</div>

Hi, how would idiomatic Ruby look like when it comes to status checks of processes? Here’s a short method which checks if a PostgreSQL cluster is up: def running? output = /etc/init.d/postgresql-8.3 status.split ou…

---

## [Ruby global regex question](https://www.ruby-forum.com/t/ruby-global-regex-question/153582)

<div class="topic-metadata">

**Author:** [@knohr](https://www.ruby-forum.com/u/knohr)\
**Replies:** 6\
**Last updated:** [November 19, 2008, 1:57pm UTC](https://www.ruby-forum.com/t/ruby-global-regex-question/153582 "2008-11-19T13:57:39Z")

</div>

For the life of me, i can’t figure out a ruby equivalent to perl’s /g basically, i want to do the following while htmlSource=~m/ (.\*?)\<\\table\>/g do tableSource=$1 tableSource=~m/Index (\\d+)/ indexNumber=$1 while tab…

---

## [Run a method in a Module](https://www.ruby-forum.com/t/run-a-method-in-a-module/153612)

<div class="topic-metadata">

**Author:** [@tcblues](https://www.ruby-forum.com/u/tcblues)\
**Replies:** 5\
**Last updated:** [November 19, 2008, 12:41pm UTC](https://www.ruby-forum.com/t/run-a-method-in-a-module/153612 "2008-11-19T12:41:51Z")

</div>

Hi, I have two different modules that contain a few methods with the same name so I cannot include the modules in the code and I need to do something like: module Module1 def myMethod puts “hi” end def others en…

---

## [Is there a way to know what are the subclasses of a given class?](https://www.ruby-forum.com/t/is-there-a-way-to-know-what-are-the-subclasses-of-a-given-class/153603)

<div class="topic-metadata">

**Author:** [@sandro\_p](https://www.ruby-forum.com/u/sandro_p)\
**Replies:** 7\
**Last updated:** [November 19, 2008, 11:40am UTC](https://www.ruby-forum.com/t/is-there-a-way-to-know-what-are-the-subclasses-of-a-given-class/153603 "2008-11-19T11:40:45Z")

</div>

Hello Do you know if there’s a trick to retrieve a list of all the subclasses of a given class ? class A class B end class C end end like A.subclasses --\> \[B,C\] ? Thanks Sandro

---

## [Lazy requires](https://www.ruby-forum.com/t/lazy-requires/153451)

<div class="topic-metadata">

**Author:** [@aidy](https://www.ruby-forum.com/u/aidy)\
**Replies:** 4\
**Last updated:** [November 19, 2008, 11:39am UTC](https://www.ruby-forum.com/t/lazy-requires/153451 "2008-11-19T11:39:20Z")

</div>

Hi, Are lazy requires generally a good idea def require\_files(path) dir = File.dirname(FILE) Dir\[File.expand\_path("#{dir}/#{path}")\].uniq.each do |file| require file end end ? Thanks Aidy

---

## [Subclassing Hash to enforce value uniqueness ala key uniqueness](https://www.ruby-forum.com/t/subclassing-hash-to-enforce-value-uniqueness-ala-key-uniqueness/153507)

<div class="topic-metadata">

**Author:** [@addywaddy](https://www.ruby-forum.com/u/addywaddy)\
**Replies:** 5\
**Last updated:** [November 19, 2008, 8:40am UTC](https://www.ruby-forum.com/t/subclassing-hash-to-enforce-value-uniqueness-ala-key-uniqueness/153507 "2008-11-19T08:40:10Z")

</div>

First of all, hello to everyone. This is my first message to this list. I find myself needing something very much like a Hash, but with unique one-to-one mapping in both directions, both key-to-value, and value-to-key…

---

## [AgDLR: Silverlight + DLR + Open Source](https://www.ruby-forum.com/t/agdlr-silverlight-dlr-open-source/153581)

<div class="topic-metadata">

**Author:** [@jsoho](https://www.ruby-forum.com/u/jsoho)\
**Replies:** 4\
**Last updated:** [November 19, 2008, 7:55am UTC](https://www.ruby-forum.com/t/agdlr-silverlight-dlr-open-source/153581 "2008-11-19T07:55:06Z")

</div>

IronRubites and IronPythonics, First and foremost, I want to thank anyone who has used the bits on http://codeplex.com/sdlsdk, and accepting my bullshit version of open-source. While getting monthly binaries/sources i…

---

## [Simple way to duplicate vba's InputBox, Msgbox?](https://www.ruby-forum.com/t/simple-way-to-duplicate-vbas-inputbox-msgbox/153566)

<div class="topic-metadata">

**Author:** [@phil](https://www.ruby-forum.com/u/phil)\
**Replies:** 4\
**Last updated:** [November 19, 2008, 7:20am UTC](https://www.ruby-forum.com/t/simple-way-to-duplicate-vbas-inputbox-msgbox/153566 "2008-11-19T07:20:36Z")

</div>

I’ve always used VBScript to write the simple scripts I occasionally need. But now that I’ve learned a tiny bit of ruby, I don’t want to use vbscript anymore! Unfortunately for me, ruby has nothing like InputBox() and…

---

## [Shoes and double buffering](https://www.ruby-forum.com/t/shoes-and-double-buffering/153587)

<div class="topic-metadata">

**Author:** [@pierre](https://www.ruby-forum.com/u/pierre)\
**Replies:** 0\
**Last updated:** [November 19, 2008, 3:12am UTC](https://www.ruby-forum.com/t/shoes-and-double-buffering/153587 "2008-11-19T03:12:36Z")

</div>

Hey, I’m starting to have a look at the Shoes library for some GUI stuff, and possibly some kind of small games. I’ve looked around, and I haven’t seen anywhere talking about double buffering techniques in Shoes. Ha…

---

## [JRuby 1.1.5 FFI attach\_method arg order](https://www.ruby-forum.com/t/jruby-1-1-5-ffi-attach-method-arg-order/153469)

<div class="topic-metadata">

**Author:** [@ratchetcat](https://www.ruby-forum.com/u/ratchetcat)\
**Replies:** 2\
**Last updated:** [November 19, 2008, 1:17am UTC](https://www.ruby-forum.com/t/jruby-1-1-5-ffi-attach-method-arg-order/153469 "2008-11-19T01:17:24Z")

</div>

Just starting to play with FFI on my Win32 box…after reading a few of the blog posts mentioned in Charlie’s http://blog.headius.com/2008/10/ffi-for-ruby-now-available.html post I’m seeing that the arg order to attach\_…

---

## [R169 problem](https://www.ruby-forum.com/t/r169-problem/152542)

<div class="topic-metadata">

**Author:** [@diabolist](https://www.ruby-forum.com/u/diabolist)\
**Replies:** 3\
**Last updated:** [November 19, 2008, 12:42am UTC](https://www.ruby-forum.com/t/r169-problem/152542 "2008-11-19T00:42:17Z")

</div>

Hi, After trying out 169, all my previously passing tests are now failing with: failed: System.InvalidCastException : Unable to cast object of type ‘IronRuby.Runtime.RubyTopLevelScope’ to type ‘IronRuby.Runtime.Ruby…

---

## [SVN Revision 173](https://www.ruby-forum.com/t/svn-revision-173/153579)

<div class="topic-metadata">

**Author:** [@raker\_t](https://www.ruby-forum.com/u/raker_t)\
**Replies:** 0\
**Last updated:** [November 19, 2008, 12:31am UTC](https://www.ruby-forum.com/t/svn-revision-173/153579 "2008-11-19T00:31:46Z")

</div>

I just pushed out another revision to SVN. Enjoy! JD http://blog.jredville.com

---

## [Avoiding / handling a method\_missing call](https://www.ruby-forum.com/t/avoiding-handling-a-method-missing-call/153575)

<div class="topic-metadata">

**Author:** [@trevoke](https://www.ruby-forum.com/u/trevoke)\
**Replies:** 2\
**Last updated:** [November 18, 2008, 11:51pm UTC](https://www.ruby-forum.com/t/avoiding-handling-a-method-missing-call/153575 "2008-11-18T23:51:05Z")

</div>

I’m trying to retrieve some data from Active Directory (operatingsystem and operatingsystemservicepack). It so occurs that -sometimes- that data is nonexistent (Linux box, maybe)… I don’t know how to catch that error …

---

## [Let my custom defined class convert to string?](https://www.ruby-forum.com/t/let-my-custom-defined-class-convert-to-string/153501)

<div class="topic-metadata">

**Author:** [@jrochkind](https://www.ruby-forum.com/u/jrochkind)\
**Replies:** 5\
**Last updated:** [November 18, 2008, 10:17pm UTC](https://www.ruby-forum.com/t/let-my-custom-defined-class-convert-to-string/153501 "2008-11-18T22:17:59Z")

</div>

Is there any way I can make it so my custom-defined class can be automatically converted to a string? I have a #to\_s method in it. So it works when I do something like “#{var\_of\_my\_class} foo”. It calls #to\_s there. …

---

## [.jruby/ directory and privileges](https://www.ruby-forum.com/t/jruby-directory-and-privileges/153282)

<div class="topic-metadata">

**Author:** [@etikette](https://www.ruby-forum.com/u/etikette)\
**Replies:** 1\
**Last updated:** [November 18, 2008, 9:41pm UTC](https://www.ruby-forum.com/t/jruby-directory-and-privileges/153282 "2008-11-18T21:41:42Z")

</div>

Hey, We’re integrating jruby into our webapplication and happened to come across a little deployment problem. The webapplication is running in an very restricted environment. The problem we’re facing is that jruby wa…

---

## [Logging level](https://www.ruby-forum.com/t/logging-level/153568)

<div class="topic-metadata">

**Author:** [@mrkohrea](https://www.ruby-forum.com/u/mrkohrea)\
**Replies:** 0\
**Last updated:** [November 18, 2008, 9:36pm UTC](https://www.ruby-forum.com/t/logging-level/153568 "2008-11-18T21:36:58Z")

</div>

Hi folks…I’m currently experiencing the fallout from bug 2992(soap4r certificate crap). While my app isn’t actually breaking, it is logging quite a bit. Is there any way to reduce the logging level so this stuff isn…

---

## [Code Review: MiscFixesA2](https://www.ruby-forum.com/t/code-review-miscfixesa2/153560)

<div class="topic-metadata">

**Author:** [@grujildo](https://www.ruby-forum.com/u/grujildo)\
**Replies:** 1\
**Last updated:** [November 18, 2008, 7:48pm UTC](https://www.ruby-forum.com/t/code-review-miscfixesa2/153560 "2008-11-18T19:48:29Z")

</div>

tfpt review “/shelveset:MiscFixesA2;REDMOND\\tomat” Misc small fixes: Throws an exception when IronRuby.Libraries.dll is not present. Currently it ends up with stack overflow because method\_missing calls to\_s met…

---

## [Test/webrick/test\_server.rb doesn't finish](https://www.ruby-forum.com/t/test-webrick-test-server-rb-doesnt-finish/153547)

<div class="topic-metadata">

**Author:** [@shinichiro.h](https://www.ruby-forum.com/u/shinichiro.h)\
**Replies:** 4\
**Last updated:** [November 18, 2008, 7:36pm UTC](https://www.ruby-forum.com/t/test-webrick-test-server-rb-doesnt-finish/153547 "2008-11-18T19:36:44Z")

</div>

e$BIMCO$H$$$$$^$9!#e(B TestWEBrickServer#test\_daemon e$B$,e(B 2/3 e$B$/$i$$$N3NN($G=\*$o$j$^$;$s!#e(B e$B4D6-$Oe(B 2.6.18-6-xen-vserver-amd64 x86\_64 GNU/Linux e$B$G!"e(B Ruby 1.9 e$B$Ne(B r20252 e$B$G3NG’$7$^$7$?!#e(B …

---

## [Test/rinda/test\_rinda.rb fails occasionally](https://www.ruby-forum.com/t/test-rinda-test-rinda-rb-fails-occasionally/153554)

<div class="topic-metadata">

**Author:** [@shinichiro.h](https://www.ruby-forum.com/u/shinichiro.h)\
**Replies:** 1\
**Last updated:** [November 18, 2008, 7:11pm UTC](https://www.ruby-forum.com/t/test-rinda-test-rinda-rb-fails-occasionally/153554 "2008-11-18T19:11:31Z")

</div>

e$BIMCO$G$9!#e(B e$B$J$s$+BN46$Ge(B 1/5 e$B$/$i$$$N3NN($Ge(B test\_rinda.rb e$B$,e(B Failure: test\_core\_03\_notify(Rinda::TupleSpaceTest) \[/home/i/src/ruby\_orig/test/rinda/test\_rinda.rb:396\]: \<\[0, 3\]\> expected but wa…

---

## [\[Feature:1.9\] speed up continuation in 1.9](https://www.ruby-forum.com/t/feature-1-9-speed-up-continuation-in-1-9/153465)

<div class="topic-metadata">

**Author:** [@Yusuke\_ENDOH](https://www.ruby-forum.com/u/Yusuke_ENDOH)\
**Replies:** 2\
**Last updated:** [November 18, 2008, 5:28pm UTC](https://www.ruby-forum.com/t/feature-1-9-speed-up-continuation-in-1-9/153465 "2008-11-18T17:28:00Z")

</div>

e$B1sF#$G$9!#e(B 1.9 e$B$N7QB3$Oe(B 1.8 e$B$KHf$Y$F6KC\<$KCY$$$h$&$G$9!#e(B $ time ruby18 -e ‘i = 0; callcc {|c| $c = c }; i += 1; $c.call if i \< 1000000’ real 0m1.060s user 0m1.050s sys 0m0.010s $ time r…

---

## [Ruby session @ P2P Conference in Bulgaria](https://www.ruby-forum.com/t/ruby-session-p2p-conference-in-bulgaria/153546)

<div class="topic-metadata">

**Author:** [@Bogomil\_SBogoSS\_Sho](https://www.ruby-forum.com/u/Bogomil_SBogoSS_Sho)\
**Replies:** 0\
**Last updated:** [November 18, 2008, 4:35pm UTC](https://www.ruby-forum.com/t/ruby-session-p2p-conference-in-bulgaria/153546 "2008-11-18T16:35:45Z")

</div>

Hi guys, We are planning Ruby session at our event. If you want to become a speaker, please see this info: http://wtconferences.com/?page\_id=87 Thanks for your time Bogomil Shopov

---

## [Nokogiri 1.0.6 Released](https://www.ruby-forum.com/t/nokogiri-1-0-6-released/153432)

<div class="topic-metadata">

**Author:** [@aaronpowell](https://www.ruby-forum.com/u/aaronpowell)\
**Replies:** 2\
**Last updated:** [November 18, 2008, 4:23pm UTC](https://www.ruby-forum.com/t/nokogiri-1-0-6-released/153432 "2008-11-18T16:23:59Z")

</div>

nokogiri version 1.0.6 has been released! http://nokogiri.rubyforge.org/ http://github.com/tenderlove/nokogiri/wikis http://github.com/tenderlove/nokogiri/tree/master http://rubyforge.org/mailman/listinfo/nokogiri-talk …

---

## [\[Bug #756\] lambda{} != lambda {}](https://www.ruby-forum.com/t/bug-756-lambda-lambda/153382)

<div class="topic-metadata">

**Author:** [@Shyouhei\_U](https://www.ruby-forum.com/u/Shyouhei_U)\
**Replies:** 1\
**Last updated:** [November 18, 2008, 3:37pm UTC](https://www.ruby-forum.com/t/bug-756-lambda-lambda/153382 "2008-11-18T15:37:34Z")

</div>

Bug #756: lambda{} != lambda {} http://redmine.ruby-lang.org/issues/show/756 e$B5/I\<\<Te(B: Shyouhei U. e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal e$BC4Ev\<Te(B: Koichi Sasada, e$B%+%F%4%je(B: core, Target version: 1…

---

## [New Blog: Merb Scaffold using JRuby/GlassFish](https://www.ruby-forum.com/t/new-blog-merb-scaffold-using-jruby-glassfish/153541)

<div class="topic-metadata">

**Author:** [@arung](https://www.ruby-forum.com/u/arung)\
**Replies:** 0\
**Last updated:** [November 18, 2008, 3:15pm UTC](https://www.ruby-forum.com/t/new-blog-merb-scaffold-using-jruby-glassfish/153541 "2008-11-18T15:15:11Z")

</div>

This blog shows how to create a scaffold in Merb and run it using the GlassFish gem. http://blogs.sun.com/arungupta/entry/totd\_53\_scaffold\_in\_merb It’s not a straight forward and require some plugging some holes but t…

---

## [\[Bug #668\](Closed) BigDecimal#to\_r $B$,$"$j$^$;$s(B](https://www.ruby-forum.com/t/bug-668-closed-bigdecimal-to-r-b-j-s-b/153537)

<div class="topic-metadata">

**Author:** [@Yukihiro\_M](https://www.ruby-forum.com/u/Yukihiro_M)\
**Replies:** 0\
**Last updated:** [November 18, 2008, 2:39pm UTC](https://www.ruby-forum.com/t/bug-668-closed-bigdecimal-to-r-b-j-s-b/153537 "2008-11-18T14:39:53Z")

</div>

e$B%A%1%C%He(B #668 e$B$,99?7$5$l$^$7$?!#e(B (by Yukihiro M.) e$B%9%F!\<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B fixed by r20191 http://redmine.ruby-lang.org/issues/show/668

---

## [ActiveRecord user](https://www.ruby-forum.com/t/activerecord-user/153528)

<div class="topic-metadata">

**Author:** [@angico](https://www.ruby-forum.com/u/angico)\
**Replies:** 9\
**Last updated:** [November 18, 2008, 2:21pm UTC](https://www.ruby-forum.com/t/activerecord-user/153528 "2008-11-18T14:21:38Z")

</div>

Hi, I’m trying to use ActiveRecord with a database specific user, other than root, but it always complains about Mysql::Error: Access denied for user ‘root’@‘localhost’ (using password: YES) Do I always have to conn…

---

## [Ruby1.9 segmentation fault](https://www.ruby-forum.com/t/ruby1-9-segmentation-fault/153277)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 7\
**Last updated:** [November 18, 2008, 1:54pm UTC](https://www.ruby-forum.com/t/ruby1-9-segmentation-fault/153277 "2008-11-18T13:54:00Z")

</div>

e$B$1$$$8$e!w$$$7$D$+$G$9e(B. e$B0J2\<$N$h$&$J%a%C%;!\<%8$r=P$7$F=\*N;$7$F$7$^$&$s$G$9$,e(B… – \[BUG\] Segmentation fault ruby 1.9.0 (2008-11-07 revision 20129) \[i686-linux\] – control frame ---------- c:0001 p:---- s:00…

---

## [Function to select only certain key/value pairs from hash?](https://www.ruby-forum.com/t/function-to-select-only-certain-key-value-pairs-from-hash/153489)

<div class="topic-metadata">

**Author:** [@ericgoodwin](https://www.ruby-forum.com/u/ericgoodwin)\
**Replies:** 13\
**Last updated:** [November 18, 2008, 1:44pm UTC](https://www.ruby-forum.com/t/function-to-select-only-certain-key-value-pairs-from-hash/153489 "2008-11-18T13:44:00Z")

</div>

Whenever Im coding I usually come across having to create a new hash from the key/value pairs of another hash. For example, hash = {:a =\> 1, :b =\> 2, :c =\> 3} I want to do something like this hash.from\_keys(:a,:b) =\>…

---

## [Vayama](https://www.ruby-forum.com/t/vayama/153527)

<div class="topic-metadata">

**Author:** [@palking](https://www.ruby-forum.com/u/palking)\
**Replies:** 0\
**Last updated:** [November 18, 2008, 12:48pm UTC](https://www.ruby-forum.com/t/vayama/153527 "2008-11-18T12:48:17Z")

</div>

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

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