# Ruby

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

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

---

## [Pdf writer, are loose objects always "on top"](https://www.ruby-forum.com/t/pdf-writer-are-loose-objects-always-on-top/124696)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [January 1, 2008, 5:20pm UTC](https://www.ruby-forum.com/t/pdf-writer-are-loose-objects-always-on-top/124696 "2008-01-01T17:20:35Z")

</div>

I have a watermark image that I want beneath the content of every page. I’d like to use loose objects so I do bloat the file, but loose objects seem to always be on top, making for a very poor BACKGROUND watermark !

---

## [Why not call Thread.join?](https://www.ruby-forum.com/t/why-not-call-thread-join/124621)

<div class="topic-metadata">

**Author:** [@thefed](https://www.ruby-forum.com/u/thefed)\
**Replies:** 12\
**Last updated:** [January 1, 2008, 1:00pm UTC](https://www.ruby-forum.com/t/why-not-call-thread-join/124621 "2008-01-01T13:00:39Z")

</div>

Take this code from the Ruby Cookbook: module Enumerable def each\_simultaneously threads = \[\] each { |e| threads \<\< Thread.new { yield e } } return threads end end It is used on an array so that you may do this: …

---

## [About method docs](https://www.ruby-forum.com/t/about-method-docs/124301)

<div class="topic-metadata">

**Author:** [@Santanu](https://www.ruby-forum.com/u/Santanu)\
**Replies:** 15\
**Last updated:** [January 1, 2008, 10:49am UTC](https://www.ruby-forum.com/t/about-method-docs/124301 "2008-01-01T10:49:06Z")

</div>

Hello Everybody, I started learning ruby recently (yesterday). I am using the interactive irb to try out the various ruby features. But I am very much missing the help feature which I was so used to in the python’s i…

---

## [NKF,Kconv](https://www.ruby-forum.com/t/nkf-kconv/124691)

<div class="topic-metadata">

**Author:** [@Kazuhiro\_NISHIYAMA](https://www.ruby-forum.com/u/Kazuhiro_NISHIYAMA)\
**Replies:** 5\
**Last updated:** [January 1, 2008, 8:20am UTC](https://www.ruby-forum.com/t/nkf-kconv/124691 "2008-01-01T08:20:09Z")

</div>

e$B@\>;3OB9-$G$9!#e(B NKF::SJIS e$B$Oe(B #Encoding:Shift\_JIS e$B$K$J$C$F$$$^$9$,!"e(B -Ks e$B$KBP1~$9$k%(%s%3!\<%G%#%s%0$re(B #Encoding:Windows-31J e$B$Ke(B e$B$9$k$N$J$ie(B NKF::SJIS e$B$be(B #Encoding:Windows-31J e$…

---

## [How to store a block in a var?](https://www.ruby-forum.com/t/how-to-store-a-block-in-a-var/124685)

<div class="topic-metadata">

**Author:** [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Replies:** 3\
**Last updated:** [January 1, 2008, 7:59am UTC](https://www.ruby-forum.com/t/how-to-store-a-block-in-a-var/124685 "2008-01-01T07:59:42Z")

</div>

Mil perdones, but my brain seems to have gone awol. I have multiple places in a spec where I need to run the same block of code. I would be much happier storing this block in a var as a Proc as opposed to wrapping it …

---

## [Mr Bones - 1.2.0](https://www.ruby-forum.com/t/mr-bones-1-2-0/124692)

<div class="topic-metadata">

**Author:** [@timperrett](https://www.ruby-forum.com/u/timperrett)\
**Replies:** 0\
**Last updated:** [January 1, 2008, 6:01am UTC](https://www.ruby-forum.com/t/mr-bones-1-2-0/124692 "2008-01-01T06:01:11Z")

</div>

Mr Bones by Tim P. http://codeforpeople.rubyforge.org/bones == NEW STUFF You can now freeze the default Mr Bones project skeleton and add your own modifications, files, rake tasks, etc. When you use the “bones” co…

---

## [Def if ; end - basically impossible?](https://www.ruby-forum.com/t/def-if-end-basically-impossible/124434)

<div class="topic-metadata">

**Author:** [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Replies:** 10\
**Last updated:** [January 1, 2008, 4:16am UTC](https://www.ruby-forum.com/t/def-if-end-basically-impossible/124434 "2008-01-01T04:16:38Z")

</div>

I’m writing some code which needs to do something unusual when it encounters an if, an else, or an end. def if “asdf” end =\> nil if ?\> true end =\> nil The ?\> line comes up because if appears to not be a…

---

## [Halcyon 0.3.18 Release](https://www.ruby-forum.com/t/halcyon-0-3-18-release/124684)

<div class="topic-metadata">

**Author:** [@maraby](https://www.ruby-forum.com/u/maraby)\
**Replies:** 0\
**Last updated:** [January 1, 2008, 3:52am UTC](https://www.ruby-forum.com/t/halcyon-0-3-18-release/124684 "2008-01-01T03:52:40Z")

</div>

= Halcyon == JSON Server App Framework Halcyon is a JSON Web App Server Framework built on Rack for speed and light weight. For more information, check out our website at http://halcyon.rubyforge.org/ or go straight…

---

## [Difficult problem w/media file metadata](https://www.ruby-forum.com/t/difficult-problem-w-media-file-metadata/124593)

<div class="topic-metadata">

**Author:** [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Replies:** 2\
**Last updated:** [December 31, 2007, 9:37pm UTC](https://www.ruby-forum.com/t/difficult-problem-w-media-file-metadata/124593 "2007-12-31T21:37:05Z")

</div>

I need to automatically remove from an mp4 of the 2003 movie “Underworld” all frames which feature any image other than Kate Beckinsale wearing leather. Is there a gem that will solve this problem for me? I need to re…

---

## [Detecting Arrow Keys](https://www.ruby-forum.com/t/detecting-arrow-keys/124612)

<div class="topic-metadata">

**Author:** [@thefed](https://www.ruby-forum.com/u/thefed)\
**Replies:** 4\
**Last updated:** [December 31, 2007, 6:59pm UTC](https://www.ruby-forum.com/t/detecting-arrow-keys/124612 "2007-12-31T18:59:52Z")

</div>

Hey all, In short, I’m looking to, through an STDIN/OUT console interface, detect which arrows keys have been pressed. Here is everything I have so far… PRGM A = Parked at Loopia using PRGM A, I have been able to de…

---

## [Super simple language enhancement](https://www.ruby-forum.com/t/super-simple-language-enhancement/124588)

<div class="topic-metadata">

**Author:** [@zorro](https://www.ruby-forum.com/u/zorro)\
**Replies:** 10\
**Last updated:** [December 31, 2007, 6:24pm UTC](https://www.ruby-forum.com/t/super-simple-language-enhancement/124588 "2007-12-31T18:24:46Z")

</div>

I don’t know if this has ever been done in any language. Any vertical line character(s) ( | ) which precede anything else on any line should be treated as whitespace. This makes possible the following: Say hi to every…

---

## [Install rubygems on Vista](https://www.ruby-forum.com/t/install-rubygems-on-vista/124097)

<div class="topic-metadata">

**Author:** [@alex-osu3](https://www.ruby-forum.com/u/alex-osu3)\
**Replies:** 9\
**Last updated:** [December 31, 2007, 4:11pm UTC](https://www.ruby-forum.com/t/install-rubygems-on-vista/124097 "2007-12-31T16:11:40Z")

</div>

Hi all, Sorry if this quesione is posted. I install one-click Ruby on Vista with default gems. I add ruby path(c:\\ruby\\bin;) to the system environment variables. After that I can check the ruby version from any direc…

---

## [Add Array#first= and Array#last= to std lib](https://www.ruby-forum.com/t/add-array-first-and-array-last-to-std-lib/124286)

<div class="topic-metadata">

**Author:** [@robkuz](https://www.ruby-forum.com/u/robkuz)\
**Replies:** 35\
**Last updated:** [December 31, 2007, 4:07pm UTC](https://www.ruby-forum.com/t/add-array-first-and-array-last-to-std-lib/124286 "2007-12-31T16:07:10Z")

</div>

Hi, just today I came across a situation where I needed Array#last= because I wanted to do an\_array.last += 1 Does anybody else see this as useful? Any issues with this? If not I’ll open an RCR. Kind regards rob…

---

## [Fwd: \[ruby-cvs:21983\] Ruby:r14746 (trunk): \* transcode.c (transcode\_dispatch): allows transcoding fr](https://www.ruby-forum.com/t/fwd-ruby-cvs-21983-ruby-r14746-trunk-transcode-c-transcode-dispatch-allows-transcoding-fr/124381)

<div class="topic-metadata">

**Author:** [@drenovac](https://www.ruby-forum.com/u/drenovac)\
**Replies:** 2\
**Last updated:** [December 31, 2007, 11:01am UTC](https://www.ruby-forum.com/t/fwd-ruby-cvs-21983-ruby-r14746-trunk-transcode-c-transcode-dispatch-allows-transcoding-fr/124381 "2007-12-31T11:01:58Z")

</div>

e$BCfED$5$s!"$3$s$K$A$O!#e(B e$B0J2\<$N%Q%C%A$“$j$,$H$&$4$6$$$^$7$?!#e(BUS-ASCII e$BMQ$NJQ49$be(B e$BI,MW$@$m$&$H%P%/$b$?$^$K;W$C$F$$$^$7$?$,!”%W%m%0%i%\`$7$?e(B e$B$H$-$K$$$D$bK:$l$^$7$?!#e(B e$B$H$3$m$G!“$3$A$i$G$O!”…

---

## [A loop in a thread... very greedy](https://www.ruby-forum.com/t/a-loop-in-a-thread-very-greedy/124618)

<div class="topic-metadata">

**Author:** [@jazzhammer](https://www.ruby-forum.com/u/jazzhammer)\
**Replies:** 5\
**Last updated:** [December 31, 2007, 9:53am UTC](https://www.ruby-forum.com/t/a-loop-in-a-thread-very-greedy/124618 "2007-12-31T09:53:20Z")

</div>

need a class(we’ll call it a ‘simulator’ since that’s what i’m attempting to write) to run a loop. need that loop to stop when asked to, such as when the user that started it clicks a button to stop it. i write java …

---

## [String#% and a Hash](https://www.ruby-forum.com/t/string-and-a-hash/124625)

<div class="topic-metadata">

**Author:** [@backz](https://www.ruby-forum.com/u/backz)\
**Replies:** 2\
**Last updated:** [December 31, 2007, 9:11am UTC](https://www.ruby-forum.com/t/string-and-a-hash/124625 "2007-12-31T09:11:28Z")

</div>

Ruby1.9 doesn’t seem to accept hashes in the String#% method anymore. I use this a lot in conjunction with gettext\[1\], and am basically wondering if this is a language change or a 1.9 bug. It doesn’t appear to be docu…

---

## [Questions about \* + and ? in Regex](https://www.ruby-forum.com/t/questions-about-and-in-regex/124626)

<div class="topic-metadata">

**Author:** [@caof2005](https://www.ruby-forum.com/u/caof2005)\
**Replies:** 3\
**Last updated:** [December 31, 2007, 8:37am UTC](https://www.ruby-forum.com/t/questions-about-and-in-regex/124626 "2007-12-31T08:37:00Z")

</div>

Hi, I have some questions related the correct meaning of \* + and ? in Regex that I would appreciate some clarification: I have an example (derived from the Programming Ruby 2nd Edition), that I don’t understand why …

---

## [How can I get this backslash-eliminating behavior when reading a file?](https://www.ruby-forum.com/t/how-can-i-get-this-backslash-eliminating-behavior-when-reading-a-file/124627)

<div class="topic-metadata">

**Author:** [@philthompson](https://www.ruby-forum.com/u/philthompson)\
**Replies:** 1\
**Last updated:** [December 31, 2007, 7:37am UTC](https://www.ruby-forum.com/t/how-can-i-get-this-backslash-eliminating-behavior-when-reading-a-file/124627 "2007-12-31T07:37:23Z")

</div>

I’m trying to write a parser for a file format that allows backslashes ‘’ at the end of lines. The format I’m trying to parse treats backslashes at the end of lines just like the Ruby parser would treat them if they …

---

## [Data inserting problem into oracle table from ruby](https://www.ruby-forum.com/t/data-inserting-problem-into-oracle-table-from-ruby/124619)

<div class="topic-metadata">

**Author:** [@pradeepta](https://www.ruby-forum.com/u/pradeepta)\
**Replies:** 0\
**Last updated:** [December 31, 2007, 5:33am UTC](https://www.ruby-forum.com/t/data-inserting-problem-into-oracle-table-from-ruby/124619 "2007-12-31T05:33:36Z")

</div>

Hi , I can create table in ruby program and it is reflected in sql \*plus,but when i am inserting or updating data it is not reflected in sql \*plus ,neither when i insert data from sql \*plus ,it is reflected in ruby p…

---

## [(no subject)](https://www.ruby-forum.com/t/no-subject/124616)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [December 31, 2007, 3:45am UTC](https://www.ruby-forum.com/t/no-subject/124616 "2007-12-31T03:45:59Z")

</div>

Unsubscribe removed\_email\_address@domain.invalid DISCLAIMER: This message contains privileged and confidential information and is intended only for an individual named. If you are not the intended recipient, you shou…

---

## [Turn nested hashes into nested ostructs](https://www.ruby-forum.com/t/turn-nested-hashes-into-nested-ostructs/124611)

<div class="topic-metadata">

**Author:** [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Replies:** 0\
**Last updated:** [December 31, 2007, 1:23am UTC](https://www.ruby-forum.com/t/turn-nested-hashes-into-nested-ostructs/124611 "2007-12-31T01:23:20Z")

</div>

I just thought I’d share this on the off chance anyone would find it useful. It simply turns a nested hash into a nested ostruct. require ‘ostruct’ class NestedOstruct def self.new(hash) OpenStruct.new(hash.inject(…

---

## [Instant Rails 2.0 Released](https://www.ruby-forum.com/t/instant-rails-2-0-released/124486)

<div class="topic-metadata">

**Author:** [@rjberry](https://www.ruby-forum.com/u/rjberry)\
**Replies:** 2\
**Last updated:** [December 31, 2007, 12:35am UTC](https://www.ruby-forum.com/t/instant-rails-2-0-released/124486 "2007-12-31T00:35:24Z")

</div>

I am happy to announce the release of Instant Rails 2.0. This is my first release after taking over the project for Curt H… I hope I can do as good a job as he has, thanks Curt. This release is part of bringing t…

---

## [Newbie question - how to use multiple source files](https://www.ruby-forum.com/t/newbie-question-how-to-use-multiple-source-files/124592)

<div class="topic-metadata">

**Author:** [@benhiller](https://www.ruby-forum.com/u/benhiller)\
**Replies:** 5\
**Last updated:** [December 30, 2007, 11:22pm UTC](https://www.ruby-forum.com/t/newbie-question-how-to-use-multiple-source-files/124592 "2007-12-30T23:22:55Z")

</div>

I’m coming from Java, and am trying to understand how to break upo code into more than one file. So in this example, I have one class in the first file, another in the second file, and I want to create an object from…

---

## [RMagick 2.0.0 for Windows](https://www.ruby-forum.com/t/rmagick-2-0-0-for-windows/124602)

<div class="topic-metadata">

**Author:** [@timhunter](https://www.ruby-forum.com/u/timhunter)\
**Replies:** 1\
**Last updated:** [December 30, 2007, 11:00pm UTC](https://www.ruby-forum.com/t/rmagick-2-0-0-for-windows/124602 "2007-12-30T23:00:42Z")

</div>

I’ve just uploaded a pre-compiled-for-Windows RMagick 2.0.0 gem to RubyForge. The gem is bundled with ImageMagick 6.3.7-8. Look for RMagick-2.0.0-ImageMagick-6.3.7-8-Q8.zip in the rmagick-win32 project of the RMagick …

---

## [Using unicode in YAML](https://www.ruby-forum.com/t/using-unicode-in-yaml/122889)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [December 30, 2007, 10:40pm UTC](https://www.ruby-forum.com/t/using-unicode-in-yaml/122889 "2007-12-30T22:40:45Z")

</div>

I’ve done my research, and it appears that the current ruby YAML implementation doesn’t really grok unicode. What I want to know is whether anything has changed in this regard, or is likely to in the future. It doesn’…

---

## [How does drb work](https://www.ruby-forum.com/t/how-does-drb-work/124545)

<div class="topic-metadata">

**Author:** [@Junkone](https://www.ruby-forum.com/u/Junkone)\
**Replies:** 6\
**Last updated:** [December 30, 2007, 8:59pm UTC](https://www.ruby-forum.com/t/how-does-drb-work/124545 "2007-12-30T20:59:35Z")

</div>

I am trying to understand how drb works and need some clarificaiton. DRbServer.start\_service nil, method(params) I then do a client call DRbClient.start\_service Then how do i trigger the DRbServer so that the mehods …

---

## [Drb application in bots](https://www.ruby-forum.com/t/drb-application-in-bots/124594)

<div class="topic-metadata">

**Author:** [@Junkone](https://www.ruby-forum.com/u/Junkone)\
**Replies:** 0\
**Last updated:** [December 30, 2007, 7:52pm UTC](https://www.ruby-forum.com/t/drb-application-in-bots/124594 "2007-12-30T19:52:19Z")

</div>

Hello. I am doing a drb application for a bot client and have a prob. How can i set up the server so that it will accept a string and do someaction like bot.deliver(string) bot server !/usr/bin/env ruby require ‘ru…

---

## [Sub is odd with #](https://www.ruby-forum.com/t/sub-is-odd-with/124566)

<div class="topic-metadata">

**Author:** [@pavel989](https://www.ruby-forum.com/u/pavel989)\
**Replies:** 7\
**Last updated:** [December 30, 2007, 6:18pm UTC](https://www.ruby-forum.com/t/sub-is-odd-with/124566 "2007-12-30T18:18:15Z")

</div>

seems to me as though I’m redundant on this forum… well anyway, doing ‘@@@@’.sub(’@’,’#’) returns ‘/#@@@’ how can I make it so that it doesn’t through in the / ? using 1.9 btw gsub doesn’t do that, but I specifica…

---

## [Replace words to be bold for each search word](https://www.ruby-forum.com/t/replace-words-to-be-bold-for-each-search-word/124572)

<div class="topic-metadata">

**Author:** [@markthomas](https://www.ruby-forum.com/u/markthomas)\
**Replies:** 5\
**Last updated:** [December 30, 2007, 5:38pm UTC](https://www.ruby-forum.com/t/replace-words-to-be-bold-for-each-search-word/124572 "2007-12-30T17:38:53Z")

</div>

I have two strings: The first string with dynamic content: @string = “this is the example of the text” The second one includes search words: @search = “example text” How can I do that it prints the search words with…

---

## [Scope difference of alias + alias\_method a bug or a feature?](https://www.ruby-forum.com/t/scope-difference-of-alias-alias-method-a-bug-or-a-feature/124584)

<div class="topic-metadata">

**Author:** [@Dirk\_T](https://www.ruby-forum.com/u/Dirk_T)\
**Replies:** 0\
**Last updated:** [December 30, 2007, 4:46pm UTC](https://www.ruby-forum.com/t/scope-difference-of-alias-alias-method-a-bug-or-a-feature/124584 "2007-12-30T16:46:19Z")

</div>

Chan S. in ruby-talk\[284135\] stumbled over the different scope of alias and alias\_method. See his example a little changed: puts RUBY\_VERSION #=\> 1.8.6 class T def self.redefine p self alias\_m…

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

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