# Ruby

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

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

---

## [Monkeypatching multiple classes with similar methods](https://www.ruby-forum.com/t/monkeypatching-multiple-classes-with-similar-methods/175892)

<div class="topic-metadata">

**Author:** [@Lars\_O](https://www.ruby-forum.com/u/Lars_O)\
**Replies:** 3\
**Last updated:** [September 22, 2009, 11:18am UTC](https://www.ruby-forum.com/t/monkeypatching-multiple-classes-with-similar-methods/175892 "2009-09-22T11:18:59Z")

</div>

Hello! I’m trying to monkeypatch a number of related classes that all implements the same method (meth). The methods all take one required argument (stuff) but some of the individual methods may require more argument…

---

## [Thread-safe FileUtils.cd](https://www.ruby-forum.com/t/thread-safe-fileutils-cd/175820)

<div class="topic-metadata">

**Author:** [@james-calivar](https://www.ruby-forum.com/u/james-calivar)\
**Replies:** 4\
**Last updated:** [September 22, 2009, 10:42am UTC](https://www.ruby-forum.com/t/thread-safe-fileutils-cd/175820 "2009-09-22T10:42:05Z")

</div>

Hi all, I have a build tool that I’ve written in Ruby that uses this construct to enter a directory, perform some long-running (several seconds) tasks then exit back to the original working directory: FileUtils.cd(…

---

## [Find the number of hours in a day](https://www.ruby-forum.com/t/find-the-number-of-hours-in-a-day/175868)

<div class="topic-metadata">

**Author:** [@nicken](https://www.ruby-forum.com/u/nicken)\
**Replies:** 2\
**Last updated:** [September 22, 2009, 9:46am UTC](https://www.ruby-forum.com/t/find-the-number-of-hours-in-a-day/175868 "2009-09-22T09:46:29Z")

</div>

I’m trying to determine the best way to find the number of hours (or seconds) in a given day in a given timezone. Is there a “right” way to do this with Ruby? There are so many ways to deal with dates and times in Rub…

---

## [Update to x10-cm17a gem for 1.9.1](https://www.ruby-forum.com/t/update-to-x10-cm17a-gem-for-1-9-1/175883)

<div class="topic-metadata">

**Author:** [@barjunk](https://www.ruby-forum.com/u/barjunk)\
**Replies:** 0\
**Last updated:** [September 22, 2009, 6:21am UTC](https://www.ruby-forum.com/t/update-to-x10-cm17a-gem-for-1-9-1/175883 "2009-09-22T06:21:37Z")

</div>

I didn’t find a good way to pass this patch along to those that are maintaining the module for x10-cm17a gem. I suspect since there hasn’t been any activity on it for quite sometime, that there is currently no intere…

---

## [Dynamically created functions?](https://www.ruby-forum.com/t/dynamically-created-functions/175721)

<div class="topic-metadata">

**Author:** [@wanyixue](https://www.ruby-forum.com/u/wanyixue)\
**Replies:** 3\
**Last updated:** [September 22, 2009, 6:20am UTC](https://www.ruby-forum.com/t/dynamically-created-functions/175721 "2009-09-22T06:20:37Z")

</div>

def self.developer\_options(\*args) fetch\_options({‘area’=\>‘developers’,‘index’ =\> args.first}) end def self.priority\_options(\*args) fetch\_options({‘area’=\>‘priority’,‘index’ =\> args.first}) end def self.status\_optio…

---

## [Writing to STDOUT after closing controlling terminal](https://www.ruby-forum.com/t/writing-to-stdout-after-closing-controlling-terminal/175830)

<div class="topic-metadata">

**Author:** [@burrowsm](https://www.ruby-forum.com/u/burrowsm)\
**Replies:** 6\
**Last updated:** [September 22, 2009, 2:39am UTC](https://www.ruby-forum.com/t/writing-to-stdout-after-closing-controlling-terminal/175830 "2009-09-22T02:39:47Z")

</div>

Hi, I don’t know if this is a dumb question or not (I hope it isn’t), but it seems to me there’s something wrong here. I’ve been using Ruby for a long time now, and I never noticed this (maybe it wasn’t working like …

---

## [Isolate 1.0.1 Released](https://www.ruby-forum.com/t/isolate-1-0-1-released/175871)

<div class="topic-metadata">

**Author:** [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Replies:** 1\
**Last updated:** [September 22, 2009, 2:18am UTC](https://www.ruby-forum.com/t/isolate-1-0-1-released/175871 "2009-09-22T02:18:09Z")

</div>

isolate version 1.0.1 has been released! http://github.com/jbarnette/isolate Isolate is a very simple RubyGems sandbox. It provides a way to express and install your code’s Gem dependencies. When Isolate runs, it us…

---

## [Problems getting Tk running](https://www.ruby-forum.com/t/problems-getting-tk-running/170020)

<div class="topic-metadata">

**Author:** [@stamppot](https://www.ruby-forum.com/u/stamppot)\
**Replies:** 8\
**Last updated:** [September 22, 2009, 1:59am UTC](https://www.ruby-forum.com/t/problems-getting-tk-running/170020 "2009-09-22T01:59:51Z")

</div>

Hi, I use Ruby 1.8 under Windows (installed with the One-Click-Installer). When I try to use Tk I get a message that tk84.dll is not available. I googled a bit and found that I have to install ActiveTcl 8.4 and did t…

---

## [Gem fails to load?](https://www.ruby-forum.com/t/gem-fails-to-load/175875)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 2\
**Last updated:** [September 22, 2009, 1:52am UTC](https://www.ruby-forum.com/t/gem-fails-to-load/175875 "2009-09-22T01:52:21Z")

</div>

Anybody have an idea what’s going on here? $ gem install rogerdpack-live\_console WARNING: Installing to ~/.gem since /usr/local/lib/ruby/gems/1.8 and /usr/local/bin aren’t both writable. Successfully installed roger…

---

## [Vicious versioning cycle prevents upgrading Ruby Gems](https://www.ruby-forum.com/t/vicious-versioning-cycle-prevents-upgrading-ruby-gems/175873)

<div class="topic-metadata">

**Author:** [@trucker](https://www.ruby-forum.com/u/trucker)\
**Replies:** 4\
**Last updated:** [September 22, 2009, 1:24am UTC](https://www.ruby-forum.com/t/vicious-versioning-cycle-prevents-upgrading-ruby-gems/175873 "2009-09-22T01:24:42Z")

</div>

I am stuck in a vicious cycle in which I need a newer version of Gems in order to upgrade my current version of Gems. Is there a way out of this aside from a clean install of gems? I would like to install the newgem …

---

## [Customizable app loading message](https://www.ruby-forum.com/t/customizable-app-loading-message/175865)

<div class="topic-metadata">

**Author:** [@iceburgh](https://www.ruby-forum.com/u/iceburgh)\
**Replies:** 0\
**Last updated:** [September 21, 2009, 8:21pm UTC](https://www.ruby-forum.com/t/customizable-app-loading-message/175865 "2009-09-21T20:21:39Z")

</div>

Hi all. When I start up my rails app in Glassfish or Tomcat, the appserver starts to serve requests almost immediately even though the app isn’t loaded. In Tomcat, you get a blank page. In Glassfish, you get a page …

---

## [Reading and Writing to Tempfile](https://www.ruby-forum.com/t/reading-and-writing-to-tempfile/175853)

<div class="topic-metadata">

**Author:** [@brad](https://www.ruby-forum.com/u/brad)\
**Replies:** 1\
**Last updated:** [September 21, 2009, 8:18pm UTC](https://www.ruby-forum.com/t/reading-and-writing-to-tempfile/175853 "2009-09-21T20:18:43Z")

</div>

Hello, I’m having a hard time getting tempfile to work correctly for me. I have a couple of questions Isn’t it possible to open a tempfile, write to it, close it then later open it again write to it and close it? I …

---

## [Incrementing variable names in a loop?](https://www.ruby-forum.com/t/incrementing-variable-names-in-a-loop/175859)

<div class="topic-metadata">

**Author:** [@burrowsm](https://www.ruby-forum.com/u/burrowsm)\
**Replies:** 9\
**Last updated:** [September 21, 2009, 6:54pm UTC](https://www.ruby-forum.com/t/incrementing-variable-names-in-a-loop/175859 "2009-09-21T18:54:24Z")

</div>

I have a function write\_log that takes in a string and it prints to console and to a logger. I need to loop through all variables found in an index of an array as a hash and print them. This list of variables to iter…

---

## [Hash or array?](https://www.ruby-forum.com/t/hash-or-array/175861)

<div class="topic-metadata">

**Author:** [@nescripter](https://www.ruby-forum.com/u/nescripter)\
**Replies:** 6\
**Last updated:** [September 21, 2009, 6:46pm UTC](https://www.ruby-forum.com/t/hash-or-array/175861 "2009-09-21T18:46:19Z")

</div>

Hello, I have a question, I want to store some data in two columns, for example 0001, stuff1 stuff2 0002, morestuff 0003, extrastuff 0004, more evenmore As you can see column 1 is an ID and column 2 is one or more …

---

## [Script hangs while waiting for user input](https://www.ruby-forum.com/t/script-hangs-while-waiting-for-user-input/175844)

<div class="topic-metadata">

**Author:** [@landge](https://www.ruby-forum.com/u/landge)\
**Replies:** 5\
**Last updated:** [September 21, 2009, 6:34pm UTC](https://www.ruby-forum.com/t/script-hangs-while-waiting-for-user-input/175844 "2009-09-21T18:34:01Z")

</div>

Hi! I want to send e-mail automatically from windows with help of “win32ole” and outlook. I wrote two short scripts: one that sends the mail and one that sends the keystrokes to the outlook security alert. (the …

---

## [I want to re-subscribe](https://www.ruby-forum.com/t/i-want-to-re-subscribe/175860)

<div class="topic-metadata">

**Author:** [@patrick](https://www.ruby-forum.com/u/patrick)\
**Replies:** 1\
**Last updated:** [September 21, 2009, 5:46pm UTC](https://www.ruby-forum.com/t/i-want-to-re-subscribe/175860 "2009-09-21T17:46:27Z")

</div>

I have tried to unsubsubscribe twice from this list, it has not worked. I like the list I just want to change my email address. I am having a dispute with my ISP, when this email goes down will it affect the other use…

---

## [Determining if a file is binary or text](https://www.ruby-forum.com/t/determining-if-a-file-is-binary-or-text/175757)

<div class="topic-metadata">

**Author:** [@noagenda](https://www.ruby-forum.com/u/noagenda)\
**Replies:** 14\
**Last updated:** [September 21, 2009, 5:39pm UTC](https://www.ruby-forum.com/t/determining-if-a-file-is-binary-or-text/175757 "2009-09-21T17:39:25Z")

</div>

Hi all, I need to search text files for a given expression and flag a warning/ error if that expression does not exist. I’m going to search a large number of files using the Linux “find” command, so I won’t know if …

---

## [How to create a file with UTF-8 encoding](https://www.ruby-forum.com/t/how-to-create-a-file-with-utf-8-encoding/175840)

<div class="topic-metadata">

**Author:** [@thyrlian](https://www.ruby-forum.com/u/thyrlian)\
**Replies:** 4\
**Last updated:** [September 21, 2009, 4:27pm UTC](https://www.ruby-forum.com/t/how-to-create-a-file-with-utf-8-encoding/175840 "2009-09-21T16:27:25Z")

</div>

Hi, as known that the default encoding is set to ANSI when creating a text file. How can I specify the encoding type to UTF-8 other than ANSI when creating a text file in RUBY? Thanks a lot. I’ve tried the ways foun…

---

## [Rakefile invoking ruby script](https://www.ruby-forum.com/t/rakefile-invoking-ruby-script/175856)

<div class="topic-metadata">

**Author:** [@Thufir](https://www.ruby-forum.com/u/Thufir)\
**Replies:** 0\
**Last updated:** [September 21, 2009, 4:18pm UTC](https://www.ruby-forum.com/t/rakefile-invoking-ruby-script/175856 "2009-09-21T16:18:38Z")

</div>

I’m just doing ruby and rake, and am consciously staying away from RoR for the time being – I may build a GUI with Fox down the road. Possibly I have completely the wrong approach, but I want the “drop” task to invok…

---

## [Multi-Dimensional Arrays in Priority Queues](https://www.ruby-forum.com/t/multi-dimensional-arrays-in-priority-queues/175832)

<div class="topic-metadata">

**Author:** [@masonkessinger](https://www.ruby-forum.com/u/masonkessinger)\
**Replies:** 7\
**Last updated:** [September 21, 2009, 8:18am UTC](https://www.ruby-forum.com/t/multi-dimensional-arrays-in-priority-queues/175832 "2009-09-21T08:18:39Z")

</div>

In my program I need to construct a priority queue that sorts ascending. The basic idea can be expressed in the following simple code that uses a Priority Queue concept. See: http://www.math.kobe-u.ac.jp/~kodama/tips…

---

## [Rake task organization](https://www.ruby-forum.com/t/rake-task-organization/175837)

<div class="topic-metadata">

**Author:** [@Thufir](https://www.ruby-forum.com/u/Thufir)\
**Replies:** 0\
**Last updated:** [September 21, 2009, 6:32am UTC](https://www.ruby-forum.com/t/rake-task-organization/175837 "2009-09-21T06:32:06Z")

</div>

in the “connects” task for the following rakefile, how do I tie-in Item and Items so that there’s minimal code repetition? For instance, currently Item is defined in the connect task for the rakefile, wheras I would …

---

## [Error when installing Watir for IronRuby](https://www.ruby-forum.com/t/error-when-installing-watir-for-ironruby/175836)

<div class="topic-metadata">

**Author:** [@metanoize](https://www.ruby-forum.com/u/metanoize)\
**Replies:** 0\
**Last updated:** [September 21, 2009, 6:15am UTC](https://www.ruby-forum.com/t/error-when-installing-watir-for-ironruby/175836 "2009-09-21T06:15:38Z")

</div>

I updated my gem for Ruby (Not IronRuby) to 1.3.5 C:\\DevTools\\IronRuby\\ironruby\\Merlin\\Main\\Languages\\Ruby\\Scripts\\bin\>ir igem -v 1.3.5 C:\\DevTools\\IronRuby\\ironruby\\Merlin\\Main\\Languages\\Ruby\\Scripts\\bin\>ir igem in…

---

## [Watir under IronRuby Error](https://www.ruby-forum.com/t/watir-under-ironruby-error/174073)

<div class="topic-metadata">

**Author:** [@qwerty](https://www.ruby-forum.com/u/qwerty)\
**Replies:** 2\
**Last updated:** [September 21, 2009, 4:57am UTC](https://www.ruby-forum.com/t/watir-under-ironruby-error/174073 "2009-09-21T04:57:39Z")

</div>

Hi all, I am trying to get my Watir scripts running under IronRuby, but am encountering the following error: :0:in \`require’: no such file to load – dl (LoadError) from C:/ironruby-0.9.0/lib/ruby/1.8/dl/import.rb:3 …

---

## [New to Ruby; Trying to use RMagick](https://www.ruby-forum.com/t/new-to-ruby-trying-to-use-rmagick/175831)

<div class="topic-metadata">

**Author:** [@janovetz](https://www.ruby-forum.com/u/janovetz)\
**Replies:** 3\
**Last updated:** [September 21, 2009, 4:21am UTC](https://www.ruby-forum.com/t/new-to-ruby-trying-to-use-rmagick/175831 "2009-09-21T04:21:11Z")

</div>

Hey, guys. I am new to ruby, but need to move through using it quickly, as I am doing an internship at my school that requires progress on my current project. I need to start graphing numerical experiments quickly. St…

---

## [Fukuoka Ruby Award 2010](https://www.ruby-forum.com/t/fukuoka-ruby-award-2010/175826)

<div class="topic-metadata">

**Author:** [@Yukihiro\_M](https://www.ruby-forum.com/u/Yukihiro_M)\
**Replies:** 0\
**Last updated:** [September 21, 2009, 12:39am UTC](https://www.ruby-forum.com/t/fukuoka-ruby-award-2010/175826 "2009-09-21T00:39:07Z")

</div>

Hi, Fukuoka Ruby Award comes again! Fukuoka Ruby Award 2010 Fukuoka Prefecture aims to ensure the further development of software industry in Fukuoka by supporting activities of Ruby-based businesse…

---

## [Gem install mysql returns list of No definition for XYZ](https://www.ruby-forum.com/t/gem-install-mysql-returns-list-of-no-definition-for-xyz/174819)

<div class="topic-metadata">

**Author:** [@yankees26](https://www.ruby-forum.com/u/yankees26)\
**Replies:** 7\
**Last updated:** [September 20, 2009, 8:02pm UTC](https://www.ruby-forum.com/t/gem-install-mysql-returns-list-of-no-definition-for-xyz/174819 "2009-09-20T20:02:33Z")

</div>

Hello, http://www.schmidp.com/2009/06/14/rubyrails-and-mysql-on-snow-leopard-10a380/comment-page-1/#comment-3751 I am searching for fix to problem, Russell F., Mike and Andrew. All have the same problem. root@br:/# g…

---

## [Roman numeral conversion](https://www.ruby-forum.com/t/roman-numeral-conversion/175736)

<div class="topic-metadata">

**Author:** [@bct](https://www.ruby-forum.com/u/bct)\
**Replies:** 3\
**Last updated:** [September 20, 2009, 5:13pm UTC](https://www.ruby-forum.com/t/roman-numeral-conversion/175736 "2009-09-20T17:13:08Z")

</div>

First time poster here… I realize that rubyquiz.com is no longer really active, but some of the code there is still used by people googling for example code (roman numeral conversion in my case for a class I am taking…

---

## [Reek 1.2 released](https://www.ruby-forum.com/t/reek-1-2-released/175817)

<div class="topic-metadata">

**Author:** [@Kevin\_Rutherford](https://www.ruby-forum.com/u/Kevin_Rutherford)\
**Replies:** 0\
**Last updated:** [September 20, 2009, 4:45pm UTC](https://www.ruby-forum.com/t/reek-1-2-released/175817 "2009-09-20T16:45:01Z")

</div>

Hi, Reek version 1.2.0 has been released! Reek detects smells in Ruby code. It can be used as a stand-alone command, or as a Rake task, or as an expectation in Rspec examples. Changes in this release: Major Changes …

---

## [Base64 1.9... am I missing something here?](https://www.ruby-forum.com/t/base64-1-9-am-i-missing-something-here/175816)

<div class="topic-metadata">

**Author:** [@Mikel\_L](https://www.ruby-forum.com/u/Mikel_L)\
**Replies:** 0\
**Last updated:** [September 20, 2009, 4:40pm UTC](https://www.ruby-forum.com/t/base64-1-9-am-i-missing-something-here/175816 "2009-09-20T16:40:20Z")

</div>

Surely this must work? data = File.read(‘test.png’) data == \[data\].pack(‘m’).unpack(‘m’).first #=\> false ??? Shouldn’t that be true? You can find test.png at: … but I don’t think it is the problem.

---

## [\[Bug #2118\](Closed) SUN $B$N(B cc (SunStudio11 C 5.8 $B%3%s%Q%$%i(B) $B$G(B dir.c $B$N%3%s%Q](https://www.ruby-forum.com/t/bug-2118-closed-sun-b-n-b-cc-sunstudio11-c-5-8-b-3-s-q-i-b-b-g-b-dir-c-b-n-3-s-q/175810)

<div class="topic-metadata">

**Author:** [@nobu](https://www.ruby-forum.com/u/nobu)\
**Replies:** 0\
**Last updated:** [September 20, 2009, 12:31pm UTC](https://www.ruby-forum.com/t/bug-2118-closed-sun-b-n-b-cc-sunstudio11-c-5-8-b-3-s-q-i-b-b-g-b-dir-c-b-n-3-s-q/175810 "2009-09-20T12:31:03Z")

</div>

e$B%A%1%C%He(B #2118 e$B$,99?7$5$l$^$7$?!#e(B (by Nobuyoshi N.) e$B%9%F!\<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B Applied in changeset r25002. http://redmine.ruby-lang.org/issues/show/2118

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

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