# Ruby

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

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

---

## [Feature request: "make uninstall"](https://www.ruby-forum.com/t/feature-request-make-uninstall/58072)

<div class="topic-metadata">

**Author:** [@John\_MSGabriele](https://www.ruby-forum.com/u/John_MSGabriele)\
**Replies:** 2\
**Last updated:** [April 18, 2006, 8:49am UTC](https://www.ruby-forum.com/t/feature-request-make-uninstall/58072 "2006-04-18T08:49:41Z")

</div>

Hi, I think it would be occasionally very useful if Ruby’s makefile had a make uninstall target. From what little I know of the automake/autoconf tools, this make not be a very difficult target to add. I realize tha…

---

## [Article: Understanding Ruby blocks, Procs and methods](https://www.ruby-forum.com/t/article-understanding-ruby-blocks-procs-and-methods/58078)

<div class="topic-metadata">

**Author:** [@eliben](https://www.ruby-forum.com/u/eliben)\
**Replies:** 0\
**Last updated:** [April 18, 2006, 8:37am UTC](https://www.ruby-forum.com/t/article-understanding-ruby-blocks-procs-and-methods/58078 "2006-04-18T08:37:21Z")

</div>

Hi all, Finding myself utterly confused by the various approaches Ruby has to blocks of code, I did some research which resulted in an article: “Understanding Ruby blocks, Procs and methods” which I posted here: http…

---

## [Beginner Question - ?/](https://www.ruby-forum.com/t/beginner-question/58063)

<div class="topic-metadata">

**Author:** [@Bihal](https://www.ruby-forum.com/u/Bihal)\
**Replies:** 3\
**Last updated:** [April 18, 2006, 6:02am UTC](https://www.ruby-forum.com/t/beginner-question/58063 "2006-04-18T06:02:20Z")

</div>

Hey guys Found a strange piece of code I haven’t run into before. def redirect\_to\_directory\_uri(req, res) if req.path\[-1\] != ?/ location = req.path + "/" if req.query\_string && req.query\_string.size \> …

---

## [A simple RSA](https://www.ruby-forum.com/t/a-simple-rsa/93993)

<div class="topic-metadata">

**Author:** [@Shannon\_F](https://www.ruby-forum.com/u/Shannon_F)\
**Replies:** 3\
**Last updated:** [April 18, 2006, 5:39am UTC](https://www.ruby-forum.com/t/a-simple-rsa/93993 "2006-04-18T05:39:43Z")

</div>

Hi All, I tried to implement a simple RSA crypto for my work. It seems all works fine, except that I am not satisfied with the code I wrote below: def str\_to\_num(s) h = ‘0x’ (0…s.length).each do |i| h += “%02x” % s…

---

## [Net::FTP broken on OS X (Tiger) / Ruby 1.8.2](https://www.ruby-forum.com/t/net-ftp-broken-on-os-x-tiger-ruby-1-8-2/57971)

<div class="topic-metadata">

**Author:** [@subimage](https://www.ruby-forum.com/u/subimage)\
**Replies:** 6\
**Last updated:** [April 18, 2006, 5:32am UTC](https://www.ruby-forum.com/t/net-ftp-broken-on-os-x-tiger-ruby-1-8-2/57971 "2006-04-18T05:32:06Z")

</div>

I’m running Ruby 1.8.2 on my Tiger machine. I’m trying to use Net::FTP on the machine. I can login to the server fine, but when I try a ftp.list IRB just hangs, then gives me something like this: Net::FTPTempError: 4…

---

## [URI#path, windows, and file urls](https://www.ruby-forum.com/t/uri-path-windows-and-file-urls/94005)

<div class="topic-metadata">

**Author:** [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Replies:** 2\
**Last updated:** [April 18, 2006, 4:23am UTC](https://www.ruby-forum.com/t/uri-path-windows-and-file-urls/94005 "2006-04-18T04:23:25Z")

</div>

Hi all, Ruby 1.8.4 Windows XP Is this correct? require ‘uri’ URI.parse(“file:///C:/foo/bar”).path # =\> “/C:/foo/bar” The leading slash seems wrong to me, but then I’m not familiar with the RFC’s that cover such th…

---

## [Ruby-VPI 0.2](https://www.ruby-forum.com/t/ruby-vpi-0-2/94017)

<div class="topic-metadata">

**Author:** [@Suraj\_NSKurapati](https://www.ruby-forum.com/u/Suraj_NSKurapati)\
**Replies:** 0\
**Last updated:** [April 18, 2006, 1:32am UTC](https://www.ruby-forum.com/t/ruby-vpi-0-2/94017 "2006-04-18T01:32:28Z")

</div>

\-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ruby-VPI 0.2 has been released. http://ruby-vpi.rubyforge.org/ === What is Ruby-VPI? === Ruby-VPI is a Ruby extension for Verilog VPI which lets you create complex Veri…

---

## [Re: Full paths of Ruby interpreter and running script](https://www.ruby-forum.com/t/re-full-paths-of-ruby-interpreter-and-running-script/58048)

<div class="topic-metadata">

**Author:** [@William\_SBillS\_Froe](https://www.ruby-forum.com/u/William_SBillS_Froe)\
**Replies:** 0\
**Last updated:** [April 17, 2006, 11:54pm UTC](https://www.ruby-forum.com/t/re-full-paths-of-ruby-interpreter-and-running-script/58048 "2006-04-17T23:54:29Z")

</div>

Well the full path to the running script is easy enough to get from within Ruby and based on your needs might suffice for finding the configuration file at runtime. puts File.expand\_path(FILE) # c:/rubytest/test.rb …

---

## [Re: Beginner gsub and ri questions](https://www.ruby-forum.com/t/re-beginner-gsub-and-ri-questions/94011)

<div class="topic-metadata">

**Author:** [@jamal86](https://www.ruby-forum.com/u/jamal86)\
**Replies:** 0\
**Last updated:** [April 17, 2006, 11:14pm UTC](https://www.ruby-forum.com/t/re-beginner-gsub-and-ri-questions/94011 "2006-04-17T23:14:23Z")

</div>

Thanks, Austin. I’m posting my current solution below. There’s probably a more elegant way of counting the number of replacements using the MatchData object or Regexp implicit variables, but I haven’t figured that o…

---

## [Pre compiled gnu scientific library for win one-click-instal](https://www.ruby-forum.com/t/pre-compiled-gnu-scientific-library-for-win-one-click-instal/94009)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [April 17, 2006, 11:05pm UTC](https://www.ruby-forum.com/t/pre-compiled-gnu-scientific-library-for-win-one-click-instal/94009 "2006-04-17T23:05:07Z")

</div>

hi all- after a but of hacking with msys and mingw i think i’ve compiled an easy to install version of the rb-gsl bindings. for those of you who don’t know what these are, the gnu scientific library (gsl) is by far…

---

## [Re: Full paths of Ruby interpreter and running script](https://www.ruby-forum.com/t/re-full-paths-of-ruby-interpreter-and-running-script/94008)

<div class="topic-metadata">

**Author:** [@jamal86](https://www.ruby-forum.com/u/jamal86)\
**Replies:** 0\
**Last updated:** [April 17, 2006, 10:55pm UTC](https://www.ruby-forum.com/t/re-full-paths-of-ruby-interpreter-and-running-script/94008 "2006-04-17T22:55:54Z")

</div>

Thanks, folks! By coincidence, I had just successfully wrapped the API call myself and was about to share the solution. Dan’s code may be better (I’m still learning Ruby), but I’ll go ahead and post mine below anywa…

---

## [How extract data from a web site?](https://www.ruby-forum.com/t/how-extract-data-from-a-web-site/57944)

<div class="topic-metadata">

**Author:** [@ingoweiss](https://www.ruby-forum.com/u/ingoweiss)\
**Replies:** 7\
**Last updated:** [April 17, 2006, 10:46pm UTC](https://www.ruby-forum.com/t/how-extract-data-from-a-web-site/57944 "2006-04-17T22:46:48Z")

</div>

Hi, I would like to use Ruby to read the content of a web site, and then extract certain data from it. The site is machine generated so the format doesnt’ change, but unfortunately it is far from being valid XHTML or…

---

## [Re: Full paths of Ruby interpreter and running script](https://www.ruby-forum.com/t/re-full-paths-of-ruby-interpreter-and-running-script/94003)

<div class="topic-metadata">

**Author:** [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Replies:** 0\
**Last updated:** [April 17, 2006, 10:31pm UTC](https://www.ruby-forum.com/t/re-full-paths-of-ruby-interpreter-and-running-script/94003 "2006-04-17T22:31:29Z")

</div>

\-----Original Message----- From: Jamal M. \[mailto:removed\_email\_address@domain.invalid\] Sent: Monday, April 17, 2006 1:47 PM To: ruby-talk ML Subject: Re: Full paths of Ruby interpreter and running script Window…

---

## [Re: Full paths of Ruby interpreter and running script](https://www.ruby-forum.com/t/re-full-paths-of-ruby-interpreter-and-running-script/94000)

<div class="topic-metadata">

**Author:** [@jamal86](https://www.ruby-forum.com/u/jamal86)\
**Replies:** 1\
**Last updated:** [April 17, 2006, 10:15pm UTC](https://www.ruby-forum.com/t/re-full-paths-of-ruby-interpreter-and-running-script/94000 "2006-04-17T22:15:49Z")

</div>

I appreciate these suggestions, but found that they do not actually solve my problem. If a full Ruby installation is done with the One Click Installer, the code does return the folder containing the Ruby interpreter …

---

## [Refactoring (#75)](https://www.ruby-forum.com/t/refactoring-75/57816)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 8\
**Last updated:** [April 17, 2006, 10:02pm UTC](https://www.ruby-forum.com/t/refactoring-75/57816 "2006-04-17T22:02:45Z")

</div>

The three rules of Ruby Q.: Please do not post any solutions or spoiler discussion for this quiz until 48 hours have passed from the time on this message. Support Ruby Q. by submitting ideas as often as you can: …

---

## [Re: Tattoo](https://www.ruby-forum.com/t/re-tattoo/94001)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [April 17, 2006, 9:50pm UTC](https://www.ruby-forum.com/t/re-tattoo/94001 "2006-04-17T21:50:30Z")

</div>

It it were my tatoo? The heart of the Functor definition: class Functor def initialize( &f ) ; @f = f ; end def method\_missing( op, \*args, &blk ) @f.call( op, \*args, &blk ) end end Have you done a search of Ruby …

---

## [Resources to get started with ruby](https://www.ruby-forum.com/t/resources-to-get-started-with-ruby/57998)

<div class="topic-metadata">

**Author:** [@andrea](https://www.ruby-forum.com/u/andrea)\
**Replies:** 3\
**Last updated:** [April 17, 2006, 9:41pm UTC](https://www.ruby-forum.com/t/resources-to-get-started-with-ruby/57998 "2006-04-17T21:41:03Z")

</div>

Hi - Im looking to find resources on ruby I have found rubyforums.co.uk has some great tutorials, can anyone suggest any other places I might find easy tutorials thanx

---

## [Re: IO not closed by GC](https://www.ruby-forum.com/t/re-io-not-closed-by-gc/93996)

<div class="topic-metadata">

**Author:** [@Gennady\_B](https://www.ruby-forum.com/u/Gennady_B)\
**Replies:** 1\
**Last updated:** [April 17, 2006, 9:25pm UTC](https://www.ruby-forum.com/t/re-io-not-closed-by-gc/93996 "2006-04-17T21:25:30Z")

</div>

Even GC.start does not guarantee that the garbage collection will be actually started, it is just a hint after all. And I am not sure that even when an IO object is being garbage collected, there will be an implicit c…

---

## [Need to carry over application variable into RUBY script](https://www.ruby-forum.com/t/need-to-carry-over-application-variable-into-ruby-script/58003)

<div class="topic-metadata">

**Author:** [@bodikp](https://www.ruby-forum.com/u/bodikp)\
**Replies:** 6\
**Last updated:** [April 17, 2006, 8:47pm UTC](https://www.ruby-forum.com/t/need-to-carry-over-application-variable-into-ruby-script/58003 "2006-04-17T20:47:48Z")

</div>

I have an application that converts PDFs to individual EPS files. When it does so, it creates a subdirectory with the same name as the original filename and puts all of the resulting EPS files it creates into that dir…

---

## [Improved bundle making script](https://www.ruby-forum.com/t/improved-bundle-making-script/57922)

<div class="topic-metadata">

**Author:** [@sgware](https://www.ruby-forum.com/u/sgware)\
**Replies:** 1\
**Last updated:** [April 17, 2006, 8:14pm UTC](https://www.ruby-forum.com/t/improved-bundle-making-script/57922 "2006-04-17T20:14:22Z")

</div>

I’ve finally had a chance to spend some time cleaning up my little bundle making tool. I’ve found it useful (albeit not under Locomotive) and hope someone else may find it helpful too. It’s been tested on Linux (Kubu…

---

## [IO not closed by GC](https://www.ruby-forum.com/t/io-not-closed-by-gc/58011)

<div class="topic-metadata">

**Author:** [@pure](https://www.ruby-forum.com/u/pure)\
**Replies:** 1\
**Last updated:** [April 17, 2006, 8:05pm UTC](https://www.ruby-forum.com/t/io-not-closed-by-gc/58011 "2006-04-17T20:05:06Z")

</div>

Hello, I often use constructions like the following: os = IO.popen(‘uname -sr’).readlines.to\_s.strip I assume that the Garbage Collector throws away the IO instance created by IO::popen, because it’s simply not neede…

---

## [Re: Beginner gsub and ri questions](https://www.ruby-forum.com/t/re-beginner-gsub-and-ri-questions/93988)

<div class="topic-metadata">

**Author:** [@jamal86](https://www.ruby-forum.com/u/jamal86)\
**Replies:** 2\
**Last updated:** [April 17, 2006, 7:46pm UTC](https://www.ruby-forum.com/t/re-beginner-gsub-and-ri-questions/93988 "2006-04-17T19:46:42Z")

</div>

Thanks for the response. Is there a way to do this without a regular expression? To further explain, I want the program to be able to do any kind of literal string replacement at runtime, except that case is ignored…

---

## [Very lost with rubygems and required files](https://www.ruby-forum.com/t/very-lost-with-rubygems-and-required-files/58012)

<div class="topic-metadata">

**Author:** [@dirk](https://www.ruby-forum.com/u/dirk)\
**Replies:** 1\
**Last updated:** [April 17, 2006, 7:25pm UTC](https://www.ruby-forum.com/t/very-lost-with-rubygems-and-required-files/58012 "2006-04-17T19:25:02Z")

</div>

hi everyone, a few hours ago, i successfully packed my first gem. however, my gem uses certain .png images. when somebody requires my gem, i want the images to be loaded from /images/ but as the file that is required…

---

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

<div class="topic-metadata">

**Author:** [@miken700](https://www.ruby-forum.com/u/miken700)\
**Replies:** 0\
**Last updated:** [April 17, 2006, 6:57pm UTC](https://www.ruby-forum.com/t/no-subject/93990 "2006-04-17T18:57:13Z")

</div>

unsubscribe Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around

---

## [Proxy for object in a background process](https://www.ruby-forum.com/t/proxy-for-object-in-a-background-process/58006)

<div class="topic-metadata">

**Author:** [@divotdave](https://www.ruby-forum.com/u/divotdave)\
**Replies:** 0\
**Last updated:** [April 17, 2006, 6:35pm UTC](https://www.ruby-forum.com/t/proxy-for-object-in-a-background-process/58006 "2006-04-17T18:35:34Z")

</div>

I want to use ruby-ldap in my application, but it appears that the underlying library’s use of native IO causes my Ruby threads to block waiting for the LDAP server’s response (correct me if I’m wrong there). Since th…

---

## [Beginner gsub and ri questions](https://www.ruby-forum.com/t/beginner-gsub-and-ri-questions/57997)

<div class="topic-metadata">

**Author:** [@jamal86](https://www.ruby-forum.com/u/jamal86)\
**Replies:** 1\
**Last updated:** [April 17, 2006, 6:25pm UTC](https://www.ruby-forum.com/t/beginner-gsub-and-ri-questions/57997 "2006-04-17T18:25:49Z")

</div>

How can I do a case-insensitive global substitution? Suppose, for example, a string contained occurences of DOG, Dog, dog, and mistyped dOg. I want every instance to be replaced by cat (without having to test for ea…

---

## [Re: Full paths of Ruby interpreter and running script](https://www.ruby-forum.com/t/re-full-paths-of-ruby-interpreter-and-running-script/93984)

<div class="topic-metadata">

**Author:** [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Replies:** 1\
**Last updated:** [April 17, 2006, 6:16pm UTC](https://www.ruby-forum.com/t/re-full-paths-of-ruby-interpreter-and-running-script/93984 "2006-04-17T18:16:13Z")

</div>

from within a running program. I want to distribute a program that can be installed in a folder chosen by the user. The program would save configuration information in the same folder. In order to find the configura…

---

## [Re: Regular expression to parse out "host" part of URL strin](https://www.ruby-forum.com/t/re-regular-expression-to-parse-out-host-part-of-url-strin/58001)

<div class="topic-metadata">

**Author:** [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Replies:** 1\
**Last updated:** [April 17, 2006, 6:04pm UTC](https://www.ruby-forum.com/t/re-regular-expression-to-parse-out-host-part-of-url-strin/58001 "2006-04-17T18:04:48Z")

</div>

I am trying to write a regex to parse out the “host” part of a potential URL. require ‘uri’ URI.parse(‘http://www.cnn.com’).host # www.cnn.com URI.parse(‘http://www.cnn.com/’).host # www.cnn.com URI.parse(‘http:/…

---

## [Full paths of Ruby interpreter and running script](https://www.ruby-forum.com/t/full-paths-of-ruby-interpreter-and-running-script/93985)

<div class="topic-metadata">

**Author:** [@jamal86](https://www.ruby-forum.com/u/jamal86)\
**Replies:** 0\
**Last updated:** [April 17, 2006, 5:54pm UTC](https://www.ruby-forum.com/t/full-paths-of-ruby-interpreter-and-running-script/93985 "2006-04-17T17:54:41Z")

</div>

I’ve looked through and experimented with predefined global constants, but so far have not figured how to get the full path and name of the Ruby interpreter and/or main script file from within a running program. I wan…

---

## [\[QUIZ} Extract Method](https://www.ruby-forum.com/t/quiz-extract-method/57986)

<div class="topic-metadata">

**Author:** [@pat\_eyler](https://www.ruby-forum.com/u/pat_eyler)\
**Replies:** 0\
**Last updated:** [April 17, 2006, 3:38pm UTC](https://www.ruby-forum.com/t/quiz-extract-method/57986 "2006-04-17T15:38:36Z")

</div>

James’ writeup was quite a bit nicer than mine, but I thought I should post a solution too, if I was going to suggest the quiz. Refactoring Name: Extract Method Original Code (taken from the checkr project): def pr…

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

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