# Ruby

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

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

---

## [Slicing arrays](https://www.ruby-forum.com/t/slicing-arrays/95587)

<div class="topic-metadata">

**Author:** [@Paul\_DSKraus](https://www.ruby-forum.com/u/Paul_DSKraus)\
**Replies:** 3\
**Last updated:** [June 6, 2006, 11:45pm UTC](https://www.ruby-forum.com/t/slicing-arrays/95587 "2006-06-06T23:45:58Z")

</div>

if have a text file I am parsing. I am using split to break the line into an array. I want to then use splice to pick and choose the fields that I one. so for example i have a string. mystring = ‘1,2,3,4,5,6’ then …

---

## [Problem with setting up rubygem](https://www.ruby-forum.com/t/problem-with-setting-up-rubygem/62544)

<div class="topic-metadata">

**Author:** [@victorfan](https://www.ruby-forum.com/u/victorfan)\
**Replies:** 1\
**Last updated:** [June 6, 2006, 10:41pm UTC](https://www.ruby-forum.com/t/problem-with-setting-up-rubygem/62544 "2006-06-06T22:41:26Z")

</div>

Hi everyone! I am trying to set up Rubygems on my Linux machine; however, I’ve got the following error: \[root@denman rubygems-0.8.11\]# sudo ruby setup.rb —\> bin \<— bin —\> lib —\> lib/rubygems \<— lib/rubygems \<— l…

---

## [FreeRIDE 0.9.6 - The Free Ruby IDE](https://www.ruby-forum.com/t/freeride-0-9-6-the-free-ruby-ide/62640)

<div class="topic-metadata">

**Author:** [@Laurent\_J](https://www.ruby-forum.com/u/Laurent_J)\
**Replies:** 2\
**Last updated:** [June 6, 2006, 10:41pm UTC](https://www.ruby-forum.com/t/freeride-0-9-6-the-free-ruby-ide/62640 "2006-06-06T22:41:03Z")

</div>

Version 0.9.6 of FreeRIDE has been released and is available for download! For details and downloads, go to: http://freeride.rubyforge.org/ 0.9.6 is mostly a bug fix release. The goal was to make FreeRIDE more rob…

---

## [Another Look at Namespaces](https://www.ruby-forum.com/t/another-look-at-namespaces/95481)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 15\
**Last updated:** [June 6, 2006, 10:37pm UTC](https://www.ruby-forum.com/t/another-look-at-namespaces/95481 "2006-06-06T22:37:46Z")

</div>

Had a “light-bulb” over head moment and threw this together as a simple demonstration. It’s prerry neat. THough is stffes from a few problems of course 1) it probaby not very efficient 2) literal notions don’t work an…

---

## [Re: Ruby App as a Windows Service?](https://www.ruby-forum.com/t/re-ruby-app-as-a-windows-service/95582)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 2\
**Last updated:** [June 6, 2006, 10:16pm UTC](https://www.ruby-forum.com/t/re-ruby-app-as-a-windows-service/95582 "2006-06-06T22:16:01Z")

</div>

I couldn’t get win32-service to work. I ended up using Firedaemon. If you use Firedaemon, you don’t need to use RubyScript2Exe. Just have Firedaemon run: ‘ruby c:\\foo\\bar.rb’ sd

---

## [Instance methods can't call protected class methods?](https://www.ruby-forum.com/t/instance-methods-cant-call-protected-class-methods/62632)

<div class="topic-metadata">

**Author:** [@seanhussey](https://www.ruby-forum.com/u/seanhussey)\
**Replies:** 4\
**Last updated:** [June 6, 2006, 10:13pm UTC](https://www.ruby-forum.com/t/instance-methods-cant-call-protected-class-methods/62632 "2006-06-06T22:13:14Z")

</div>

I am trying to understand this behavior. From page 356 of the Pickaxe (2nd ed): Protected. Can be invoked only by objects of the defining class and its subclasses. If I have class Foo … end f = Foo.new Is f not …

---

## [RDoc Multiline Header](https://www.ruby-forum.com/t/rdoc-multiline-header/95511)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 2\
**Last updated:** [June 6, 2006, 8:59pm UTC](https://www.ruby-forum.com/t/rdoc-multiline-header/95511 "2006-06-06T20:59:54Z")

</div>

Anyway to make a mulitline header with RDoc? = Line1 \\n Line 2 ? Thanks, T.

---

## [Multiple threads on single port](https://www.ruby-forum.com/t/multiple-threads-on-single-port/62617)

<div class="topic-metadata">

**Author:** [@stuartbrand](https://www.ruby-forum.com/u/stuartbrand)\
**Replies:** 5\
**Last updated:** [June 6, 2006, 8:53pm UTC](https://www.ruby-forum.com/t/multiple-threads-on-single-port/62617 "2006-06-06T20:53:12Z")

</div>

Hi all Can I use Ruby threads to have more then 1 server process running on the same port something like require ‘socket’ port = (ARGV\[0\] || 80).to\_i server = TCPServer.new(‘localhost’, port) threads = \[\] 10.time…

---

## [Mailing list](https://www.ruby-forum.com/t/mailing-list/95578)

<div class="topic-metadata">

**Author:** [@gunnar](https://www.ruby-forum.com/u/gunnar)\
**Replies:** 1\
**Last updated:** [June 6, 2006, 7:43pm UTC](https://www.ruby-forum.com/t/mailing-list/95578 "2006-06-06T19:43:18Z")

</div>

Please relieve me from this terrible mailing list. I am drowning in bla-bla-bla… I’ve got a number for you: 2006060619005313288375612055 Gunnar SjÃ¶Ã¶

---

## [Ruby App as a Windows Service?](https://www.ruby-forum.com/t/ruby-app-as-a-windows-service/62627)

<div class="topic-metadata">

**Author:** [@sauy7](https://www.ruby-forum.com/u/sauy7)\
**Replies:** 1\
**Last updated:** [June 6, 2006, 7:15pm UTC](https://www.ruby-forum.com/t/ruby-app-as-a-windows-service/62627 "2006-06-06T19:15:34Z")

</div>

Hi This is a query for all those windows power users. I want to install a ruby app as a windows service. I am assuming that the best practice is to use RubyScript2Exe and something like Winserv (@Sw4me) or http://ww…

---

## [One-click installer for Windows and win32-open3](https://www.ruby-forum.com/t/one-click-installer-for-windows-and-win32-open3/95577)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [June 6, 2006, 7:15pm UTC](https://www.ruby-forum.com/t/one-click-installer-for-windows-and-win32-open3/95577 "2006-06-06T19:15:25Z")

</div>

Dear all, I am trying out Ruby from the one-click installer in Windows. I am not really familiar with Windows compiling : does the one-click installer comprise Daniel B.'s tools for windows, in particular win32-open3…

---

## [Project Directory Layouts](https://www.ruby-forum.com/t/project-directory-layouts/95570)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 2\
**Last updated:** [June 6, 2006, 7:06pm UTC](https://www.ruby-forum.com/t/project-directory-layouts/95570 "2006-06-06T19:06:15Z")

</div>

I’m wondering about good practices with regard to the layout of project developement directories. I know there are generally two kinds “Standard” and “SVN” where the SVN type normally has three top level folders: tags…

---

## [Re: External application under Windows](https://www.ruby-forum.com/t/re-external-application-under-windows/95576)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [June 6, 2006, 6:54pm UTC](https://www.ruby-forum.com/t/re-external-application-under-windows/95576 "2006-06-06T18:54:55Z")

</div>

Dear Chris, thank you for that link, it works very well - for Matlab. However, I’d still like to know how this Program.Application thing works in general, since I can not talk to my Gnuplot installation (built in Cyg…

---

## [Mailing List Archives Down](https://www.ruby-forum.com/t/mailing-list-archives-down/95574)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 2\
**Last updated:** [June 6, 2006, 6:44pm UTC](https://www.ruby-forum.com/t/mailing-list-archives-down/95574 "2006-06-06T18:44:14Z")

</div>

Are people aware that the mailing list archives are down? James Edward G. II

---

## [Ruby Quiz Wins Contest](https://www.ruby-forum.com/t/ruby-quiz-wins-contest/62622)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 1\
**Last updated:** [June 6, 2006, 5:57pm UTC](https://www.ruby-forum.com/t/ruby-quiz-wins-contest/62622 "2006-06-06T17:57:55Z")

</div>

This week’s quiz has enough entries to qualify for a signed book. Thank you very much Hans! This concludes the (extended) Ruby Q. contest. I want to thank everyone who sent in such wonderful quizzes for the contest. …

---

## [Ruby and the Open-Closed Principle](https://www.ruby-forum.com/t/ruby-and-the-open-closed-principle/62567)

<div class="topic-metadata">

**Author:** [@jeff](https://www.ruby-forum.com/u/jeff)\
**Replies:** 16\
**Last updated:** [June 6, 2006, 5:48pm UTC](https://www.ruby-forum.com/t/ruby-and-the-open-closed-principle/62567 "2006-06-06T17:48:35Z")

</div>

For most of my OO career (C++ for a long time, and then C#) I believed in the OCP very strongly. It’s supposedly the cornerstone of OOP, right? I came across this article today which brought it mind again: But I re…

---

## [Range methods include? and member?](https://www.ruby-forum.com/t/range-methods-include-and-member/95571)

<div class="topic-metadata">

**Author:** [@markcasio](https://www.ruby-forum.com/u/markcasio)\
**Replies:** 1\
**Last updated:** [June 6, 2006, 4:54pm UTC](https://www.ruby-forum.com/t/range-methods-include-and-member/95571 "2006-06-06T16:54:35Z")

</div>

Do the Range methods include? and member? now do the same thing? I thought include? returned true if the given value was within the range bounds and member? returned true if the given value would be encountered when i…

---

## [Mode](https://www.ruby-forum.com/t/mode/95522)

<div class="topic-metadata">

**Author:** [@curi](https://www.ruby-forum.com/u/curi)\
**Replies:** 8\
**Last updated:** [June 6, 2006, 4:48pm UTC](https://www.ruby-forum.com/t/mode/95522 "2006-06-06T16:48:21Z")

</div>

I bet there’s a more elegant way to write this. Anyone want to show me? def mode(li) best\_num = nil best\_count = -1 li.uniq.each do |item| count = (li.select { |item2| item == item2}).length if count \> best\_count …

---

## [Fxri and tab completion](https://www.ruby-forum.com/t/fxri-and-tab-completion/62615)

<div class="topic-metadata">

**Author:** [@markcasio](https://www.ruby-forum.com/u/markcasio)\
**Replies:** 0\
**Last updated:** [June 6, 2006, 4:45pm UTC](https://www.ruby-forum.com/t/fxri-and-tab-completion/62615 "2006-06-06T16:45:11Z")

</div>

I want to report to whoever maintains fxri (Markus P.?) that tab completion, which works when enabled in irb, doesn’t work in fxri.

---

## [Re: Using Ruby to read .properties file](https://www.ruby-forum.com/t/re-using-ruby-to-read-properties-file/62608)

<div class="topic-metadata">

**Author:** [@Lock\_Stephen](https://www.ruby-forum.com/u/Lock_Stephen)\
**Replies:** 1\
**Last updated:** [June 6, 2006, 4:38pm UTC](https://www.ruby-forum.com/t/re-using-ruby-to-read-properties-file/62608 "2006-06-06T16:38:14Z")

</div>

None that I know of without writing code - but there isn’t much to it. Try this: def load\_properties(properties\_filename) properties = {} File.open(properties\_filename, ‘r’) do |properties\_file| properties\_file.read…

---

## [Using Ruby to read .properties file](https://www.ruby-forum.com/t/using-ruby-to-read-properties-file/95567)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 3\
**Last updated:** [June 6, 2006, 4:31pm UTC](https://www.ruby-forum.com/t/using-ruby-to-read-properties-file/95567 "2006-06-06T16:31:43Z")

</div>

Hi I am working on a project in which I need to read and write the .properties files. Is there a way to do this in Ruby … other than writing code from scratch. Thanks in advance. regards Sanchit

---

## [Leaving files open](https://www.ruby-forum.com/t/leaving-files-open/62605)

<div class="topic-metadata">

**Author:** [@dirk](https://www.ruby-forum.com/u/dirk)\
**Replies:** 6\
**Last updated:** [June 6, 2006, 4:24pm UTC](https://www.ruby-forum.com/t/leaving-files-open/62605 "2006-06-06T16:24:47Z")

</div>

hello list! i’ve learnt to open files like this: File.open(“foo”, “w”) do |file| file.write “foo” end because everyone always says it’s dangerous to leave files open… just, wondering, what could really happen? sup…

---

## [How can I pin a Ruby object in memory?](https://www.ruby-forum.com/t/how-can-i-pin-a-ruby-object-in-memory/62259)

<div class="topic-metadata">

**Author:** [@johnlester](https://www.ruby-forum.com/u/johnlester)\
**Replies:** 15\
**Last updated:** [June 6, 2006, 3:32pm UTC](https://www.ruby-forum.com/t/how-can-i-pin-a-ruby-object-in-memory/62259 "2006-06-06T15:32:05Z")

</div>

I have some data that I’m storing in a T\_DATA VALUE. Is the data that’s stored there part of the GC heap - IOW can it move in memory? If so, is there a way to pin it so that it doesn’t move while I’m using it? Thanks…

---

## [External application under Windows](https://www.ruby-forum.com/t/external-application-under-windows/62589)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [June 6, 2006, 3:12pm UTC](https://www.ruby-forum.com/t/external-application-under-windows/62589 "2006-06-06T15:12:12Z")

</div>

Dear all, in Windows XP, I would like to open a an external program (Matlab), write commands from a text file to it and close it again. Now, I don’t know how to do this using win32ole, as adapting Hal F.'s example of…

---

## [New webserver](https://www.ruby-forum.com/t/new-webserver/95531)

<div class="topic-metadata">

**Author:** [@stuartbrand](https://www.ruby-forum.com/u/stuartbrand)\
**Replies:** 11\
**Last updated:** [June 6, 2006, 2:54pm UTC](https://www.ruby-forum.com/t/new-webserver/95531 "2006-06-06T14:54:45Z")

</div>

Im designing a webserver as my first project on Ruby I need help with this line fileLine.sub(/..//, ‘’) this is to remove any “…/” that occur due to users trying to brake in, or by accident :wink: However, this only…

---

## [Ruby setup?](https://www.ruby-forum.com/t/ruby-setup/95568)

<div class="topic-metadata">

**Author:** [@Mat\_S](https://www.ruby-forum.com/u/Mat_S)\
**Replies:** 0\
**Last updated:** [June 6, 2006, 2:39pm UTC](https://www.ruby-forum.com/t/ruby-setup/95568 "2006-06-06T14:39:30Z")

</div>

A lot of ruby packages have this setup.rb file that always generates output like: —\> bin \<— bin —\> lib —\> lib/rubygems \<— lib/rubygems \<— lib But setup.rb doesn’t appear to be a rake file. Is there some sort of …

---

## [Inheritance from c](https://www.ruby-forum.com/t/inheritance-from-c/62501)

<div class="topic-metadata">

**Author:** [@splashlin](https://www.ruby-forum.com/u/splashlin)\
**Replies:** 2\
**Last updated:** [June 6, 2006, 11:31am UTC](https://www.ruby-forum.com/t/inheritance-from-c/62501 "2006-06-06T11:31:44Z")

</div>

Hi All, I’m messing about with inheritance from my C application but can’t get it to work properly. Here is a quick overview of what I want to achieve: class Hello should parent Helloworld. Both use Data\_Wrap\_Struct …

---

## [Bzipping a file from ruby](https://www.ruby-forum.com/t/bzipping-a-file-from-ruby/62561)

<div class="topic-metadata">

**Author:** [@Edgardo\_H](https://www.ruby-forum.com/u/Edgardo_H)\
**Replies:** 2\
**Last updated:** [June 6, 2006, 9:09am UTC](https://www.ruby-forum.com/t/bzipping-a-file-from-ruby/62561 "2006-06-06T09:09:48Z")

</div>

Hi, Is there a way to bzip2 a file from Ruby without invoking the unix app? I want to create a bzipped tarball without using any external programs so my app can run using anything but plain ol’ Ruby. I’m already usin…

---

## [Re: \[SOLUTION\] Hash to OpenStruct (#81)](https://www.ruby-forum.com/t/re-solution-hash-to-openstruct-81/62469)

<div class="topic-metadata">

**Author:** [@Alison\_Rowland](https://www.ruby-forum.com/u/Alison_Rowland)\
**Replies:** 5\
**Last updated:** [June 6, 2006, 8:45am UTC](https://www.ruby-forum.com/t/re-solution-hash-to-openstruct-81/62469 "2006-06-06T08:45:20Z")

</div>

This “solution” feels rather like cheating, but I did discover the lovely Facets library in the process, which I’m sure I’ll be using again. === require ‘yaml’ require ‘ostruct’ require ‘rubygems’ require ‘facet/h…

---

## [Creating Daemon Processes in Windows](https://www.ruby-forum.com/t/creating-daemon-processes-in-windows/95530)

<div class="topic-metadata">

**Author:** [@Jatinder\_S](https://www.ruby-forum.com/u/Jatinder_S)\
**Replies:** 2\
**Last updated:** [June 6, 2006, 8:41am UTC](https://www.ruby-forum.com/t/creating-daemon-processes-in-windows/95530 "2006-06-06T08:41:59Z")

</div>

From a ruby program I would like to start another process which should continue to run even after the parent process dies. Is there any way I could achive this? From the child process I want to start an instance of SC…

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

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