# Ruby

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

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

---

## [Sgub stretching over several lines](https://www.ruby-forum.com/t/sgub-stretching-over-several-lines/111294)

<div class="topic-metadata">

**Author:** [@jandot](https://www.ruby-forum.com/u/jandot)\
**Replies:** 6\
**Last updated:** [August 6, 2007, 4:09am UTC](https://www.ruby-forum.com/t/sgub-stretching-over-several-lines/111294 "2007-08-06T04:09:08Z")

</div>

Hi, I am trying to do a in a replace a long (multiple line) string: string = string.gsub(/\<h3 class="field-label\>audience\</h3\> \<div class="field-items\> \<div class="field-item\>/, ‘’) It somehow doesn’t seem to work. …

---

## [Doubts on char patterns into String.each argument](https://www.ruby-forum.com/t/doubts-on-char-patterns-into-string-each-argument/111324)

<div class="topic-metadata">

**Author:** [@caof2005](https://www.ruby-forum.com/u/caof2005)\
**Replies:** 4\
**Last updated:** [August 6, 2007, 3:58am UTC](https://www.ruby-forum.com/t/doubts-on-char-patterns-into-string-each-argument/111324 "2007-08-06T03:58:07Z")

</div>

Hello Folks with a question I would like someone can clarify me: When I type the following code: “Substring1 Substring2 Substring3”.each( ‘\\s\*’ ) { | substring | puts “\[” + substring +"\]" } What I got is: \[Substrin…

---

## [JVM Languages group](https://www.ruby-forum.com/t/jvm-languages-group/111319)

<div class="topic-metadata">

**Author:** [@headius](https://www.ruby-forum.com/u/headius)\
**Replies:** 6\
**Last updated:** [August 6, 2007, 3:24am UTC](https://www.ruby-forum.com/t/jvm-languages-group/111319 "2007-08-06T03:24:01Z")

</div>

FYI, for the past couple months there’s been ongoing discussions on the JVM languages google group about how best to implement languages on the JVM. We’ve also started to consider what we need to do to pool efforts an…

---

## [How can I get HTML's varibles in embeded ruby?](https://www.ruby-forum.com/t/how-can-i-get-htmls-varibles-in-embeded-ruby/111300)

<div class="topic-metadata">

**Author:** [@Zhan\_feng\_W](https://www.ruby-forum.com/u/Zhan_feng_W)\
**Replies:** 5\
**Last updated:** [August 6, 2007, 1:29am UTC](https://www.ruby-forum.com/t/how-can-i-get-htmls-varibles-in-embeded-ruby/111300 "2007-08-06T01:29:17Z")

</div>

E.g.,I have following variables: myInput, DataFile,TagFile in the following segment HTML codes. Select Asn1 File: Select Asn1-bas File: If in PHP, I can easily get them by $…

---

## [Fwd: Please Forward: Ruby Quiz Submission](https://www.ruby-forum.com/t/fwd-please-forward-ruby-quiz-submission/229142)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 0\
**Last updated:** [August 6, 2007, 12:51am UTC](https://www.ruby-forum.com/t/fwd-please-forward-ruby-quiz-submission/229142 "2007-08-06T00:51:51Z")

</div>

Begin forwarded message:

---

## [Fwd: Pre-spoiler period solution for RubyQuiz #133](https://www.ruby-forum.com/t/fwd-pre-spoiler-period-solution-for-rubyquiz-133/198617)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 0\
**Last updated:** [August 6, 2007, 12:08am UTC](https://www.ruby-forum.com/t/fwd-pre-spoiler-period-solution-for-rubyquiz-133/198617 "2007-08-06T00:08:49Z")

</div>

Begin forwarded message:

---

## [DateTime irrationality](https://www.ruby-forum.com/t/datetime-irrationality/111258)

<div class="topic-metadata">

**Author:** [@tarazed](https://www.ruby-forum.com/u/tarazed)\
**Replies:** 5\
**Last updated:** [August 5, 2007, 11:07pm UTC](https://www.ruby-forum.com/t/datetime-irrationality/111258 "2007-08-05T23:07:46Z")

</div>

I am starting to recode several home applications in Ruby/GTK2 after 16 years of Tcl/Tk and a foray into Ruby/Tk territory. The simplest case would be my sidereal time widget which includes an Stime class, severely p…

---

## [Building rubygems without documentation](https://www.ruby-forum.com/t/building-rubygems-without-documentation/111266)

<div class="topic-metadata">

**Author:** [@Sy\_Ali](https://www.ruby-forum.com/u/Sy_Ali)\
**Replies:** 12\
**Last updated:** [August 5, 2007, 10:24pm UTC](https://www.ruby-forum.com/t/building-rubygems-without-documentation/111266 "2007-08-05T22:24:41Z")

</div>

I see no way to build rubygems without documentation. I checked the –help listing and ri and rdoc are not mentioned. I’m re-building rubygems on my zaurus again (because I updated ruby) and it’s taking forever to get…

---

## [APB for Kevin Howe](https://www.ruby-forum.com/t/apb-for-kevin-howe/111316)

<div class="topic-metadata">

**Author:** [@Trans](https://www.ruby-forum.com/u/Trans)\
**Replies:** 0\
**Last updated:** [August 5, 2007, 9:53pm UTC](https://www.ruby-forum.com/t/apb-for-kevin-howe/111316 "2007-08-05T21:53:38Z")

</div>

I’m trying to get a hold of Kevin Howe, of the Nemo project: http://rubyforge.org/projects/nemo/ Are you around? Anyone know where to locate him? Thanks, T.

---

## [Question about public key encryption](https://www.ruby-forum.com/t/question-about-public-key-encryption/111314)

<div class="topic-metadata">

**Author:** [@rubyer](https://www.ruby-forum.com/u/rubyer)\
**Replies:** 0\
**Last updated:** [August 5, 2007, 8:45pm UTC](https://www.ruby-forum.com/t/question-about-public-key-encryption/111314 "2007-08-05T20:45:31Z")

</div>

hello all, does anyone have the experience about public key encryption with ruby? I know how to use the module OpenSSL::PKey::RSA to create public/private key pair and encrypt/decrypt with the key pair. however, if I …

---

## [Object.private\_instance\_methods \<--- Kernel.singleton\_metho](https://www.ruby-forum.com/t/object-private-instance-methods-kernel-singleton-metho/111236)

<div class="topic-metadata">

**Author:** [@ronald\_braswell](https://www.ruby-forum.com/u/ronald_braswell)\
**Replies:** 4\
**Last updated:** [August 5, 2007, 6:38pm UTC](https://www.ruby-forum.com/t/object-private-instance-methods-kernel-singleton-metho/111236 "2007-08-05T18:38:21Z")

</div>

How do the Kernel.singleton\_methods get to be Object.private\_instance\_methods?

---

## [Re: Numbers Can Be Words (#133)](https://www.ruby-forum.com/t/re-numbers-can-be-words-133/111309)

<div class="topic-metadata">

**Author:** [@jameskelly](https://www.ruby-forum.com/u/jameskelly)\
**Replies:** 1\
**Last updated:** [August 5, 2007, 6:12pm UTC](https://www.ruby-forum.com/t/re-numbers-can-be-words-133/111309 "2007-08-05T18:12:20Z")

</div>

I found this Quiz to be extremely easy. I wrote this solution in a minute or two: dict = File.open(“wordlist.txt”){|f| f.readlines.reject {|word| (‘A’…‘Z’) === word\[0,1\]}} base = ARGV\[0\].to\_i puts dict.select{|word|…

---

## [133](https://www.ruby-forum.com/t/topic/111311)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [August 5, 2007, 5:59pm UTC](https://www.ruby-forum.com/t/topic/111311 "2007-08-05T17:59:19Z")

</div>

Hi, here is my solution. #!/usr/bin/env ruby exit if ARGV.size \< 1 base = ARGV\[0\].to\_i length = ARGV\[1\].to\_i || 0 IO.foreach “/usr/share/dict/american-english” do |line| if (length \> 0 and line.chomp.length == len…

---

## [RDoc i18n$B2=%Q%C%A(B](https://www.ruby-forum.com/t/rdoc-i18n-b2-q-c-a-b/111253)

<div class="topic-metadata">

**Author:** [@KURODA\_Hiraku](https://www.ruby-forum.com/u/KURODA_Hiraku)\
**Replies:** 2\
**Last updated:** [August 5, 2007, 5:20pm UTC](https://www.ruby-forum.com/t/rdoc-i18n-b2-q-c-a-b/111253 "2007-08-05T17:20:12Z")

</div>

é»’ç”° æ‹“ ã¨è¨€ã„ã¾ã™ã€‚ å€‹äººçš„ãªå¿…è¦ã«ã‹ã‚‰ã‚Œã¦ã€RDocã‚’i18nåŒ–ã—ã¦ã¿ã¾ã—ãŸã€‚ãƒ‘ãƒƒãƒã¯1.8.6-p36ã«å¯¾ ã™ã‚‹ã‚‚ã®ã§ã™ã€‚ Rubyã®ã‚½ãƒ¼ã‚¹ã«æ¬¡ã®è¦é ˜ã§è¤‡æ•°ã®è¨€èªžã§è¨˜è¿°ã—ãŸã‚…

---

## [Reloading a web page](https://www.ruby-forum.com/t/reloading-a-web-page/111296)

<div class="topic-metadata">

**Author:** [@rorjeff](https://www.ruby-forum.com/u/rorjeff)\
**Replies:** 1\
**Last updated:** [August 5, 2007, 1:20pm UTC](https://www.ruby-forum.com/t/reloading-a-web-page/111296 "2007-08-05T13:20:55Z")

</div>

I am trying to load up some stock charts for a quick review. I can load the pages without a problem. However I get three open pages where I want to open and then reload. Any thoughts? The following give this error…

---

## [Deployable project with C source code](https://www.ruby-forum.com/t/deployable-project-with-c-source-code/111114)

<div class="topic-metadata">

**Author:** [@learningruby](https://www.ruby-forum.com/u/learningruby)\
**Replies:** 14\
**Last updated:** [August 5, 2007, 9:38am UTC](https://www.ruby-forum.com/t/deployable-project-with-c-source-code/111114 "2007-08-05T09:38:35Z")

</div>

Hi. Ruby novice here. So far, I have had a great experience programming Ruby where I have only been relying on the standard library. Lately, I have been wanting to tie some of my tools into a nice GUI using QT or Tk…

---

## [SuperCaller 1.0.0 Released](https://www.ruby-forum.com/t/supercaller-1-0-0-released/111297)

<div class="topic-metadata">

**Author:** [@miracleofmagick](https://www.ruby-forum.com/u/miracleofmagick)\
**Replies:** 2\
**Last updated:** [August 5, 2007, 9:37am UTC](https://www.ruby-forum.com/t/supercaller-1-0-0-released/111297 "2007-08-05T09:37:35Z")

</div>

SuperCaller version 1.0.0 has been released! SuperCaller adds a beefed-up version of Kernel#caller and a beefed up version of Exception#backtrace. require ‘super\_caller’ def something() super\_caller end stack = some…

---

## [Rweb 0.1.0](https://www.ruby-forum.com/t/rweb-0-1-0/111289)

<div class="topic-metadata">

**Author:** [@Michael\_TSRichter](https://www.ruby-forum.com/u/Michael_TSRichter)\
**Replies:** 2\
**Last updated:** [August 5, 2007, 7:20am UTC](https://www.ruby-forum.com/t/rweb-0-1-0/111289 "2007-08-05T07:20:26Z")

</div>

RWEB is a literate programming tool for Ruby patterned after Donald Knuth’s WEB system. It will, eventually, feature: \* self-tangling executable scripts \* an external, manual tangling utility \* an external, manu…

---

## [Array#\[\]=(pos, length, val) and Array#\[\]=(range, val)](https://www.ruby-forum.com/t/array-pos-length-val-and-array-range-val/111299)

<div class="topic-metadata">

**Author:** [@sheepman](https://www.ruby-forum.com/u/sheepman)\
**Replies:** 0\
**Last updated:** [August 5, 2007, 7:10am UTC](https://www.ruby-forum.com/t/array-pos-length-val-and-array-range-val/111299 "2007-08-05T07:10:26Z")

</div>

e$B$3$s$K$A$O!"e(Bsheepman e$B$G$9!#e(B e$BKhEY$N$3$H$G$9$,!"%j%U%!%l%s%9$rJT=8$7$F$$$F5$$K$J$C$?$3$H$G$9!#e(B Array#\[\]=(pos, length, val) e$B$Ne(B length e$B$Ke(B 0 e$B$r;XDj$7$?\>l9g!“e(B pos e$B$ND\>A0$Ke(B val e$B$…

---

## [Ruby on the iPhone](https://www.ruby-forum.com/t/ruby-on-the-iphone/111283)

<div class="topic-metadata">

**Author:** [@skade](https://www.ruby-forum.com/u/skade)\
**Replies:** 1\
**Last updated:** [August 5, 2007, 1:26am UTC](https://www.ruby-forum.com/t/ruby-on-the-iphone/111283 "2007-08-05T01:26:11Z")

</div>

Hi, just a quick note to let everyone know that it is now possible to run Ruby on the iPhone: Terminal App: Google Code Archive - Long-term storage for Google Code Project Hosting. Ruby binaries: http://iphone.natetr…

---

## [Followup question on defining methods dynamically](https://www.ruby-forum.com/t/followup-question-on-defining-methods-dynamically/111225)

<div class="topic-metadata">

**Author:** [@Kenneth\_McDonald](https://www.ruby-forum.com/u/Kenneth_McDonald)\
**Replies:** 5\
**Last updated:** [August 5, 2007, 1:03am UTC](https://www.ruby-forum.com/t/followup-question-on-defining-methods-dynamically/111225 "2007-08-05T01:03:09Z")

</div>

Simple example that doesn’t work: module Test p “Testing” eval(“def foo\\np ‘OK’\\nend”) foo end ‘foo’ does not get defined in a place where it can be found by the call on foo, and I get an error. However, when I ex…

---

## [IO.popen with an array in trunk](https://www.ruby-forum.com/t/io-popen-with-an-array-in-trunk/111241)

<div class="topic-metadata">

**Author:** [@sheepman](https://www.ruby-forum.com/u/sheepman)\
**Replies:** 1\
**Last updated:** [August 4, 2007, 9:57pm UTC](https://www.ruby-forum.com/t/io-popen-with-an-array-in-trunk/111241 "2007-08-04T21:57:56Z")

</div>

e$B$3$s$K$A$O!"e(Bsheepman e$B$G$9!#e(B e$B%j%U%!%l%s%9$rJT=8$7$F$$$F5$$K$J$C$?$3$H$G$9!#e(B ruby-1.9 e$B$Ne(B IO.popen e$B$NBhe(B1e$B0z?t$KG\[Ns$rM?$($?\>l9g!"e(B e$B%j%U%!%l%s%9$G$Oe(B http://www.ruby-lang.org/ja/man…

---

## [C ext to Ruby interaction between a Module and a Class](https://www.ruby-forum.com/t/c-ext-to-ruby-interaction-between-a-module-and-a-class/111166)

<div class="topic-metadata">

**Author:** [@unbewust](https://www.ruby-forum.com/u/unbewust)\
**Replies:** 8\
**Last updated:** [August 4, 2007, 9:49pm UTC](https://www.ruby-forum.com/t/c-ext-to-ruby-interaction-between-a-module-and-a-class/111166 "2007-08-04T21:49:55Z")

</div>

I’m presently writing C extension to Ruby (under and for Mac OS X). i do have a Ruby Module called “ROSXUtils” and i want to return a class coming from another C ext to Ruby. The class being RAliasFile. i don’t know e…

---

## [PHP.unserialize's strange behaviour](https://www.ruby-forum.com/t/php-unserializes-strange-behaviour/110958)

<div class="topic-metadata">

**Author:** [@milo](https://www.ruby-forum.com/u/milo)\
**Replies:** 2\
**Last updated:** [August 4, 2007, 9:33pm UTC](https://www.ruby-forum.com/t/php-unserializes-strange-behaviour/110958 "2007-08-04T21:33:14Z")

</div>

I have some code that needs to obtain information from a web service in the form of an array of values to be plotted as a graph. The data I need come back in the form of a string, as seen at http://users.ox.ac.uk/~lin…

---

## [Method\_added hook and class methods](https://www.ruby-forum.com/t/method-added-hook-and-class-methods/111153)

<div class="topic-metadata">

**Author:** [@krat](https://www.ruby-forum.com/u/krat)\
**Replies:** 4\
**Last updated:** [August 4, 2007, 7:54pm UTC](https://www.ruby-forum.com/t/method-added-hook-and-class-methods/111153 "2007-08-04T19:54:46Z")

</div>

Hello all, I am puzzled at some behavior I recently observed in ruby. I searched the archives and google and didn’t see an answer, so I am asking here: First I want to observe when instance methods are defined in a cl…

---

## [From method redefinition to classless Ruby](https://www.ruby-forum.com/t/from-method-redefinition-to-classless-ruby/111133)

<div class="topic-metadata">

**Author:** [@flatekmonkey](https://www.ruby-forum.com/u/flatekmonkey)\
**Replies:** 5\
**Last updated:** [August 4, 2007, 6:25pm UTC](https://www.ruby-forum.com/t/from-method-redefinition-to-classless-ruby/111133 "2007-08-04T18:25:41Z")

</div>

Hi list Ara’s post about method redefinition was extremely rich intellectual food, took some time to digest, but I just thought I share my findings with you. http://ruby-smalltalk.blogspot.com/ Cheers Robert

---

## [How does Hpricot ... inner\_text work?](https://www.ruby-forum.com/t/how-does-hpricot-inner-text-work/111237)

<div class="topic-metadata">

**Author:** [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Replies:** 1\
**Last updated:** [August 4, 2007, 5:34pm UTC](https://www.ruby-forum.com/t/how-does-hpricot-inner-text-work/111237 "2007-08-04T17:34:38Z")

</div>

Rubies: require ‘hpricot’ hdoc = Hpricot(‘nopeb xml’) nope p hdoc.inner\_text nope p hdoc.root.inner\_text nope p hdoc.children.first.inner\_text p hdoc.get\_elements\_by\_tag\_name # \<Hpricot::Elements\[ p hdoc.get\_element…

---

## [Help: Matching last character of a string!](https://www.ruby-forum.com/t/help-matching-last-character-of-a-string/111259)

<div class="topic-metadata">

**Author:** [@astroruby](https://www.ruby-forum.com/u/astroruby)\
**Replies:** 1\
**Last updated:** [August 4, 2007, 5:30pm UTC](https://www.ruby-forum.com/t/help-matching-last-character-of-a-string/111259 "2007-08-04T17:30:38Z")

</div>

Hi, I am trying to replace the last character of a string with another character: x = “{Hello {hello}}” x.sub!(/}$/, “\]”) puts x With Ruby 1.8.5 (on Windows) this gives (as expected) {Hello {hello}\] With Ruby 1.8…

---

## [Percentage in Ruby](https://www.ruby-forum.com/t/percentage-in-ruby/111224)

<div class="topic-metadata">

**Author:** [@alex-osu3](https://www.ruby-forum.com/u/alex-osu3)\
**Replies:** 5\
**Last updated:** [August 4, 2007, 4:20pm UTC](https://www.ruby-forum.com/t/percentage-in-ruby/111224 "2007-08-04T16:20:28Z")

</div>

Hi all, How to write percentage in Ruby, for instance 1.2%? Do I have to change it to 0.012 before I apply other operation on it? It looks like “%” is used for other purpose in Ruby. Thanks, Li

---

## [Running multiple closures per iteration](https://www.ruby-forum.com/t/running-multiple-closures-per-iteration/111200)

<div class="topic-metadata">

**Author:** [@syncopated](https://www.ruby-forum.com/u/syncopated)\
**Replies:** 6\
**Last updated:** [August 4, 2007, 1:21pm UTC](https://www.ruby-forum.com/t/running-multiple-closures-per-iteration/111200 "2007-08-04T13:21:15Z")

</div>

Is there a way to run more than one closure per iteration through a collection? For example, if I want to do the following two things, can I combine them so that I only end up with one pass over the collection, witho…

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

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