# Ruby

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

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

---

## [\[SOLUTION\] Quiz #76](https://www.ruby-forum.com/t/solution-quiz-76/58573)

<div class="topic-metadata">

**Author:** [@Jesse\_H-K](https://www.ruby-forum.com/u/Jesse_H-K)\
**Replies:** 1\
**Last updated:** [April 23, 2006, 9:24pm UTC](https://www.ruby-forum.com/t/solution-quiz-76/58573 "2006-04-23T21:24:29Z")

</div>

I sincerely hope I am doing this correctly, as… (1) I have never posted to a mailing list. (2) I have never participated in Ruby Q. (3) I really hope I am posting at the right time, place, etc I apologise if I did th…

---

## [What Happened to the Default Ruby Installation on Mac OS X 1](https://www.ruby-forum.com/t/what-happened-to-the-default-ruby-installation-on-mac-os-x-1/58600)

<div class="topic-metadata">

**Author:** [@agnathan](https://www.ruby-forum.com/u/agnathan)\
**Replies:** 0\
**Last updated:** [April 23, 2006, 9:11pm UTC](https://www.ruby-forum.com/t/what-happened-to-the-default-ruby-installation-on-mac-os-x-1/58600 "2006-04-23T21:11:58Z")

</div>

I usually use a ruby installed through DarwinPorts, but I have some scripts which are hardcoded for /usr/bin/ruby. My shell wrote: rubysig.h version.h dl.h env.h node.h ruby.h …

---

## [Cannot connect to server in OS X](https://www.ruby-forum.com/t/cannot-connect-to-server-in-os-x/94166)

<div class="topic-metadata">

**Author:** [@damien](https://www.ruby-forum.com/u/damien)\
**Replies:** 1\
**Last updated:** [April 23, 2006, 7:25pm UTC](https://www.ruby-forum.com/t/cannot-connect-to-server-in-os-x/94166 "2006-04-23T19:25:35Z")

</div>

i’ve just finished installing ruby, ruby gems, rails, blah, blah, blah, as explained here: throughout the installation, everything seemed fine but when i try to access http://localhost:3000/ i get a connection refuse…

---

## [Re: \[SOLUTION\] Text Munger #76](https://www.ruby-forum.com/t/re-solution-text-munger-76/58589)

<div class="topic-metadata">

**Author:** [@gordon321](https://www.ruby-forum.com/u/gordon321)\
**Replies:** 1\
**Last updated:** [April 23, 2006, 7:00pm UTC](https://www.ruby-forum.com/t/re-solution-text-munger-76/58589 "2006-04-23T19:00:36Z")

</div>

Here is my solution: class String def munge split(/\\b/).munge\_each.join end end class Array def munge\_each map { |word| word.split(//).munge\_word } end def munge\_word first,last,middle = shift, pop,scramble “…

---

## [Mocking a tcp server](https://www.ruby-forum.com/t/mocking-a-tcp-server/94156)

<div class="topic-metadata">

**Author:** [@pergesu](https://www.ruby-forum.com/u/pergesu)\
**Replies:** 1\
**Last updated:** [April 23, 2006, 6:41pm UTC](https://www.ruby-forum.com/t/mocking-a-tcp-server/94156 "2006-04-23T18:41:46Z")

</div>

I have an class that should connect to a server and just wait for responses. Here’s the class, it’s very basic class Connection def initialize(host, port) @host, @port = host, port @server = TCPSocket.new @h…

---

## [How to properly interact with processes?](https://www.ruby-forum.com/t/how-to-properly-interact-with-processes/58584)

<div class="topic-metadata">

**Author:** [@johanati](https://www.ruby-forum.com/u/johanati)\
**Replies:** 2\
**Last updated:** [April 23, 2006, 6:40pm UTC](https://www.ruby-forum.com/t/how-to-properly-interact-with-processes/58584 "2006-04-23T18:40:28Z")

</div>

I’ve been trying for three days now to find a proper way of interacting with external processes without a satisfactory result. Thus I turn to the expertise of this group in hope of salvation :slight\_smile: During my e…

---

## [Text Munger (#76): A solution](https://www.ruby-forum.com/t/text-munger-76-a-solution/58572)

<div class="topic-metadata">

**Author:** [@Stefano\_T](https://www.ruby-forum.com/u/Stefano_T)\
**Replies:** 2\
**Last updated:** [April 23, 2006, 5:43pm UTC](https://www.ruby-forum.com/t/text-munger-76-a-solution/58572 "2006-04-23T17:43:34Z")

</div>

First the solution and then the comments: 1 #!/usr/bin/env ruby 2 require 'unicode' 3 class String 4 Diacritic = Regexp.new("\[\\xcc\\x80-\\xcd\\xaf\]",nil,'u') 5 Specials = “\\xc3\\x86\\xc3\\x90\\xc3\\x98\\xc3\\x9e…

---

## [Text Munger (#76) simplistic solution](https://www.ruby-forum.com/t/text-munger-76-simplistic-solution/58578)

<div class="topic-metadata">

**Author:** [@A\_LeDonne](https://www.ruby-forum.com/u/A_LeDonne)\
**Replies:** 1\
**Last updated:** [April 23, 2006, 5:31pm UTC](https://www.ruby-forum.com/t/text-munger-76-simplistic-solution/58578 "2006-04-23T17:31:01Z")

</div>

This solution makes no attempt to deal with non-ascii, AND counts underscore as a word character. This is the first time I read a quiz, took a crack at a solution, and found my brain spitting out “inject” on the first…

---

## [\[SOLUTION\] Text Munger (#76)](https://www.ruby-forum.com/t/solution-text-munger-76/58577)

<div class="topic-metadata">

**Author:** [@rambor](https://www.ruby-forum.com/u/rambor)\
**Replies:** 0\
**Last updated:** [April 23, 2006, 4:41pm UTC](https://www.ruby-forum.com/t/solution-text-munger-76/58577 "2006-04-23T16:41:30Z")

</div>

Hello, some people solved this quiz in one line, but I did it in 120 : I would like to read advices what could be improved, even if it’s small things. There is still a problem with upper- and lowercase during “demung…

---

## [Installationsproblem with FC5 and MOD\_Ruby](https://www.ruby-forum.com/t/installationsproblem-with-fc5-and-mod-ruby/58576)

<div class="topic-metadata">

**Author:** [@doc](https://www.ruby-forum.com/u/doc)\
**Replies:** 0\
**Last updated:** [April 23, 2006, 4:10pm UTC](https://www.ruby-forum.com/t/installationsproblem-with-fc5-and-mod-ruby/58576 "2006-04-23T16:10:18Z")

</div>

Hi, i have try to install the mod\_ruby. I think i ll have all packet install who i need. HTTPD + HTTPD-Devel ================================================ \[root@mutter mod\_ruby-1.2.5\]# ./configure.rb checking fo…

---

## [Ruby-oci8 0.1.15](https://www.ruby-forum.com/t/ruby-oci8-0-1-15/58574)

<div class="topic-metadata">

**Author:** [@KUBO\_Takehiro](https://www.ruby-forum.com/u/KUBO_Takehiro)\
**Replies:** 0\
**Last updated:** [April 23, 2006, 4:07pm UTC](https://www.ruby-forum.com/t/ruby-oci8-0-1-15/58574 "2006-04-23T16:07:34Z")

</div>

ruby-oci8 0.1.15 is released. This is a Oracle module using OCI8 API. URL:http://rubyforge.org/projects/ruby-oci8/ What’s new: no new features. :-\< suppress memory usage when binding a placeholder which is alrea…

---

## [Metaprogramming is fun!](https://www.ruby-forum.com/t/metaprogramming-is-fun/58558)

<div class="topic-metadata">

**Author:** [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Replies:** 3\
**Last updated:** [April 23, 2006, 3:12pm UTC](https://www.ruby-forum.com/t/metaprogramming-is-fun/58558 "2006-04-23T15:12:19Z")

</div>

I finally decided to dive in and give metaprogramming in Ruby a shot. I’m not sure that my example is exactly practical, but it seemed useful at the time. There’s a few areas I would like to hear others suggestions …

---

## [\[QUIZ\] Text Munger (#76)](https://www.ruby-forum.com/t/quiz-text-munger-76/58530)

<div class="topic-metadata">

**Author:** [@Alex\_Barrett](https://www.ruby-forum.com/u/Alex_Barrett)\
**Replies:** 8\
**Last updated:** [April 23, 2006, 2:47pm UTC](https://www.ruby-forum.com/t/quiz-text-munger-76/58530 "2006-04-23T14:47:33Z")

</div>

Might as well send it in seperately: puts gets.gsub(/\\B\[a-z\]+\\B/i){|s|l=s.length ;l.times{|i|r=rand(l);s\[i\],s\[r\]=s\[r\],s\[i\]};s} 88 characters in total.

---

## [Metaprogramming Conventions](https://www.ruby-forum.com/t/metaprogramming-conventions/94160)

<div class="topic-metadata">

**Author:** [@dasch](https://www.ruby-forum.com/u/dasch)\
**Replies:** 1\
**Last updated:** [April 23, 2006, 2:22pm UTC](https://www.ruby-forum.com/t/metaprogramming-conventions/94160 "2006-04-23T14:22:54Z")

</div>

Recently, there was a post on news:comp.lang.ruby\[1\] by Avdi G., who asked if there were any conventions when using metaprogramming. He gave this example: require ‘memoize’ require ‘validate’ class Foo attr\_accesso…

---

## [Linking Woes](https://www.ruby-forum.com/t/linking-woes/94144)

<div class="topic-metadata">

**Author:** [@wes](https://www.ruby-forum.com/u/wes)\
**Replies:** 3\
**Last updated:** [April 23, 2006, 8:12am UTC](https://www.ruby-forum.com/t/linking-woes/94144 "2006-04-23T08:12:09Z")

</div>

test123.rb:3: uninitialized constant Profile (NameError) This is the error message I am getting. I have written a class Profile which works just fine when I test it in Profile.rb. Whenever I go to link that class in a…

---

## [Re: thread count](https://www.ruby-forum.com/t/re-thread-count/94155)

<div class="topic-metadata">

**Author:** [@Gennady\_B](https://www.ruby-forum.com/u/Gennady_B)\
**Replies:** 0\
**Last updated:** [April 23, 2006, 7:28am UTC](https://www.ruby-forum.com/t/re-thread-count/94155 "2006-04-23T07:28:20Z")

</div>

Thread.list.size

---

## [Optional Message Parameters?](https://www.ruby-forum.com/t/optional-message-parameters/58372)

<div class="topic-metadata">

**Author:** [@nko](https://www.ruby-forum.com/u/nko)\
**Replies:** 7\
**Last updated:** [April 23, 2006, 6:57am UTC](https://www.ruby-forum.com/t/optional-message-parameters/58372 "2006-04-23T06:57:54Z")

</div>

(Warning: Newbie Altert!) How do I write a method with optional params? I would think that this: def do\_this(opt1="", opt2="") puts opt2 end do\_this(opt2=“This”) Would result in “This” being displayed. Instead, “Th…

---

## [Thread count](https://www.ruby-forum.com/t/thread-count/94153)

<div class="topic-metadata">

**Author:** [@brad](https://www.ruby-forum.com/u/brad)\
**Replies:** 0\
**Last updated:** [April 23, 2006, 4:54am UTC](https://www.ruby-forum.com/t/thread-count/94153 "2006-04-23T04:54:13Z")

</div>

I’m writing a basic socket server in Ruby. I’ve made it use threads to handle multiple simultaneous connections. What’s the simpliest way to count the number of current threads? Python has a threading.activeCount meth…

---

## [Thinking in OO](https://www.ruby-forum.com/t/thinking-in-oo/94147)

<div class="topic-metadata">

**Author:** [@snow-templar](https://www.ruby-forum.com/u/snow-templar)\
**Replies:** 2\
**Last updated:** [April 23, 2006, 1:58am UTC](https://www.ruby-forum.com/t/thinking-in-oo/94147 "2006-04-23T01:58:29Z")

</div>

Hi all, Trying hard to get my brain wrapped around the concepts of OO (using Ruby which i’m also new to but doesn’t seem as foreign to me). I’m using rrobots (at rubyforge) to practice… This is what’s provided to me…

---

## [Manchester.rb ? (as in Manchester, UK)](https://www.ruby-forum.com/t/manchester-rb-as-in-manchester-uk/58549)

<div class="topic-metadata">

**Author:** [@prichard](https://www.ruby-forum.com/u/prichard)\
**Replies:** 1\
**Last updated:** [April 23, 2006, 1:18am UTC](https://www.ruby-forum.com/t/manchester-rb-as-in-manchester-uk/58549 "2006-04-23T01:18:21Z")

</div>

Was wondering if there was a Rubyist meet-up here in Manchester, UK, and if not whether there would be interest in starting one. If somebody has offices and a number for pizza, cool, otherwise I know most of the bars …

---

## [Newbie questoin of the day:A for loop that counts backwards?](https://www.ruby-forum.com/t/newbie-questoin-of-the-day-a-for-loop-that-counts-backwards/58461)

<div class="topic-metadata">

**Author:** [@mendake](https://www.ruby-forum.com/u/mendake)\
**Replies:** 10\
**Last updated:** [April 23, 2006, 12:11am UTC](https://www.ruby-forum.com/t/newbie-questoin-of-the-day-a-for-loop-that-counts-backwards/58461 "2006-04-23T00:11:01Z")

</div>

How do I get a for loop to count backwards? I have the loop… for i in 1 … 8 …but I want it to start at 8 and end at 1. This does NOT work: for i in 8 … 1 Thanks for helping out a newbie.

---

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

<div class="topic-metadata">

**Author:** [@weyus](https://www.ruby-forum.com/u/weyus)\
**Replies:** 4\
**Last updated:** [April 22, 2006, 11:00pm UTC](https://www.ruby-forum.com/t/regular-expression-to-parse-out-host-part-of-url-string/57996 "2006-04-22T23:00:33Z")

</div>

All, I am trying to write a regex to parse out the “host” part of a potential URL. So if presented with I want to get If presented with I want to get If presented with www.cnn.com/some/other/stuff I want…

---

## [Wake Up NYC Companies! NYC Ruby Slaves For Hire Next Tuesday](https://www.ruby-forum.com/t/wake-up-nyc-companies-nyc-ruby-slaves-for-hire-next-tuesday/58544)

<div class="topic-metadata">

**Author:** [@Zed\_S](https://www.ruby-forum.com/u/Zed_S)\
**Replies:** 0\
**Last updated:** [April 22, 2006, 10:41pm UTC](https://www.ruby-forum.com/t/wake-up-nyc-companies-nyc-ruby-slaves-for-hire-next-tuesday/58544 "2006-04-22T22:41:54Z")

</div>

The NYC Ruby Group was planning a little job fair for next Tuesday’s meeting: http://nycruby.com/wiki/pages/Job+Fair+Announcement But sadly we received 1 solid company RSVP and only 8 interested potential employees. …

---

## [Ruby/Watchcat 1.0.0](https://www.ruby-forum.com/t/ruby-watchcat-1-0-0/58481)

<div class="topic-metadata">

**Author:** [@reflex](https://www.ruby-forum.com/u/reflex)\
**Replies:** 4\
**Last updated:** [April 22, 2006, 8:50pm UTC](https://www.ruby-forum.com/t/ruby-watchcat-1-0-0/58481 "2006-04-22T20:50:04Z")

</div>

Hello I’m pleased to announce the release of Ruby/Watchcat 1.0.0. Ruby/Watchcat is an extension for Ruby for the development of watchcatd-aware applications. Watchcatd is a watchdog-like daemon in the sense that it t…

---

## [Method vs variable assigment](https://www.ruby-forum.com/t/method-vs-variable-assigment/58535)

<div class="topic-metadata">

**Author:** [@gioele](https://www.ruby-forum.com/u/gioele)\
**Replies:** 1\
**Last updated:** [April 22, 2006, 8:46pm UTC](https://www.ruby-forum.com/t/method-vs-variable-assigment/58535 "2006-04-22T20:46:56Z")

</div>

I can’t understand why this script | #!/usr/bin/ruby | class A | attr\_accessor :v | | def test | p @v | end | | def mod\_explicit\_setter | self.v = “explicit setter” | end | | def mod\_sett…

---

## [Require problem](https://www.ruby-forum.com/t/require-problem/58534)

<div class="topic-metadata">

**Author:** [@Ernest\_Obusek](https://www.ruby-forum.com/u/Ernest_Obusek)\
**Replies:** 1\
**Last updated:** [April 22, 2006, 8:25pm UTC](https://www.ruby-forum.com/t/require-problem/58534 "2006-04-22T20:25:25Z")

</div>

I’m trying to use the WWW::Mechanize library and I created a short script for it. When I run it I get an error saying: ./getfindata.rb:3:in \`require’: No such file to load – mechanize (LoadError) from ./getfindata.r…

---

## [YAML, ERB & nested maps problem](https://www.ruby-forum.com/t/yaml-erb-nested-maps-problem/58512)

<div class="topic-metadata">

**Author:** [@131313](https://www.ruby-forum.com/u/131313)\
**Replies:** 10\
**Last updated:** [April 22, 2006, 7:57pm UTC](https://www.ruby-forum.com/t/yaml-erb-nested-maps-problem/58512 "2006-04-22T19:57:36Z")

</div>

Hi, I’m trying to genereate YAML fixtures with ERB, but I can’t get it to work with nested maps. Here is my code: $ cat currencies.yml first: id: 1 filename: dummy1.png params: \<%= { :dates =\> \[‘2006-04-20’\], :cu…

---

## [Class\_eval used inline vs within class definition](https://www.ruby-forum.com/t/class-eval-used-inline-vs-within-class-definition/58510)

<div class="topic-metadata">

**Author:** [@pergesu](https://www.ruby-forum.com/u/pergesu)\
**Replies:** 8\
**Last updated:** [April 22, 2006, 7:54pm UTC](https://www.ruby-forum.com/t/class-eval-used-inline-vs-within-class-definition/58510 "2006-04-22T19:54:29Z")

</div>

I’m reading the Ruby for Rails book, and on page 350 it has the example irb(main):001:0\> var = “initialized variable” =\> “initialized variable” irb(main):002:0\> class C; end =\> nil irb(main):003:0\> C.class\_eval { de…

---

## [Reap 4.5.0](https://www.ruby-forum.com/t/reap-4-5-0/94143)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [April 22, 2006, 6:36pm UTC](https://www.ruby-forum.com/t/reap-4-5-0/94143 "2006-04-22T18:36:56Z")

</div>

A N N O U N C I N G Reap, v4.5.0 The Bountiful Ruby Project Management Assistant http://reap.rubyforge.org REAP THE REWARDS! ABSTRACT -------------\> …

---

## [Reap 4.5.0](https://www.ruby-forum.com/t/reap-4-5-0/94141)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 2\
**Last updated:** [April 22, 2006, 6:24pm UTC](https://www.ruby-forum.com/t/reap-4-5-0/94141 "2006-04-22T18:24:33Z")

</div>

Hah! Too kenn on the the Rake interoperabilty feature! The Subject obviously shoud ready “Reap 4.5.0”. T.

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

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