# Ruby

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

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

---

## [Run a command on shell with ruby](https://www.ruby-forum.com/t/run-a-command-on-shell-with-ruby/104581)

<div class="topic-metadata">

**Author:** [@corpuscallosum](https://www.ruby-forum.com/u/corpuscallosum)\
**Replies:** 10\
**Last updated:** [May 20, 2007, 3:08pm UTC](https://www.ruby-forum.com/t/run-a-command-on-shell-with-ruby/104581 "2007-05-20T15:08:45Z")

</div>

hi guys, i want to run a command with a ruby programme. for example, assume that i have a ruby script and when run its, it make “apt-get install gaim” command run… what is the method or way of that ? thanks

---

## [Library to create MS Excel / OpenOffice calc files?](https://www.ruby-forum.com/t/library-to-create-ms-excel-openoffice-calc-files/104420)

<div class="topic-metadata">

**Author:** [@rhaus](https://www.ruby-forum.com/u/rhaus)\
**Replies:** 4\
**Last updated:** [May 20, 2007, 2:53pm UTC](https://www.ruby-forum.com/t/library-to-create-ms-excel-openoffice-calc-files/104420 "2007-05-20T14:53:43Z")

</div>

Is there a working library that lets me create files in MS Excel format? OpenOffice calc would be good in addition, but the primary requirement is that we can create excel documents on the fly, and on a non-Windows pl…

---

## [ANN: Sequel 0.1.3 Released - now with DBI support!](https://www.ruby-forum.com/t/ann-sequel-0-1-3-released-now-with-dbi-support/104603)

<div class="topic-metadata">

**Author:** [@ciconia](https://www.ruby-forum.com/u/ciconia)\
**Replies:** 0\
**Last updated:** [May 20, 2007, 1:34pm UTC](https://www.ruby-forum.com/t/ann-sequel-0-1-3-released-now-with-dbi-support/104603 "2007-05-20T13:34:37Z")

</div>

Sequel version 0.1.3 has just been released. This release adds a DBI adapter, and thereby support for ODBC, ADO, Frontbase and other databases. For example: require ‘sequel/dbi’ DB = Sequel.open ‘dbi:/odbc:my\_dsn’ D…

---

## [Splat operator Question](https://www.ruby-forum.com/t/splat-operator-question/104604)

<div class="topic-metadata">

**Author:** [@pedro](https://www.ruby-forum.com/u/pedro)\
**Replies:** 1\
**Last updated:** [May 20, 2007, 1:30pm UTC](https://www.ruby-forum.com/t/splat-operator-question/104604 "2007-05-20T13:30:36Z")

</div>

Hi there. What’s the functional difference between pet1, pet2, pet3 = \*\[“duck”, “dog”, “cat”\] and pet1, pet2, pet3 = \[“horse”, “cow”, “goat”\] I get the same results–namely, each pet gets one value from the array. Th…

---

## ["Crystallizing" Objects](https://www.ruby-forum.com/t/crystallizing-objects/104380)

<div class="topic-metadata">

**Author:** [@enduro](https://www.ruby-forum.com/u/enduro)\
**Replies:** 21\
**Last updated:** [May 20, 2007, 10:13am UTC](https://www.ruby-forum.com/t/crystallizing-objects/104380 "2007-05-20T10:13:10Z")

</div>

Hello, in this post, I’d like to make a proposal to contribute to Ruby’s fitness for the challenges of parallelization. The problem with sharing objects between threads is concurrent write access. If the objects wer…

---

## [Hijack, or alias a method with a proc?](https://www.ruby-forum.com/t/hijack-or-alias-a-method-with-a-proc/104505)

<div class="topic-metadata">

**Author:** [@jim](https://www.ruby-forum.com/u/jim)\
**Replies:** 2\
**Last updated:** [May 20, 2007, 6:40am UTC](https://www.ruby-forum.com/t/hijack-or-alias-a-method-with-a-proc/104505 "2007-05-20T06:40:55Z")

</div>

Hello, I have a Menu class with a add\_item method, which takes a name followed by a proc: Menu(“TopLevelMenuName”).add\_item(“NewMenuItemName”) { puts “Hello” } I want to hijack this method so I can customize the menu…

---

## [Block Trouble (Binding Issue?)](https://www.ruby-forum.com/t/block-trouble-binding-issue/104579)

<div class="topic-metadata">

**Author:** [@illusoft](https://www.ruby-forum.com/u/illusoft)\
**Replies:** 3\
**Last updated:** [May 19, 2007, 11:24pm UTC](https://www.ruby-forum.com/t/block-trouble-binding-issue/104579 "2007-05-19T23:24:30Z")

</div>

I’m presently trying to work on a little metaprogramming project, but am finding my efforts a little frustrated by … well, I’m not rightly sure what by. It seems to be a scoping issue, from what I can tell. Here’s a …

---

## [Can RubyInline and Cygwin's gcc work together?](https://www.ruby-forum.com/t/can-rubyinline-and-cygwins-gcc-work-together/104576)

<div class="topic-metadata">

**Author:** [@eipipuz](https://www.ruby-forum.com/u/eipipuz)\
**Replies:** 3\
**Last updated:** [May 19, 2007, 10:23pm UTC](https://www.ruby-forum.com/t/can-rubyinline-and-cygwins-gcc-work-together/104576 "2007-05-19T22:23:25Z")

</div>

Hi, I’m trying to use RubyInline in winxp. I discovered that one needs to create a HOME environment variable and install a c/c++ compiler. Therefore, I installed cygwin and it’s gcc. Do anyone knows how to mix gcc wit…

---

## [A place for an "edit\_distance" method](https://www.ruby-forum.com/t/a-place-for-an-edit-distance-method/104577)

<div class="topic-metadata">

**Author:** [@eliben](https://www.ruby-forum.com/u/eliben)\
**Replies:** 2\
**Last updated:** [May 19, 2007, 8:55pm UTC](https://www.ruby-forum.com/t/a-place-for-an-edit-distance-method/104577 "2007-05-19T20:55:14Z")

</div>

Hi all, In my application I need an “edit\_distance” method that computes the Edit Distance (Also called Levenshtein Distance, see this: Levenshtein distance - Wikipedia) between two strings. I wonder where is the rig…

---

## [PrettyPrint to a web page?](https://www.ruby-forum.com/t/prettyprint-to-a-web-page/104534)

<div class="topic-metadata">

**Author:** [@Mario\_TSL](https://www.ruby-forum.com/u/Mario_TSL)\
**Replies:** 5\
**Last updated:** [May 19, 2007, 5:59pm UTC](https://www.ruby-forum.com/t/prettyprint-to-a-web-page/104534 "2007-05-19T17:59:54Z")

</div>

This is gonna sound like a dumb question to you Ruby veterans, but: How do you dump pretty\_print contents to a web page from within a Rails app? I’ve tried this and a few other things from a view: Session Info \<% requ…

---

## [ANN: Sequel 0.1.2 Released](https://www.ruby-forum.com/t/ann-sequel-0-1-2-released/104558)

<div class="topic-metadata">

**Author:** [@ciconia](https://www.ruby-forum.com/u/ciconia)\
**Replies:** 0\
**Last updated:** [May 19, 2007, 3:08pm UTC](https://www.ruby-forum.com/t/ann-sequel-0-1-2-released/104558 "2007-05-19T15:08:41Z")

</div>

Sequel version 0.1.2 has just been released. This release contains vaious bug fixes and enhancements. Here are the important changes: Support for SQL set operations (UNION, INTERSECT and EXCEPT): DB\[:a\].union(DB\[:b\])…

---

## [Rails won't find pages off of localhost:3000](https://www.ruby-forum.com/t/rails-wont-find-pages-off-of-localhost-3000/104544)

<div class="topic-metadata">

**Author:** [@Mark\_Bratcher](https://www.ruby-forum.com/u/Mark_Bratcher)\
**Replies:** 0\
**Last updated:** [May 19, 2007, 4:45am UTC](https://www.ruby-forum.com/t/rails-wont-find-pages-off-of-localhost-3000/104544 "2007-05-19T04:45:49Z")

</div>

Hi – I have just started using rails/ruby and followed instructions carefully to install them for a rails app. I am running Linux FC5. The “welcome” page comes up at localhost:3000, but my DB gives me a “page not foun…

---

## [Why "NoMethodError" occurs](https://www.ruby-forum.com/t/why-nomethoderror-occurs/104539)

<div class="topic-metadata">

**Author:** [@gao\_bo](https://www.ruby-forum.com/u/gao_bo)\
**Replies:** 2\
**Last updated:** [May 19, 2007, 4:28am UTC](https://www.ruby-forum.com/t/why-nomethoderror-occurs/104539 "2007-05-19T04:28:48Z")

</div>

hi, everyone today i typed the code below in my IDE class Song attr\_reader :name, :artist, :duration attr\_writer :duration def initialize(name, artist, duration) @name = name @artist = artist @duration = duration …

---

## [Heckle 1.4.0 Released](https://www.ruby-forum.com/t/heckle-1-4-0-released/104535)

<div class="topic-metadata">

**Author:** [@aguynamedryan](https://www.ruby-forum.com/u/aguynamedryan)\
**Replies:** 0\
**Last updated:** [May 19, 2007, 1:54am UTC](https://www.ruby-forum.com/t/heckle-1-4-0-released/104535 "2007-05-19T01:54:39Z")

</div>

heckle version 1.4.0 has been released! http://www.rubyforge.org/projects/seattlerb by Ryan D. and Kevin C. Heckle is a mutation tester. It modifies your code and runs your tests to make sure they fail. The idea is t…

---

## [Quick question about @ and @@](https://www.ruby-forum.com/t/quick-question-about-and/104414)

<div class="topic-metadata">

**Author:** [@mschwab](https://www.ruby-forum.com/u/mschwab)\
**Replies:** 5\
**Last updated:** [May 19, 2007, 1:50am UTC](https://www.ruby-forum.com/t/quick-question-about-and/104414 "2007-05-19T01:50:39Z")

</div>

What’s the difference between @ and @@? Specifically, which should I use if I need a global variable in a non-OOP Ruby program? Thanks! Mike S.

---

## [RMagick users - ImageMagick security advisory](https://www.ruby-forum.com/t/rmagick-users-imagemagick-security-advisory/104532)

<div class="topic-metadata">

**Author:** [@timhunter](https://www.ruby-forum.com/u/timhunter)\
**Replies:** 0\
**Last updated:** [May 19, 2007, 1:08am UTC](https://www.ruby-forum.com/t/rmagick-users-imagemagick-security-advisory/104532 "2007-05-19T01:08:36Z")

</div>

Please see http://labs.idefense.com/intelligence/vulnerabilities/display.php?id=496 for information about a vulnerability in versions of ImageMagick prior to 6.3.3-5. If you’re using a version of ImageMagick that is …

---

## [Re: Beginner question](https://www.ruby-forum.com/t/re-beginner-question/104525)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [May 19, 2007, 12:04am UTC](https://www.ruby-forum.com/t/re-beginner-question/104525 "2007-05-19T00:04:31Z")

</div>

Thank you everyone for all the replies. I think I understand that now. Coming to Ruby from Perl, bare variables have been a point of confusion for me. Heck, I started out just messing with existing scripts, and until …

---

## [String#index/include limitation in number of characters](https://www.ruby-forum.com/t/string-index-include-limitation-in-number-of-characters/104520)

<div class="topic-metadata">

**Author:** [@stash](https://www.ruby-forum.com/u/stash)\
**Replies:** 6\
**Last updated:** [May 18, 2007, 11:42pm UTC](https://www.ruby-forum.com/t/string-index-include-limitation-in-number-of-characters/104520 "2007-05-18T23:42:28Z")

</div>

Do you understand why the last include gives false ?? It seems that the limit is 24 characters, is it a bug ? irb(main):001:0\> s=“asdfasdfasdfasdfasdfppppppppppppppppppppppppasdfasdf” =\> “asdfasdfasdfasdfasdfpppppppp…

---

## [Multimimensional arrays - i am not getting it](https://www.ruby-forum.com/t/multimimensional-arrays-i-am-not-getting-it/104516)

<div class="topic-metadata">

**Author:** [@spacechurro](https://www.ruby-forum.com/u/spacechurro)\
**Replies:** 6\
**Last updated:** [May 18, 2007, 11:00pm UTC](https://www.ruby-forum.com/t/multimimensional-arrays-i-am-not-getting-it/104516 "2007-05-18T23:00:23Z")

</div>

let me just give a blip of what i am getting… a = Array.new(3,\[\]) =\> \[\[\], \[\], \[\]\] a\[2\] \<\< “check” =\> \[“check”\] a =\> \[\[“check”\], \[“check”\], \[“check”\]\] this is totally not what i am expecting… what i am exp…

---

## [Setting up eruby](https://www.ruby-forum.com/t/setting-up-eruby/104506)

<div class="topic-metadata">

**Author:** [@nuby2ruby](https://www.ruby-forum.com/u/nuby2ruby)\
**Replies:** 1\
**Last updated:** [May 18, 2007, 10:12pm UTC](https://www.ruby-forum.com/t/setting-up-eruby/104506 "2007-05-18T22:12:16Z")

</div>

Is there anyone that is using eruby on a production system? If so can you tell me what Operating System you are using and why you prefer it. Also a link to set up eruby on the OS would be handy as well. Thanks

---

## [Rubyscript2exe - Darwin](https://www.ruby-forum.com/t/rubyscript2exe-darwin/104469)

<div class="topic-metadata">

**Author:** [@Matteo\_Gavagnin](https://www.ruby-forum.com/u/Matteo_Gavagnin)\
**Replies:** 3\
**Last updated:** [May 18, 2007, 9:51pm UTC](https://www.ruby-forum.com/t/rubyscript2exe-darwin/104469 "2007-05-18T21:51:58Z")

</div>

I’m developing an application in rails for manage a restaurant and the natural way to distribute it as an executable. Furtther informations about the project could be found on http://rubyforge.org/projects/pelmo/ I’v…

---

## [Constants Question](https://www.ruby-forum.com/t/constants-question/104503)

<div class="topic-metadata">

**Author:** [@pallan](https://www.ruby-forum.com/u/pallan)\
**Replies:** 1\
**Last updated:** [May 18, 2007, 8:13pm UTC](https://www.ruby-forum.com/t/constants-question/104503 "2007-05-18T20:13:01Z")

</div>

Hi, I have building a small custom library and I want to be able to define a constant in each subclass identifying “valid” options. Each subclass will have its own list. here is how I tried to do it, please ignore t…

---

## [Writing A Ruby Shell](https://www.ruby-forum.com/t/writing-a-ruby-shell/103997)

<div class="topic-metadata">

**Author:** [@pdubb](https://www.ruby-forum.com/u/pdubb)\
**Replies:** 6\
**Last updated:** [May 18, 2007, 8:06pm UTC](https://www.ruby-forum.com/t/writing-a-ruby-shell/103997 "2007-05-18T20:06:00Z")

</div>

Hello all, I'm writing a Ruby shell for Ubuntu Linux 7.04. I would like my shell to take commands from the user, run the command, output the result to the command line, and log the result in a file. But I am having t…

---

## [Recursive directory listing](https://www.ruby-forum.com/t/recursive-directory-listing/104465)

<div class="topic-metadata">

**Author:** [@Jesper](https://www.ruby-forum.com/u/Jesper)\
**Replies:** 5\
**Last updated:** [May 18, 2007, 8:01pm UTC](https://www.ruby-forum.com/t/recursive-directory-listing/104465 "2007-05-18T20:01:00Z")

</div>

Hello, I’ve made a small script that gets username + password from a form, and uses them to log into an ftp-account, where it then search for specific files (\*.mp3, for example). I read somewhere (online, not in the …

---

## [Minor improvements and doc fix for Enumerable](https://www.ruby-forum.com/t/minor-improvements-and-doc-fix-for-enumerable/104504)

<div class="topic-metadata">

**Author:** [@nobu](https://www.ruby-forum.com/u/nobu)\
**Replies:** 1\
**Last updated:** [May 18, 2007, 7:26pm UTC](https://www.ruby-forum.com/t/minor-improvements-and-doc-fix-for-enumerable/104504 "2007-05-18T19:26:56Z")

</div>

e$B$J$+$@$G$9!#e(B injecte$B$O!"e(BNODEe$B$r;H$&$h$j$b%m!\<%+%kJQ?t$rD\>@;H$&$\[$&$,$A$g$C$He(B e$BB.$$$h$&$J5$$,$7$^$9!#e(B onee$B$O!“0lEYe(Bfalsee$B$K$J$C$F$7$^$($P$=$l0J\>eB39T$9$kI,MW$O$J$$$s$8$ce(B e$B$J$$$G$7$g$&$+…

---

## [Who is using DBI or oci8 in production systems](https://www.ruby-forum.com/t/who-is-using-dbi-or-oci8-in-production-systems/104491)

<div class="topic-metadata">

**Author:** [@benemson](https://www.ruby-forum.com/u/benemson)\
**Replies:** 2\
**Last updated:** [May 18, 2007, 6:07pm UTC](https://www.ruby-forum.com/t/who-is-using-dbi-or-oci8-in-production-systems/104491 "2007-05-18T18:07:46Z")

</div>

I am doing a bit of research on accessing Oracle from Ruby. It seems oc8i, either used on its own or through DBI, is the way to go. These protects are both in beta and DBI seems to be fairly inactive. So my questio…

---

## [A bit of help](https://www.ruby-forum.com/t/a-bit-of-help/104492)

<div class="topic-metadata">

**Author:** [@acoole](https://www.ruby-forum.com/u/acoole)\
**Replies:** 4\
**Last updated:** [May 18, 2007, 6:06pm UTC](https://www.ruby-forum.com/t/a-bit-of-help/104492 "2007-05-18T18:06:46Z")

</div>

Ok say i was using this code using SciTE puts ‘Hello there, and what’s your name?’ name = gets puts 'Your name is ’ + name + ‘? What a lovely name!’ puts 'Pleased to meet you, ’ + name + ‘. :)’ After i input my na…

---

## [Re: A bit of help](https://www.ruby-forum.com/t/re-a-bit-of-help/104493)

<div class="topic-metadata">

**Author:** [@nuby2ruby](https://www.ruby-forum.com/u/nuby2ruby)\
**Replies:** 0\
**Last updated:** [May 18, 2007, 5:54pm UTC](https://www.ruby-forum.com/t/re-a-bit-of-help/104493 "2007-05-18T17:54:43Z")

</div>

Here is a little chunk of code that may help you puts ‘I am a fortune-teller. Tell me your first name:’ fname = gets.chomp puts ‘What is your last name.’ lname = gets.chomp puts 'Hello, '+ fname + ’ '+ lname + '. '…

---

## [Math lib (even in C or C++... nobody is perfect !)](https://www.ruby-forum.com/t/math-lib-even-in-c-or-c-nobody-is-perfect/104477)

<div class="topic-metadata">

**Author:** [@Josselin](https://www.ruby-forum.com/u/Josselin)\
**Replies:** 2\
**Last updated:** [May 18, 2007, 5:41pm UTC](https://www.ruby-forum.com/t/math-lib-even-in-c-or-c-nobody-is-perfect/104477 "2007-05-18T17:41:42Z")

</div>

I am looking for a function to calculate the barycentre of a point list (GPS coordinates lat/lng) … anybody aware of such lib or utility I could rewrite in Ruby ? bet it doesn’t exist yet thanks for any hint joss

---

## [Re: Beginner question](https://www.ruby-forum.com/t/re-beginner-question/104481)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 4\
**Last updated:** [May 18, 2007, 5:25pm UTC](https://www.ruby-forum.com/t/re-beginner-question/104481 "2007-05-18T17:25:39Z")

</div>

I guess I did not ask my question very clearly. Sorry about that. What does the “#{ }” do for you? I think what I am missing is the feature provided by having that as a wrapper vs bare. Does that make sense? Thanks …

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

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