# Ruby

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

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

---

## [This Week in Ruby (May 29, 2008)](https://www.ruby-forum.com/t/this-week-in-ruby-may-29-2008/139072)

<div class="topic-metadata">

**Author:** [@visitor1981](https://www.ruby-forum.com/u/visitor1981)\
**Replies:** 0\
**Last updated:** [May 30, 2008, 4:17pm UTC](https://www.ruby-forum.com/t/this-week-in-ruby-may-29-2008/139072 "2008-05-30T16:17:26Z")

</div>

Hi all, here you can find the 9th edition of “This Week in Ruby”: Cheers, Antonio

---

## [Working with SRV records](https://www.ruby-forum.com/t/working-with-srv-records/138315)

<div class="topic-metadata">

**Author:** [@Darryl\_LSPierce](https://www.ruby-forum.com/u/Darryl_LSPierce)\
**Replies:** 1\
**Last updated:** [May 30, 2008, 4:13pm UTC](https://www.ruby-forum.com/t/working-with-srv-records/138315 "2008-05-30T16:13:43Z")

</div>

On my current project at work I’ve been tasked with integrating LDAP into our user permissions system. A requirement is to determine the LDAP hostname using SRV records with a configured hostname as a fallback. Anybo…

---

## [Rake not working in JRuby 1.1.2](https://www.ruby-forum.com/t/rake-not-working-in-jruby-1-1-2/139066)

<div class="topic-metadata">

**Author:** [@PartogiS\_Joshua](https://www.ruby-forum.com/u/PartogiS_Joshua)\
**Replies:** 1\
**Last updated:** [May 30, 2008, 4:07pm UTC](https://www.ruby-forum.com/t/rake-not-working-in-jruby-1-1-2/139066 "2008-05-30T16:07:06Z")

</div>

Dear all, When I execute this command “jruby -S rake db:migrate” using JRuby 1.1.2 it throws errors. Did anyone else experience the same problem as I did? Is there any workaround for this? Thanks in advance, IMPORT…

---

## [How do you convert a hexadecimal number to a binary number?](https://www.ruby-forum.com/t/how-do-you-convert-a-hexadecimal-number-to-a-binary-number/139046)

<div class="topic-metadata">

**Author:** [@adistarmid](https://www.ruby-forum.com/u/adistarmid)\
**Replies:** 5\
**Last updated:** [May 30, 2008, 3:53pm UTC](https://www.ruby-forum.com/t/how-do-you-convert-a-hexadecimal-number-to-a-binary-number/139046 "2008-05-30T15:53:22Z")

</div>

I can’t find a clue how to convert a hexadecimal number to a binary number. Anyone know?

---

## [JRuby on Rails](https://www.ruby-forum.com/t/jruby-on-rails/139048)

<div class="topic-metadata">

**Author:** [@PartogiS\_Joshua](https://www.ruby-forum.com/u/PartogiS_Joshua)\
**Replies:** 1\
**Last updated:** [May 30, 2008, 3:46pm UTC](https://www.ruby-forum.com/t/jruby-on-rails/139048 "2008-05-30T15:46:16Z")

</div>

Dear all, I have create a small tutorial on how to get running with JRuby on Rails: Please help me whether I have missed on something. Thank you IMPORTANT NOTICE: The information in this email (and any attachments…

---

## [Ruby 1.9 migration problem on Windows](https://www.ruby-forum.com/t/ruby-1-9-migration-problem-on-windows/139051)

<div class="topic-metadata">

**Author:** [@awarberg](https://www.ruby-forum.com/u/awarberg)\
**Replies:** 0\
**Last updated:** [May 30, 2008, 1:54pm UTC](https://www.ruby-forum.com/t/ruby-1-9-migration-problem-on-windows/139051 "2008-05-30T13:54:24Z")

</div>

Hi, I have an application, which currently runs under ruby 1.8.6. I want to adopt the new interpreter to get the syntax improvements and speed. I downloaded the ruby 1.9 zip-archive and unpacked to c:\\ruby1.9. Then I …

---

## [7 Ruby Programming ebook](https://www.ruby-forum.com/t/7-ruby-programming-ebook/139036)

<div class="topic-metadata">

**Author:** [@Vassilis\_R](https://www.ruby-forum.com/u/Vassilis_R)\
**Replies:** 0\
**Last updated:** [May 30, 2008, 10:03am UTC](https://www.ruby-forum.com/t/7-ruby-programming-ebook/139036 "2008-05-30T10:03:19Z")

</div>

Michael T. Richter wrote: But really, copyright is off-topic I would suspect. We should probably continue this discussion off-list. Yes it is, but I can’t resist the temptation anymore. You can draw a parallel with…

---

## [Quickie: Monkey patching Array](https://www.ruby-forum.com/t/quickie-monkey-patching-array/139020)

<div class="topic-metadata">

**Author:** [@leonb](https://www.ruby-forum.com/u/leonb)\
**Replies:** 8\
**Last updated:** [May 30, 2008, 9:50am UTC](https://www.ruby-forum.com/t/quickie-monkey-patching-array/139020 "2008-05-30T09:50:11Z")

</div>

Hi all, A quick question: is it possible to monkey patch the Array \[\] method in ruby? I tried: class Array def \[\]=(elem) raise ‘Yesss… It works!’ end end But that didn’t work. I tried patching the Kernel module …

---

## [\[ANN\] Gerbil 2.1.0](https://www.ruby-forum.com/t/ann-gerbil-2-1-0/139031)

<div class="topic-metadata">

**Author:** [@snk](https://www.ruby-forum.com/u/snk)\
**Replies:** 0\
**Last updated:** [May 30, 2008, 7:17am UTC](https://www.ruby-forum.com/t/ann-gerbil-2-1-0/139031 "2008-05-30T07:17:03Z")

</div>

Gerbil Gerbil is an extensible document generator based on eRuby that outputs to any format you want: plain text, HTML, LaTeX, UNIX man page, your own custom format, and so on. http://gerb…

---

## [Overriding jirb 'help'](https://www.ruby-forum.com/t/overriding-jirb-help/139030)

<div class="topic-metadata">

**Author:** [@stack](https://www.ruby-forum.com/u/stack)\
**Replies:** 0\
**Last updated:** [May 30, 2008, 7:05am UTC](https://www.ruby-forum.com/t/overriding-jirb-help/139030 "2008-05-30T07:05:56Z")

</div>

Hello All: I’m trying to add jruby as the shell for our application. I’d like to make it so that on initial presentation of the shell, noobies can do at least do some basic operations without having to know or type a…

---

## [Error loading cookbook sample on Rack](https://www.ruby-forum.com/t/error-loading-cookbook-sample-on-rack/139018)

<div class="topic-metadata">

**Author:** [@Vivek\_P](https://www.ruby-forum.com/u/Vivek_P)\
**Replies:** 2\
**Last updated:** [May 30, 2008, 12:25am UTC](https://www.ruby-forum.com/t/error-loading-cookbook-sample-on-rack/139018 "2008-05-30T00:25:04Z")

</div>

Hi, I am trying to dpeloy a WAR file created using warbler 0.9.9 (with Rack) and deploy it on GlassFish. The application comes up fine but in the server log error message is logged saying it can not find certain fil…

---

## [Instance method adding another instance method to the class](https://www.ruby-forum.com/t/instance-method-adding-another-instance-method-to-the-class/139003)

<div class="topic-metadata">

**Author:** [@dorelal](https://www.ruby-forum.com/u/dorelal)\
**Replies:** 2\
**Last updated:** [May 30, 2008, 12:10am UTC](https://www.ruby-forum.com/t/instance-method-adding-another-instance-method-to-the-class/139003 "2008-05-30T00:10:25Z")

</div>

class Person end p = Person.new def p.something def speaks puts ‘i speak’ end end p.something Person.new.speaks I am trying to understand why the last line is working. When p.something is executed then the sel…

---

## [ShellExecute and Win32OLE callback](https://www.ruby-forum.com/t/shellexecute-and-win32ole-callback/138990)

<div class="topic-metadata">

**Author:** [@creativelogic](https://www.ruby-forum.com/u/creativelogic)\
**Replies:** 2\
**Last updated:** [May 29, 2008, 11:58pm UTC](https://www.ruby-forum.com/t/shellexecute-and-win32ole-callback/138990 "2008-05-29T23:58:49Z")

</div>

Hi everybody, I’m trying to add a callback to a ShellExecute call. (Or at least get some way to find out when it finishes running.) I’m not having any luck with WIN32OLE\_EVENT, and all the examples I can find use Inte…

---

## [Error loading cookbook sample on Rack](https://www.ruby-forum.com/t/error-loading-cookbook-sample-on-rack/196694)

<div class="topic-metadata">

**Author:** [@Vivek\_P](https://www.ruby-forum.com/u/Vivek_P)\
**Replies:** 0\
**Last updated:** [May 29, 2008, 11:56pm UTC](https://www.ruby-forum.com/t/error-loading-cookbook-sample-on-rack/196694 "2008-05-29T23:56:20Z")

</div>

Hi, I am trying to dpeloy a WAR file created using warbler 0.9.9 (with Rack) and deploy it on GlassFish. The application comes up fine but in the server log error message is logged saying it can not find certain fil…

---

## [Code Review: FastFixes1](https://www.ruby-forum.com/t/code-review-fastfixes1/138889)

<div class="topic-metadata">

**Author:** [@curthibbs](https://www.ruby-forum.com/u/curthibbs)\
**Replies:** 5\
**Last updated:** [May 29, 2008, 11:48pm UTC](https://www.ruby-forum.com/t/code-review-fastfixes1/138889 "2008-05-29T23:48:41Z")

</div>

tfpt review “/shelveset:FastFixes1;REDMOND\\curth” Fixed critical error in Dir.glob Added File.split Added stub for BigDecimal class

---

## [Is there a easy way to find and replay a match](https://www.ruby-forum.com/t/is-there-a-easy-way-to-find-and-replay-a-match/138920)

<div class="topic-metadata">

**Author:** [@cheyne](https://www.ruby-forum.com/u/cheyne)\
**Replies:** 6\
**Last updated:** [May 29, 2008, 11:44pm UTC](https://www.ruby-forum.com/t/is-there-a-easy-way-to-find-and-replay-a-match/138920 "2008-05-29T23:44:23Z")

</div>

Hi,there If I have file and has a line is “aaa=100”, and need to replace it as “aaa=4”. Is there a way to do it without iterating each line and find the match, then replace it? Thank in advance

---

## [Constants in modules](https://www.ruby-forum.com/t/constants-in-modules/138979)

<div class="topic-metadata">

**Author:** [@luis21\_futur](https://www.ruby-forum.com/u/luis21_futur)\
**Replies:** 3\
**Last updated:** [May 29, 2008, 11:20pm UTC](https://www.ruby-forum.com/t/constants-in-modules/138979 "2008-05-29T23:20:17Z")

</div>

Hello, I need to do something like this (this is a simplified version of some other code, of course, but I don’t want to get you lost in details unrelated to the problem): module M CONST\_A = { ‘k1’ =\> ‘v1’, ‘k2’ =\> …

---

## [Start\_command SCP did not finish successfully (1) (Net::SC](https://www.ruby-forum.com/t/start-command-scp-did-not-finish-successfully-1-net-sc/138998)

<div class="topic-metadata">

**Author:** [@linus](https://www.ruby-forum.com/u/linus)\
**Replies:** 1\
**Last updated:** [May 29, 2008, 10:57pm UTC](https://www.ruby-forum.com/t/start-command-scp-did-not-finish-successfully-1-net-sc/138998 "2008-05-29T22:57:08Z")

</div>

Hello, I have a cool small script, but for unknown to me reasons it crashes: require ‘net/scp’ require ‘find’ require ‘fileutils’ REMOTE\_ROOT = “/home/rails/uptest” HOST = ‘my’ USER = ‘rails’ PASS = ‘secret’ EXT…

---

## [Customize a gem method](https://www.ruby-forum.com/t/customize-a-gem-method/138954)

<div class="topic-metadata">

**Author:** [@abir84](https://www.ruby-forum.com/u/abir84)\
**Replies:** 1\
**Last updated:** [May 29, 2008, 10:46pm UTC](https://www.ruby-forum.com/t/customize-a-gem-method/138954 "2008-05-29T22:46:25Z")

</div>

Hello, I want to customize a method of a gem wuthout changing the source code of this gem . Is that possible? Thanks

---

## [\[Ruby 1.9 - Bug #11\] prelude.c compilation problem on mswin32](https://www.ruby-forum.com/t/ruby-1-9-bug-11-prelude-c-compilation-problem-on-mswin32/138878)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 4\
**Last updated:** [May 29, 2008, 10:42pm UTC](https://www.ruby-forum.com/t/ruby-1-9-bug-11-prelude-c-compilation-problem-on-mswin32/138878 "2008-05-29T22:42:19Z")

</div>

Issue #11 has been updated by Usaku NAKAMURA. Priority changed from Normal to Low Bug #11: prelude.c compilation problem on mswin32 http://redmine.ruby-lang.org/issues/show/11 Author: Usaku NAKAMURA Status: Open P…

---

## [How can a code block access an object's variables?](https://www.ruby-forum.com/t/how-can-a-code-block-access-an-objects-variables/138978)

<div class="topic-metadata">

**Author:** [@rubynut](https://www.ruby-forum.com/u/rubynut)\
**Replies:** 5\
**Last updated:** [May 29, 2008, 10:30pm UTC](https://www.ruby-forum.com/t/how-can-a-code-block-access-an-objects-variables/138978 "2008-05-29T22:30:27Z")

</div>

Dear Rubyists, I am a novice Ruby developer who is interested in figuring out a way to design something like what is demonstrated below. The reason why each\_line would not work in this example is because when you pas…

---

## [Inclusion of module: differences](https://www.ruby-forum.com/t/inclusion-of-module-differences/138921)

<div class="topic-metadata">

**Author:** [@leonb](https://www.ruby-forum.com/u/leonb)\
**Replies:** 2\
**Last updated:** [May 29, 2008, 9:58pm UTC](https://www.ruby-forum.com/t/inclusion-of-module-differences/138921 "2008-05-29T21:58:55Z")

</div>

Hi all! I have this code: Parked at Loopia And the output of that script is: “Included from Array3” “Included from Array” “Included from Array2” “\[\]” “\[\]” “aaarghhhh…” nil Obiously the difference in output is b…

---

## [Ruby-Processing library](https://www.ruby-forum.com/t/ruby-processing-library/139008)

<div class="topic-metadata">

**Author:** [@sandman](https://www.ruby-forum.com/u/sandman)\
**Replies:** 0\
**Last updated:** [May 29, 2008, 9:40pm UTC](https://www.ruby-forum.com/t/ruby-processing-library/139008 "2008-05-29T21:40:43Z")

</div>

Hi, I am using the ruby-processing library made available on the GitHub repo…ive unzipped the tarball, but I’m getting a LoadError when I try to run the files: Above is the link for running the samples. I can’t see…

---

## [File system operations](https://www.ruby-forum.com/t/file-system-operations/138995)

<div class="topic-metadata">

**Author:** [@damaris](https://www.ruby-forum.com/u/damaris)\
**Replies:** 1\
**Last updated:** [May 29, 2008, 8:38pm UTC](https://www.ruby-forum.com/t/file-system-operations/138995 "2008-05-29T20:38:24Z")

</div>

Hi again, I have read Jruby cannot do some file system operations. What are these kind of ops? Thanks. View this message in context: http://www.nabble.com/File-system-operations-tp17542688p17542688.html Sent from t…

---

## [Mysterious behavior with loops](https://www.ruby-forum.com/t/mysterious-behavior-with-loops/138984)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 2\
**Last updated:** [May 29, 2008, 8:36pm UTC](https://www.ruby-forum.com/t/mysterious-behavior-with-loops/138984 "2008-05-29T20:36:38Z")

</div>

Enter these in irb: a = \[1,2,3\] a.each do |i| a.delete(i) end Result? a =\> \[2\] Shouldn’t a be \[\] ? Eric

---

## [$: from C or from ruby](https://www.ruby-forum.com/t/from-c-or-from-ruby/138997)

<div class="topic-metadata">

**Author:** [@AndrSSSS](https://www.ruby-forum.com/u/AndrSSSS)\
**Replies:** 0\
**Last updated:** [May 29, 2008, 8:36pm UTC](https://www.ruby-forum.com/t/from-c-or-from-ruby/138997 "2008-05-29T20:36:02Z")

</div>

Hello, I’m inspecting the value of $: (the ‘require’ path) under windows. If I do it from the ruby interpreter or irb, I get: \[“c:/devel/ruby/lib/ruby/site\_ruby/1.8”, “c:/devel/ruby/lib/ruby/ site\_ruby/1.8/i386-msvcr…

---

## [Merge collections of objects](https://www.ruby-forum.com/t/merge-collections-of-objects/138865)

<div class="topic-metadata">

**Author:** [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Replies:** 11\
**Last updated:** [May 29, 2008, 8:03pm UTC](https://www.ruby-forum.com/t/merge-collections-of-objects/138865 "2008-05-29T20:03:38Z")

</div>

Hi, I wonder if there is a quick way to do this. companyA has 2 employees “a”, “b” companyB has 3 employees “a”, “b”, “c” I basically want to merge companyA employess with companyB employees so when i look at compan…

---

## [OpenSSL::Random.random\_bytes(Object.new)](https://www.ruby-forum.com/t/openssl-random-random-bytes-object-new/138983)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 1\
**Last updated:** [May 29, 2008, 7:49pm UTC](https://www.ruby-forum.com/t/openssl-random-random-bytes-object-new/138983 "2008-05-29T19:49:31Z")

</div>

e$B0J2\<$N$h$&$K!"e(B OpenSSL::Random.random\_bytes(Object.new) e$B$Ge(B negative string size (or size too big) (ArgumentError) e$B$H$$$&Nc30$K$J$k$N$OJQ$J$N$G$O$J$$$G$7$g$&$+!#e(B % ./ruby -ropenssl -ve ‘p OpenSSL::Ran…

---

## [File.open auto-close](https://www.ruby-forum.com/t/file-open-auto-close/138982)

<div class="topic-metadata">

**Author:** [@Sammy\_L](https://www.ruby-forum.com/u/Sammy_L)\
**Replies:** 3\
**Last updated:** [May 29, 2008, 7:40pm UTC](https://www.ruby-forum.com/t/file-open-auto-close/138982 "2008-05-29T19:40:05Z")

</div>

I know opening a file and passing a block will execute the block in context of the file and then close the file. Example: File.open(“somefile.txt”) {|f| the\_text = f.read } After running, somefile.txt will be closed…

---

## [Non standard installed gem question](https://www.ruby-forum.com/t/non-standard-installed-gem-question/138947)

<div class="topic-metadata">

**Author:** [@mdiam](https://www.ruby-forum.com/u/mdiam)\
**Replies:** 2\
**Last updated:** [May 29, 2008, 5:09pm UTC](https://www.ruby-forum.com/t/non-standard-installed-gem-question/138947 "2008-05-29T17:09:30Z")

</div>

Bonjour à tous, I’m trying to install and use one particular gem in a non-standard location. I’d like to keep using both standard or non-standard installed gems. I’v been able to install the “rgl” (Ruby Graph Library…

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

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