# Ruby

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

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

---

## [How to put alert messages on changing screen access](https://www.ruby-forum.com/t/how-to-put-alert-messages-on-changing-screen-access/114666)

<div class="topic-metadata">

**Author:** [@pragati](https://www.ruby-forum.com/u/pragati)\
**Replies:** 1\
**Last updated:** [September 17, 2007, 10:09pm UTC](https://www.ruby-forum.com/t/how-to-put-alert-messages-on-changing-screen-access/114666 "2007-09-17T22:09:44Z")

</div>

Hi, I have a small application. I have two features for instance, NEW and SEARCH. When a user presses NEW, he’s supposed to enter around 14 entries in the form. Now, let’s take he entered 8 entries and switches to S…

---

## [Group array elements in groups of two](https://www.ruby-forum.com/t/group-array-elements-in-groups-of-two/114799)

<div class="topic-metadata">

**Author:** [@emmanueloga](https://www.ruby-forum.com/u/emmanueloga)\
**Replies:** 12\
**Last updated:** [September 17, 2007, 10:05pm UTC](https://www.ruby-forum.com/t/group-array-elements-in-groups-of-two/114799 "2007-09-17T22:05:43Z")

</div>

A better way to do this? : arr= \[1, 2, 3, 4, 5, 6, 7, 8\] new= \[\] while !arr.empty? elem1, elem2= arr.pop, arr.pop new \<\< \[elem2, elem1\]; end new.reverse! new= \[\[1, 2\], \[3, 4\], \[5, 6\], \[7, 8\]\] Thanks!

---

## [Python-style decorators](https://www.ruby-forum.com/t/python-style-decorators/111231)

<div class="topic-metadata">

**Author:** [@krat](https://www.ruby-forum.com/u/krat)\
**Replies:** 34\
**Last updated:** [September 17, 2007, 9:59pm UTC](https://www.ruby-forum.com/t/python-style-decorators/111231 "2007-09-17T21:59:43Z")

</div>

I’ve been using ruby for about 8 months now and I’ve come to appreciate its powerful features. But I miss python’s decorators, so I made something similar. The code is attached; here are some examples. It’s really eas…

---

## [Using user supplied string String#include?](https://www.ruby-forum.com/t/using-user-supplied-string-string-include/114801)

<div class="topic-metadata">

**Author:** [@Tobi\_R](https://www.ruby-forum.com/u/Tobi_R)\
**Replies:** 1\
**Last updated:** [September 17, 2007, 9:49pm UTC](https://www.ruby-forum.com/t/using-user-supplied-string-string-include/114801 "2007-09-17T21:49:35Z")

</div>

Hi In a web app that will soon be out there in the vast and partially evil web, I might take a string which a user supplied via an HTML form, and use it roughly like this: some\_str.downcase.include?(user\_supplied\_str…

---

## [Where is wrong with contoller test?](https://www.ruby-forum.com/t/where-is-wrong-with-contoller-test/114576)

<div class="topic-metadata">

**Author:** [@zlai](https://www.ruby-forum.com/u/zlai)\
**Replies:** 3\
**Last updated:** [September 17, 2007, 8:21pm UTC](https://www.ruby-forum.com/t/where-is-wrong-with-contoller-test/114576 "2007-09-17T20:21:30Z")

</div>

Hi, everybody! I got a strange question when I did a controller test as below On controller.rb: def send\_welcome\_message(person) some codes; end there ‘person’ is instance variables. the controller\_test.rb: def t…

---

## [Run script against every file in a directory](https://www.ruby-forum.com/t/run-script-against-every-file-in-a-directory/114587)

<div class="topic-metadata">

**Author:** [@farfignugen](https://www.ruby-forum.com/u/farfignugen)\
**Replies:** 4\
**Last updated:** [September 17, 2007, 7:41pm UTC](https://www.ruby-forum.com/t/run-script-against-every-file-in-a-directory/114587 "2007-09-17T19:41:06Z")

</div>

Hi, I’m currently tryin to implement a ruby script which will run through a directory of javascript files and run jsmin.rb against each of them as a part of my build script. im running into a number of silly issues so…

---

## [Re: I need serious help!](https://www.ruby-forum.com/t/re-i-need-serious-help/109289)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 23\
**Last updated:** [September 17, 2007, 7:31pm UTC](https://www.ruby-forum.com/t/re-i-need-serious-help/109289 "2007-09-17T19:31:04Z")

</div>

Its an example of how to code one, and whys guide is free, so two birds. Although i dont know if you’d want to just skip to it without reading the guide a bit first.

---

## [OpenGL?](https://www.ruby-forum.com/t/opengl/114808)

<div class="topic-metadata">

**Author:** [@ululul](https://www.ruby-forum.com/u/ululul)\
**Replies:** 2\
**Last updated:** [September 17, 2007, 7:28pm UTC](https://www.ruby-forum.com/t/opengl/114808 "2007-09-17T19:28:03Z")

</div>

Hi all! Please, help me to choose the best library for general OpenGL programming with Ruby… Thanx!

---

## [3D-gfx + snd programming (like demoscene)](https://www.ruby-forum.com/t/3d-gfx-snd-programming-like-demoscene/114810)

<div class="topic-metadata">

**Author:** [@ululul](https://www.ruby-forum.com/u/ululul)\
**Replies:** 0\
**Last updated:** [September 17, 2007, 7:21pm UTC](https://www.ruby-forum.com/t/3d-gfx-snd-programming-like-demoscene/114810 "2007-09-17T19:21:03Z")

</div>

Sorry, i’ve decided that i need any help in subj for Ruby…

---

## [Launchy 0.3.1 Released](https://www.ruby-forum.com/t/launchy-0-3-1-released/114176)

<div class="topic-metadata">

**Author:** [@jeremyheiler](https://www.ruby-forum.com/u/jeremyheiler)\
**Replies:** 1\
**Last updated:** [September 17, 2007, 6:55pm UTC](https://www.ruby-forum.com/t/launchy-0-3-1-released/114176 "2007-09-17T18:55:58Z")

</div>

launchy version 0.3.1 has been released. http://copiousfreetime.rubyforge.org/launchy/ This release adds nothing new to the library. It updates the command line launchy program with useful parameters to allow for det…

---

## [Creating Arrays](https://www.ruby-forum.com/t/creating-arrays/114806)

<div class="topic-metadata">

**Author:** [@jngo](https://www.ruby-forum.com/u/jngo)\
**Replies:** 0\
**Last updated:** [September 17, 2007, 6:45pm UTC](https://www.ruby-forum.com/t/creating-arrays/114806 "2007-09-17T18:45:57Z")

</div>

Dear All,\<?xml:namespace prefix = o ns = “urn:schemas-microsoft-com:office:office” /\> Please forgive me if this email is a bit simple, but I am new to ruby and object orientated programming pretty much and just lookin…

---

## [String literal encoding](https://www.ruby-forum.com/t/string-literal-encoding/113612)

<div class="topic-metadata">

**Author:** [@nobu](https://www.ruby-forum.com/u/nobu)\
**Replies:** 11\
**Last updated:** [September 17, 2007, 6:30pm UTC](https://www.ruby-forum.com/t/string-literal-encoding/113612 "2007-09-17T18:30:54Z")

</div>

e$B$J$+$@$G$9!#e(B -- coding: euc-jp -- e$B$J$I$H$7$F$\*$/$H!"$9$Y$F$NJ8;zNs%j%F%i%ke(B e$B$Ne(Bencodinge$B$,e(B"EUC-JP"e$B$K$J$C$F$$$^$9$,!"e(BASCIIe$B$N$\_$+$i$J$kJ8;zNs$Ne(B e$B\>l9g$Oe(BUS-ASCIIe$B$N$^$^$N$\[$&$,JXMx$…

---

## [Is possible to edit text field in console?](https://www.ruby-forum.com/t/is-possible-to-edit-text-field-in-console/114597)

<div class="topic-metadata">

**Author:** [@tbcox23](https://www.ruby-forum.com/u/tbcox23)\
**Replies:** 6\
**Last updated:** [September 17, 2007, 5:27pm UTC](https://www.ruby-forum.com/t/is-possible-to-edit-text-field-in-console/114597 "2007-09-17T17:27:47Z")

</div>

A beginner question for sure, but one on which I’m stuck: I’m trying to determine if it’s possible, by any means whatsoever, to display a line of text on the console and allow the user to edit it, before pressing Ente…

---

## [Gosu 0.7.5](https://www.ruby-forum.com/t/gosu-0-7-5/114792)

<div class="topic-metadata">

**Author:** [@nex4k](https://www.ruby-forum.com/u/nex4k)\
**Replies:** 2\
**Last updated:** [September 17, 2007, 4:36pm UTC](https://www.ruby-forum.com/t/gosu-0-7-5/114792 "2007-09-17T16:36:38Z")

</div>

Hi, for those interested in game/multimedia programming, Gosu 0.7.5 has just been released! When using RubyGems, don’t be surprised if you see both 0.7.5 and 0.7.5.1; the latter changes a bug with the Gem packaging, …

---

## [Split](https://www.ruby-forum.com/t/split/114591)

<div class="topic-metadata">

**Author:** [@jarvo88](https://www.ruby-forum.com/u/jarvo88)\
**Replies:** 10\
**Last updated:** [September 17, 2007, 3:13pm UTC](https://www.ruby-forum.com/t/split/114591 "2007-09-17T15:13:32Z")

</div>

Ok guys im looking for something sexy to split this HTML (This HAS to be done using split, nothing else) hi, there, fred, I would like to split them values into an array, Is there any chance this can be done? Because…

---

## [Net/http: path.empty? was removed when path is nil](https://www.ruby-forum.com/t/net-http-path-empty-was-removed-when-path-is-nil/108729)

<div class="topic-metadata">

**Author:** [@NARUSES\_Yui](https://www.ruby-forum.com/u/NARUSES_Yui)\
**Replies:** 1\
**Last updated:** [September 17, 2007, 2:09pm UTC](https://www.ruby-forum.com/t/net-http-path-empty-was-removed-when-path-is-nil/108729 "2007-09-17T14:09:48Z")

</div>

e$B@.@%$G$9!#e(B Net::HTTP e$B$G$9$,!"e(Bpath e$B$,e(B nil e$B$N;~$Ke(B ArgumentError e$B$rEj$2$kA0$Ke(B nil.empty? e$B$G$3$1$^$9!#e(B Index: lib/net/http.rb — lib/net/http.rb (revision 12716) +++ lib/net/http.r…

---

## [rstrip$B$,(Bstrip$B$7$9$.$k(B](https://www.ruby-forum.com/t/rstrip-b-bstrip-b-7-9-k-b/114665)

<div class="topic-metadata">

**Author:** [@Kouhei\_S](https://www.ruby-forum.com/u/Kouhei_S)\
**Replies:** 1\
**Last updated:** [September 17, 2007, 1:25pm UTC](https://www.ruby-forum.com/t/rstrip-b-bstrip-b-7-9-k-b/114665 "2007-09-17T13:25:42Z")

</div>

e$B?\\F#$G$9!#e(B e$BESCf$K6uGr$O$"$k$,!":G8e$O6uGr$G=\*$o$C$F$$$J$$J8;zNs$rEO$9$H!"e(B rstripe$B$,I,MW0J\>e$Ke(Bstripe$B$7$^$9!#e(B % /tmp/local/bin/ruby -v -e ‘p “a b”.rstrip’ ruby 1.9.0 (2007-09-14 patchlevel 0) \[x86…

---

## [Screen scraping programaticprogrammer.com?](https://www.ruby-forum.com/t/screen-scraping-programaticprogrammer-com/114502)

<div class="topic-metadata">

**Author:** [@7stud](https://www.ruby-forum.com/u/7stud)\
**Replies:** 4\
**Last updated:** [September 17, 2007, 1:25pm UTC](https://www.ruby-forum.com/t/screen-scraping-programaticprogrammer-com/114502 "2007-09-17T13:25:41Z")

</div>

The following is from “Programming Ruby 2nd” p.133: require “net/http” h = Net::HTTP.new(“www.programaticprogrammer.com”, 80) response = h.get(“/index.html”) if response.message == “OK” puts response.body.scan(/\<i…

---

## [How to define a function-generating function?](https://www.ruby-forum.com/t/how-to-define-a-function-generating-function/114690)

<div class="topic-metadata">

**Author:** [@Josip\_G](https://www.ruby-forum.com/u/Josip_G)\
**Replies:** 2\
**Last updated:** [September 17, 2007, 1:25pm UTC](https://www.ruby-forum.com/t/how-to-define-a-function-generating-function/114690 "2007-09-17T13:25:39Z")

</div>

Hello! A newbie question. Here’s what I’d like to be able to do. #============================================ def\_init\_function( :system\_init ) do |x,y| …something… end def\_init\_function( :timers\_init ) do |a| ……

---

## [PDF:Writer pages landscape and portrait](https://www.ruby-forum.com/t/pdf-writer-pages-landscape-and-portrait/114533)

<div class="topic-metadata">

**Author:** [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Replies:** 3\
**Last updated:** [September 17, 2007, 1:25pm UTC](https://www.ruby-forum.com/t/pdf-writer-pages-landscape-and-portrait/114533 "2007-09-17T13:25:35Z")

</div>

Hi, Im creating a PDF report and throughout the PDF document there will be some pages that need to be landscape and some that need to portrait. I cant seem to find any documentation about inserting pages in the docu…

---

## [Confusion over 1.8.5 and 1.8.6 behavior of private](https://www.ruby-forum.com/t/confusion-over-1-8-5-and-1-8-6-behavior-of-private/114634)

<div class="topic-metadata">

**Author:** [@kevben](https://www.ruby-forum.com/u/kevben)\
**Replies:** 1\
**Last updated:** [September 17, 2007, 1:25pm UTC](https://www.ruby-forum.com/t/confusion-over-1-8-5-and-1-8-6-behavior-of-private/114634 "2007-09-17T13:25:30Z")

</div>

I noticed some interesting behavior when implementing some metaprogramming techniques with private. This is dependent on why’s metaid gem/library. I have included metaid at the end in case folks are not familiar with …

---

## [Gem install mysql mystery](https://www.ruby-forum.com/t/gem-install-mysql-mystery/114553)

<div class="topic-metadata">

**Author:** [@pitosalas](https://www.ruby-forum.com/u/pitosalas)\
**Replies:** 1\
**Last updated:** [September 17, 2007, 1:25pm UTC](https://www.ruby-forum.com/t/gem-install-mysql-mystery/114553 "2007-09-17T13:25:29Z")

</div>

sudo gem install mysql Select which gem to install for your platform (powerpc-darwin8.8.0) mysql 2.7.3 (mswin32) mysql 2.7.1 (mswin32) mysql 2.7 (ruby) mysql 2.6 (ruby) Skip this gem Cancel installation 3 ERROR: W…

---

## ["string"\[/str/\]=:not\_string dumps core](https://www.ruby-forum.com/t/string-str-not-string-dumps-core/114675)

<div class="topic-metadata">

**Author:** [@nobu](https://www.ruby-forum.com/u/nobu)\
**Replies:** 2\
**Last updated:** [September 17, 2007, 1:25pm UTC](https://www.ruby-forum.com/t/string-str-not-string-dumps-core/114675 "2007-09-17T13:25:25Z")

</div>

e$B$J$+$@$G$9!#e(B http://yowaken.dip.jp/tdiary/20070908.html#p05 e$B$N7o$N%Q%C%A$G$9!#e(B ENCODING\_\*e$B%^%/%m$Oe(BT\_STRINGe$B8BDj$H$$$&$3$H$G$9$h$M!#e(B Index: encoding.c — encoding.c (revision 13443) +++ encoding…

---

## [Lotus notes and Ruby](https://www.ruby-forum.com/t/lotus-notes-and-ruby/114698)

<div class="topic-metadata">

**Author:** [@ruby\_soho](https://www.ruby-forum.com/u/ruby_soho)\
**Replies:** 1\
**Last updated:** [September 17, 2007, 1:25pm UTC](https://www.ruby-forum.com/t/lotus-notes-and-ruby/114698 "2007-09-17T13:25:24Z")

</div>

I saw in the post http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/171217 that you can use win32ole to call Lotus Notes client, but does anybody know how to fill in the password? Thanks Joyce

---

## [Question about instance\_eval, dynamic methods and blocks](https://www.ruby-forum.com/t/question-about-instance-eval-dynamic-methods-and-blocks/114547)

<div class="topic-metadata">

**Author:** [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Replies:** 1\
**Last updated:** [September 17, 2007, 1:25pm UTC](https://www.ruby-forum.com/t/question-about-instance-eval-dynamic-methods-and-blocks/114547 "2007-09-17T13:25:24Z")

</div>

Not sure if I am attacking this correctly or not, so if anyone has any insight, please assist. Let me setup my situation class Task attr\_reader :name def initialize(name, &block) @name = name instance\_eval \<\<-EOL …

---

## [Debug](https://www.ruby-forum.com/t/debug/114494)

<div class="topic-metadata">

**Author:** [@coolgeng\_coolgeng](https://www.ruby-forum.com/u/coolgeng_coolgeng)\
**Replies:** 9\
**Last updated:** [September 17, 2007, 1:25pm UTC](https://www.ruby-forum.com/t/debug/114494 "2007-09-17T13:25:22Z")

</div>

With the Rails, I build a project connecting the MySQL. But When I change the password access in database. I can not access in the project. Then I check the database.yml file. And change the username and password. Bu…

---

## [Singleton pattern vs Class variables and methods](https://www.ruby-forum.com/t/singleton-pattern-vs-class-variables-and-methods/114589)

<div class="topic-metadata">

**Author:** [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Replies:** 1\
**Last updated:** [September 17, 2007, 1:25pm UTC](https://www.ruby-forum.com/t/singleton-pattern-vs-class-variables-and-methods/114589 "2007-09-17T13:25:21Z")

</div>

There seems to be a big thing about the Singleton Pattern… and the way to implement it, but what about just using class variables and class methods to do the job? So for example, the class Jukebox can have an object L…

---

## [Define method hook](https://www.ruby-forum.com/t/define-method-hook/114676)

<div class="topic-metadata">

**Author:** [@brblakley](https://www.ruby-forum.com/u/brblakley)\
**Replies:** 3\
**Last updated:** [September 17, 2007, 1:25pm UTC](https://www.ruby-forum.com/t/define-method-hook/114676 "2007-09-17T13:25:15Z")

</div>

Is there a way to intercept method defines, so that i can setup a callback whenever a new method is defined for a class? I’m looking for something that works with the def keyword, and doesn’t require any extensions. …

---

## [What is relation between ruby-talk and comp.lang.ruby](https://www.ruby-forum.com/t/what-is-relation-between-ruby-talk-and-comp-lang-ruby/114660)

<div class="topic-metadata">

**Author:** [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Replies:** 1\
**Last updated:** [September 17, 2007, 1:25pm UTC](https://www.ruby-forum.com/t/what-is-relation-between-ruby-talk-and-comp-lang-ruby/114660 "2007-09-17T13:25:15Z")

</div>

when i email to ruby-talk, then the Google Ruby T. forum has my posting… but the comp.lang.ruby doesn’t show it and then when other awesome users relied my email, the answers showed up in my email, in Google Ruby T.…

---

## [Open Forum 4 ALL](https://www.ruby-forum.com/t/open-forum-4-all/114756)

<div class="topic-metadata">

**Author:** [@FRASITE](https://www.ruby-forum.com/u/FRASITE)\
**Replies:** 0\
**Last updated:** [September 17, 2007, 1:25pm UTC](https://www.ruby-forum.com/t/open-forum-4-all/114756 "2007-09-17T13:25:14Z")

</div>

Opened Forum ! http://sqlwarrior.freehostia.com/forum SQL Warrior Forum The most opened forum on the world ! Every one can join and asks question, expert will reply ! Discussion about SQL, Dotnet and VB… Job seeker …

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

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