# Ruby

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

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

---

## [Ruby's include path](https://www.ruby-forum.com/t/rubys-include-path/72123)

<div class="topic-metadata">

**Author:** [@bizzz](https://www.ruby-forum.com/u/bizzz)\
**Replies:** 2\
**Last updated:** [October 14, 2006, 3:44pm UTC](https://www.ruby-forum.com/t/rubys-include-path/72123 "2006-10-14T15:44:23Z")

</div>

Greetings, I’m searching for something equivilent to Perl’s “use lib”. I can see that there is a -I parameter to ruby itself, but that seems clumsy when there are many paths to be added to the include path (is that w…

---

## [Typesetting long options in rdoc](https://www.ruby-forum.com/t/typesetting-long-options-in-rdoc/72122)

<div class="topic-metadata">

**Author:** [@wybodekker](https://www.ruby-forum.com/u/wybodekker)\
**Replies:** 0\
**Last updated:** [October 14, 2006, 3:26pm UTC](https://www.ruby-forum.com/t/typesetting-long-options-in-rdoc/72122 "2006-10-14T15:26:22Z")

</div>

I don’t succeed in nicely typesetting long options in itemized lists in rdoc. The RDOC documentation (RDoc Documentation) tells me this example: =begin rdoc –output name \[, name\]:: specify the name of one or more o…

---

## [Select](https://www.ruby-forum.com/t/select/72120)

<div class="topic-metadata">

**Author:** [@pablo](https://www.ruby-forum.com/u/pablo)\
**Replies:** 1\
**Last updated:** [October 14, 2006, 3:06pm UTC](https://www.ruby-forum.com/t/select/72120 "2006-10-14T15:06:22Z")

</div>

Hi What would be the correct Ruby on Rails way of doing the following: I want the user to be able to select from a drop down menu if s/he wants to pay with VISA, Master card, AMEX, Discovery, PayPal or Bank Wire. If …

---

## [Basic ActiveRecord Usage](https://www.ruby-forum.com/t/basic-activerecord-usage/72108)

<div class="topic-metadata">

**Author:** [@jotto](https://www.ruby-forum.com/u/jotto)\
**Replies:** 2\
**Last updated:** [October 14, 2006, 3:04pm UTC](https://www.ruby-forum.com/t/basic-activerecord-usage/72108 "2006-10-14T15:04:21Z")

</div>

I want to run a Ruby script outside of Rails and still use Active Record. This is what I’m trying but I am getting a “const\_missing” error - do I need to reference the connection in the printlisting method?: require …

---

## [New edition of "The Ruby Way" coming soon](https://www.ruby-forum.com/t/new-edition-of-the-ruby-way-coming-soon/72115)

<div class="topic-metadata">

**Author:** [@Tony\_Lawrence](https://www.ruby-forum.com/u/Tony_Lawrence)\
**Replies:** 0\
**Last updated:** [October 14, 2006, 12:36pm UTC](https://www.ruby-forum.com/t/new-edition-of-the-ruby-way-coming-soon/72115 "2006-10-14T12:36:04Z")

</div>

Review of "The Ruby Way (second edition) at

---

## [Posix Pangrams (#97)](https://www.ruby-forum.com/t/posix-pangrams-97/71938)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 1\
**Last updated:** [October 14, 2006, 12:36pm UTC](https://www.ruby-forum.com/t/posix-pangrams-97/71938 "2006-10-14T12:36:03Z")

</div>

This problem turns out to be pretty tough. Finding the best pangram for a given constraint can be NP-Hard, as explained by Ken B.: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/219003 Given that, we’re…

---

## [Running a ruby script once a week automatically](https://www.ruby-forum.com/t/running-a-ruby-script-once-a-week-automatically/72023)

<div class="topic-metadata">

**Author:** [@jotto](https://www.ruby-forum.com/u/jotto)\
**Replies:** 2\
**Last updated:** [October 14, 2006, 12:05pm UTC](https://www.ruby-forum.com/t/running-a-ruby-script-once-a-week-automatically/72023 "2006-10-14T12:05:45Z")

</div>

I have a SQL query that examines an entire column (right now 25,000 rows, but growing fast), it finds the top 50 most common elements in a column. To reduce load, I want to execute this script only once a week instead…

---

## [Calling a reader from a writer](https://www.ruby-forum.com/t/calling-a-reader-from-a-writer/72093)

<div class="topic-metadata">

**Author:** [@clintpachl](https://www.ruby-forum.com/u/clintpachl)\
**Replies:** 3\
**Last updated:** [October 14, 2006, 11:41am UTC](https://www.ruby-forum.com/t/calling-a-reader-from-a-writer/72093 "2006-10-14T11:41:44Z")

</div>

class Test def x @x + ‘\_instance’ end def x=(v) @x = v self.x # also tried \`x’ end end t = Test.new puts t.x=(‘test\_x’) =\> test\_x puts t.x =\> test\_x\_instance Why doesn’t the first puts output ‘test\_x\_insta…

---

## [File.puts or File.write?](https://www.ruby-forum.com/t/file-puts-or-file-write/72071)

<div class="topic-metadata">

**Author:** [@joe](https://www.ruby-forum.com/u/joe)\
**Replies:** 4\
**Last updated:** [October 14, 2006, 11:15am UTC](https://www.ruby-forum.com/t/file-puts-or-file-write/72071 "2006-10-14T11:15:42Z")

</div>

For general purpose file writing, does it matter whether puts or write is used? From the docs, it seems like puts should be used for strings, while write can be used for anything. I’m not really sure what difference t…

---

## [Ruby conference ticket available](https://www.ruby-forum.com/t/ruby-conference-ticket-available/72103)

<div class="topic-metadata">

**Author:** [@Reta\_Miller](https://www.ruby-forum.com/u/Reta_Miller)\
**Replies:** 1\
**Last updated:** [October 14, 2006, 6:21am UTC](https://www.ruby-forum.com/t/ruby-conference-ticket-available/72103 "2006-10-14T06:21:11Z")

</div>

Fellow Rubyist, I will not be able to attend the Ruby Conference in Denver on October 20-21, 2006 as planned and would like to sell my ticket. If anyone is interested in purchasing a ticket to the conference (no meal…

---

## [ZenTest 3.4.1 Released](https://www.ruby-forum.com/t/zentest-3-4-1-released/72097)

<div class="topic-metadata">

**Author:** [@aguynamedryan](https://www.ruby-forum.com/u/aguynamedryan)\
**Replies:** 0\
**Last updated:** [October 14, 2006, 4:02am UTC](https://www.ruby-forum.com/t/zentest-3-4-1-released/72097 "2006-10-14T04:02:55Z")

</div>

ZenTest version 3.4.1 has been released! http://www.zenspider.com/ZSS/Products/ZenTest/ ZenTest provides 4 different tools and 1 library: zentest, unit\_diff, autotest, multiruby, and Test::Rails. ZenTest scans your t…

---

## [Backwards references in arrays of arrays of](https://www.ruby-forum.com/t/backwards-references-in-arrays-of-arrays-of/72090)

<div class="topic-metadata">

**Author:** [@ohad](https://www.ruby-forum.com/u/ohad)\
**Replies:** 0\
**Last updated:** [October 14, 2006, 2:09am UTC](https://www.ruby-forum.com/t/backwards-references-in-arrays-of-arrays-of/72090 "2006-10-14T02:09:10Z")

</div>

I’m creating a scheduling application for my university, the Technion. The course data we receive in a file called a REP file, which my application parses. Its essential, simplified structure is this: Faculties (which…

---

## [Sorting through an array of an array](https://www.ruby-forum.com/t/sorting-through-an-array-of-an-array/72072)

<div class="topic-metadata">

**Author:** [@eddiewould](https://www.ruby-forum.com/u/eddiewould)\
**Replies:** 6\
**Last updated:** [October 14, 2006, 1:12am UTC](https://www.ruby-forum.com/t/sorting-through-an-array-of-an-array/72072 "2006-10-14T01:12:24Z")

</div>

Hello. Each of my arrays look like this: container\[0\] = \[“foo”, “bar”, “baz”\] container\[1\] = \[“doo”, “poo”, “woo”\] i’d like to sort by the second position (bar, and poo) and of course,affecting the whole row, so th…

---

## [Re: file\_put\_contents analog?](https://www.ruby-forum.com/t/re-file-put-contents-analog/72065)

<div class="topic-metadata">

**Author:** [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Replies:** 0\
**Last updated:** [October 13, 2006, 10:41pm UTC](https://www.ruby-forum.com/t/re-file-put-contents-analog/72065 "2006-10-13T22:41:52Z")

</div>

From: Gavin K. contents.each{ |item| file \<\< item } } end Er, missing a paren there. Also, if you want append vs. wipe-and-write, use ‘a’: def file\_put\_contents( name, \*contents ) File.open( name, “a” ){ |file…

---

## [Re: file\_put\_contents analog?](https://www.ruby-forum.com/t/re-file-put-contents-analog/72064)

<div class="topic-metadata">

**Author:** [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Replies:** 0\
**Last updated:** [October 13, 2006, 10:35pm UTC](https://www.ruby-forum.com/t/re-file-put-contents-analog/72064 "2006-10-13T22:35:42Z")

</div>

From: Joe R. MUDCRAP-CE PHP has a function file\_put\_contents(file, stuff) – is there any similar single command in Ruby? def file\_put\_contents( name, \*contents ) File.open( name, “w+” { |file| contents.each{ |item…

---

## [File\_put\_contents analog?](https://www.ruby-forum.com/t/file-put-contents-analog/72062)

<div class="topic-metadata">

**Author:** [@joe](https://www.ruby-forum.com/u/joe)\
**Replies:** 1\
**Last updated:** [October 13, 2006, 10:33pm UTC](https://www.ruby-forum.com/t/file-put-contents-analog/72062 "2006-10-13T22:33:40Z")

</div>

PHP has a function file\_put\_contents(file, stuff) – is there any similar single command in Ruby? Thanks, Joe

---

## [Slave-1.0.0](https://www.ruby-forum.com/t/slave-1-0-0/72047)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 2\
**Last updated:** [October 13, 2006, 10:29pm UTC](https://www.ruby-forum.com/t/slave-1-0-0/72047 "2006-10-13T22:29:12Z")

</div>

\*\* PLEASE NOTE THAT THIS IS A DEVELOPMENTAL RELEASE \*\* SYNOPSIS the Slave class forks a process and starts a drb server in the child using any object as the server. the process is detached so it is not required (n…

---

## [Problems with upgrade to 1.8.4](https://www.ruby-forum.com/t/problems-with-upgrade-to-1-8-4/72029)

<div class="topic-metadata">

**Author:** [@antonaylward](https://www.ruby-forum.com/u/antonaylward)\
**Replies:** 1\
**Last updated:** [October 13, 2006, 10:15pm UTC](https://www.ruby-forum.com/t/problems-with-upgrade-to-1-8-4/72029 "2006-10-13T22:15:08Z")

</div>

Actually this is almost a gems problem in that it shows up with gems. I’ve installed a new compile of 1.8.4 and rubygems 0.9.0 However when I try to run gems it can’t find a library file: $ gem /usr/lib/ruby/site\_rub…

---

## [No such object errors with Ruby-LDAP](https://www.ruby-forum.com/t/no-such-object-errors-with-ruby-ldap/72049)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [October 13, 2006, 9:40pm UTC](https://www.ruby-forum.com/t/no-such-object-errors-with-ruby-ldap/72049 "2006-10-13T21:40:54Z")

</div>

Hi everyone, I’m in the process of writing a small script for my LDAP-enabled Rails site (the script below has been converted to ruby shell form for easy testing). It will enable users to change their passwords. I did…

---

## [Problem with a regular expression](https://www.ruby-forum.com/t/problem-with-a-regular-expression/72038)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 4\
**Last updated:** [October 13, 2006, 9:00pm UTC](https://www.ruby-forum.com/t/problem-with-a-regular-expression/72038 "2006-10-13T21:00:25Z")

</div>

I have the following code snippet: require 'net/http' begin hdoc = Net::HTTP.get(URI.parse(‘Symbol Lookup from Yahoo Finance’)) re = /\<TD\>(.\*)\</TD\>/ if hdoc =~ re prin…

---

## [Regex parsing against filenames](https://www.ruby-forum.com/t/regex-parsing-against-filenames/72030)

<div class="topic-metadata">

**Author:** [@bodikp](https://www.ruby-forum.com/u/bodikp)\
**Replies:** 3\
**Last updated:** [October 13, 2006, 8:31pm UTC](https://www.ruby-forum.com/t/regex-parsing-against-filenames/72030 "2006-10-13T20:31:03Z")

</div>

Hi, I need to match incoming filenames in a directory on my server, so that I can do stuff in a table. In my testing, I’ve got 9 files: pq181b1p.ps pq181b1t.ps pq181b2p.ps pq181b2t.ps pq181b3t.ps pq192b1p.ps pq1…

---

## [DRb.thread.join in a Process.fork block?](https://www.ruby-forum.com/t/drb-thread-join-in-a-process-fork-block/72034)

<div class="topic-metadata">

**Author:** [@elliterate](https://www.ruby-forum.com/u/elliterate)\
**Replies:** 2\
**Last updated:** [October 13, 2006, 7:53pm UTC](https://www.ruby-forum.com/t/drb-thread-join-in-a-process-fork-block/72034 "2006-10-13T19:53:23Z")

</div>

Hi list, I am trying to make my DRb server fork into a daemon, yet the DRbServer thread joins immediately when called inside a fork block. I’m not entirely sure why this is happening but I’m coming to the conclusion …

---

## [Ruby-VPI 8.0.0](https://www.ruby-forum.com/t/ruby-vpi-8-0-0/72032)

<div class="topic-metadata">

**Author:** [@Suraj\_NSKurapati](https://www.ruby-forum.com/u/Suraj_NSKurapati)\
**Replies:** 0\
**Last updated:** [October 13, 2006, 7:00pm UTC](https://www.ruby-forum.com/t/ruby-vpi-8-0-0/72032 "2006-10-13T19:00:26Z")

</div>

\-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Version 8.0.0 (2006-10-13) Ruby-VPI is a Ruby interface to Verilog VPI. It lets you create complex Verilog test benches easily and wholly in Ruby. Website: http://ruby…

---

## [Robots.txt protocol support for Ruby](https://www.ruby-forum.com/t/robots-txt-protocol-support-for-ruby/72031)

<div class="topic-metadata">

**Author:** [@Nicolas\_DesprSSSSs](https://www.ruby-forum.com/u/Nicolas_DesprSSSSs)\
**Replies:** 0\
**Last updated:** [October 13, 2006, 6:58pm UTC](https://www.ruby-forum.com/t/robots-txt-protocol-support-for-ruby/72031 "2006-10-13T18:58:25Z")

</div>

Hi there, I’m looking for a ruby gem supporting the robots.txt protocol such as described at: http://www.robotstxt.org/ I’ve found this one: http://groups.google.com/group/comp.lang.ruby/msg/16f16935bf83c8c6?dmode…

---

## [Rails webmin like application](https://www.ruby-forum.com/t/rails-webmin-like-application/72027)

<div class="topic-metadata">

**Author:** [@ghiggia](https://www.ruby-forum.com/u/ghiggia)\
**Replies:** 0\
**Last updated:** [October 13, 2006, 6:11pm UTC](https://www.ruby-forum.com/t/rails-webmin-like-application/72027 "2006-10-13T18:11:44Z")

</div>

I’m a newbie in ruby I’m wondering if there are a way to build a little application like webmin with ruby on rails. For example I want to modify the bgpd configuration file on a linux box or start and stop the bgp dem…

---

## [How do I round off a float to x decimal places](https://www.ruby-forum.com/t/how-do-i-round-off-a-float-to-x-decimal-places/72020)

<div class="topic-metadata">

**Author:** [@Jatinder\_S](https://www.ruby-forum.com/u/Jatinder_S)\
**Replies:** 5\
**Last updated:** [October 13, 2006, 5:57pm UTC](https://www.ruby-forum.com/t/how-do-i-round-off-a-float-to-x-decimal-places/72020 "2006-10-13T17:57:42Z")

</div>

Hi, This might be a very naive question but I looked through ruby:Float documentation for a method which round off’s a float number to x decimal places with no luck. Please share if you know. Regards, Jatinder

---

## [Trouble delecting UNC file on window 1.8.4](https://www.ruby-forum.com/t/trouble-delecting-unc-file-on-window-1-8-4/71990)

<div class="topic-metadata">

**Author:** [@cgramona](https://www.ruby-forum.com/u/cgramona)\
**Replies:** 5\
**Last updated:** [October 13, 2006, 5:53pm UTC](https://www.ruby-forum.com/t/trouble-delecting-unc-file-on-window-1-8-4/71990 "2006-10-13T17:53:40Z")

</div>

I have a problem delecting a file that has a UNC path. I am using 1.8.4 on windows and this same thing did work in 1.8.2. Here is the pertinent excerpt of code: puts shp.source; ==\> //rm-graff-c/c$/ftpxfr/somefile24…

---

## [Re: How do I round off a float to x decimal places](https://www.ruby-forum.com/t/re-how-do-i-round-off-a-float-to-x-decimal-places/72024)

<div class="topic-metadata">

**Author:** [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Replies:** 0\
**Last updated:** [October 13, 2006, 5:49pm UTC](https://www.ruby-forum.com/t/re-how-do-i-round-off-a-float-to-x-decimal-places/72024 "2006-10-13T17:49:36Z")

</div>

From: Jatinder S. \[mailto:removed\_email\_address@domain.invalid\] This might be a very naive question but I looked through ruby:Float documentation for a method which round off’s a float number to x decimal places wit…

---

## [Instance\_function](https://www.ruby-forum.com/t/instance-function/72022)

<div class="topic-metadata">

**Author:** [@Trans](https://www.ruby-forum.com/u/Trans)\
**Replies:** 0\
**Last updated:** [October 13, 2006, 5:41pm UTC](https://www.ruby-forum.com/t/instance-function/72022 "2006-10-13T17:41:35Z")

</div>

Useful? Better name? class Module def instance\_function(name) class\_eval %{ def #{name}(\*a,&b) self.class.#{name}(\*a,&b) end } end end T.

---

## [Re: Hash & keys](https://www.ruby-forum.com/t/re-hash-keys/72021)

<div class="topic-metadata">

**Author:** [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Replies:** 0\
**Last updated:** [October 13, 2006, 5:41pm UTC](https://www.ruby-forum.com/t/re-hash-keys/72021 "2006-10-13T17:41:34Z")

</div>

From: Rick DeNatale \[mailto:removed\_email\_address@domain.invalid\] It appears to be a typo in Matrix.rb - This is in ruby1.8.4: LOL, nice find. I was ri’ing Vector and was wondering what eqn? was for. :slight\_smile:

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

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