# Ruby

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

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

---

## [Inspecting cyclic structures](https://www.ruby-forum.com/t/inspecting-cyclic-structures/53683)

<div class="topic-metadata">

**Author:** [@konsu](https://www.ruby-forum.com/u/konsu)\
**Replies:** 2\
**Last updated:** [February 13, 2006, 7:08pm UTC](https://www.ruby-forum.com/t/inspecting-cyclic-structures/53683 "2006-02-13T19:08:31Z")

</div>

hello, is there a way to inspect an object only to a given depth to avoid infinite loops in case of referential loops? like irb does: irb(main):001:0\> a = Object.new =\> #Object:0x2be6cd0 irb(main):002:0\> b = Objec…

---

## [Command Pipeline (pipes & filters) in Ruby](https://www.ruby-forum.com/t/command-pipeline-pipes-filters-in-ruby/66417)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 6\
**Last updated:** [February 13, 2006, 6:38pm UTC](https://www.ruby-forum.com/t/command-pipeline-pipes-filters-in-ruby/66417 "2006-02-13T18:38:39Z")

</div>

Anyone know of any generic implementation of a pipeline in ruby? That is, one which takes a bunch of GoF Command objects, and strings them together in the classical pipeline configuration. Any advice on that? I have…

---

## [Framework for storing objects in a relational database](https://www.ruby-forum.com/t/framework-for-storing-objects-in-a-relational-database/53631)

<div class="topic-metadata">

**Author:** [@hildegunst](https://www.ruby-forum.com/u/hildegunst)\
**Replies:** 1\
**Last updated:** [February 13, 2006, 6:21pm UTC](https://www.ruby-forum.com/t/framework-for-storing-objects-in-a-relational-database/53631 "2006-02-13T18:21:04Z")

</div>

Hi Rubyists! I know, off course, that there is an implementation of the active record pattern available. And for using it with Rails for tasks of midrange complexity I consider it to be perfect. But since this aproac…

---

## [Idiomatic ruby](https://www.ruby-forum.com/t/idiomatic-ruby/66323)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 6\
**Last updated:** [February 13, 2006, 5:23pm UTC](https://www.ruby-forum.com/t/idiomatic-ruby/66323 "2006-02-13T17:23:59Z")

</div>

Very often I have a question method, which, in some cases, the caller would want to know why as well. Examples: def valid? end def abort? end Ruby does not allow subclassing true and false, so, if these methods r…

---

## [Can not install mysql-binding](https://www.ruby-forum.com/t/can-not-install-mysql-binding/53674)

<div class="topic-metadata">

**Author:** [@gunnar](https://www.ruby-forum.com/u/gunnar)\
**Replies:** 0\
**Last updated:** [February 13, 2006, 5:08pm UTC](https://www.ruby-forum.com/t/can-not-install-mysql-binding/53674 "2006-02-13T17:08:34Z")

</div>

Hi all I cannot install native MySQL-binding on my iMac G5 using OSX 10.4.4, ie “sudo gem install mysql – --with-mysql-dir=/usr/local/mysql” fails with : Attempting local installation of ‘mysql’ Local gem file not f…

---

## [RoR Active Record question](https://www.ruby-forum.com/t/ror-active-record-question/53664)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [February 13, 2006, 4:29pm UTC](https://www.ruby-forum.com/t/ror-active-record-question/53664 "2006-02-13T16:29:18Z")

</div>

Hiya RoR gurus, I work at a .NET shop, but I enjoy learning Ruby. So, I wanna prototype some of our company’s screens using Rails (and hopefullly AJAX). One thing I’m not sure about, since I’m a noob, is whether Ac…

---

## [Irb problem in OSX](https://www.ruby-forum.com/t/irb-problem-in-osx/66368)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 7\
**Last updated:** [February 13, 2006, 1:33pm UTC](https://www.ruby-forum.com/t/irb-problem-in-osx/66368 "2006-02-13T13:33:45Z")

</div>

I’m not sure how I got into this situation being a Mac newbie, but I think it started after running one of the various “fix ruby on OS X” scripts. The problem is, everytime I click on my Terminal shortcut on the dock, …

---

## [Tar2rubyscript/rubyscript2exe](https://www.ruby-forum.com/t/tar2rubyscript-rubyscript2exe/101238)

<div class="topic-metadata">

**Author:** [@kilivor](https://www.ruby-forum.com/u/kilivor)\
**Replies:** 1\
**Last updated:** [February 13, 2006, 10:57am UTC](https://www.ruby-forum.com/t/tar2rubyscript-rubyscript2exe/101238 "2006-02-13T10:57:40Z")

</div>

Hi! I have been using tar2rubyscript and rubyscript2exe with FXRuby and it works like a charm. But now first time I am trying to generate a file from ruby. It works fine with the interpreter, but apparently not with …

---

## [Howto use rubyscript2exe to package some external applicatio](https://www.ruby-forum.com/t/howto-use-rubyscript2exe-to-package-some-external-applicatio/66321)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 3\
**Last updated:** [February 13, 2006, 9:53am UTC](https://www.ruby-forum.com/t/howto-use-rubyscript2exe-to-package-some-external-applicatio/66321 "2006-02-13T09:53:39Z")

</div>

Dear all, I would like to distribute a Ruby application that calls an external application. So far, I give the potential user the opportunity to enter or change some Gnuplot code, which is sent to Gnuplot via Open…

---

## [Re: inheritance from C object with different parameter count](https://www.ruby-forum.com/t/re-inheritance-from-c-object-with-different-parameter-count/66464)

<div class="topic-metadata">

**Author:** [@Geert\_F](https://www.ruby-forum.com/u/Geert_F)\
**Replies:** 0\
**Last updated:** [February 13, 2006, 9:24am UTC](https://www.ruby-forum.com/t/re-inheritance-from-c-object-with-different-parameter-count/66464 "2006-02-13T09:24:01Z")

</div>

Thank you, this was exact the information I was looking for. Greetings, Geert.

---

## [Cutting a piece of text](https://www.ruby-forum.com/t/cutting-a-piece-of-text/66152)

<div class="topic-metadata">

**Author:** [@Zdebel](https://www.ruby-forum.com/u/Zdebel)\
**Replies:** 13\
**Last updated:** [February 13, 2006, 8:58am UTC](https://www.ruby-forum.com/t/cutting-a-piece-of-text/66152 "2006-02-13T08:58:34Z")

</div>

Helo ! I’ve started to learn ruby and I’m amazed with it. Now I have a problem that I can’t solve. If I have a string like this: " Lalalalala " how can I cut the " artist=XXX album=XXX title=XXX" part, so it would lo…

---

## [Extending NArray](https://www.ruby-forum.com/t/extending-narray/65963)

<div class="topic-metadata">

**Author:** [@Cameron\_McBride](https://www.ruby-forum.com/u/Cameron_McBride)\
**Replies:** 2\
**Last updated:** [February 13, 2006, 8:15am UTC](https://www.ruby-forum.com/t/extending-narray/65963 "2006-02-13T08:15:18Z")

</div>

I’m trying to make the fast extensions to NArray, yet still preserve the general nature of methods (i.e. works on all NArray types). As an example, I’ll show benchmarks of a simple weighted mean: Benchmarking based: …

---

## [Implementing the Self-Shunt testing pattern](https://www.ruby-forum.com/t/implementing-the-self-shunt-testing-pattern/53651)

<div class="topic-metadata">

**Author:** [@pezdude](https://www.ruby-forum.com/u/pezdude)\
**Replies:** 2\
**Last updated:** [February 13, 2006, 7:27am UTC](https://www.ruby-forum.com/t/implementing-the-self-shunt-testing-pattern/53651 "2006-02-13T07:27:58Z")

</div>

I just stumbled across the Self-Shunt unit testing pattern\[0\] and decided, in my nuby quest to learn more about Ruby, to implement it in Ruby. It’s simple enough thanks to duck-typing. Almost ridiculously so, in fact. …

---

## [ONLamp tutorial install issue (mysql gem)](https://www.ruby-forum.com/t/onlamp-tutorial-install-issue-mysql-gem/101971)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 7\
**Last updated:** [February 13, 2006, 5:32am UTC](https://www.ruby-forum.com/t/onlamp-tutorial-install-issue-mysql-gem/101971 "2006-02-13T05:32:23Z")

</div>

Hi all, I have downloaded and installed Ruby on Rails and started on the ONLamp tutorial (cookbook), all went well and RoR installed OK. My installation of MySql gem file failed with error: ERROR: Error installing g…

---

## [Unsubscribe](https://www.ruby-forum.com/t/unsubscribe/66374)

<div class="topic-metadata">

**Author:** [@drec](https://www.ruby-forum.com/u/drec)\
**Replies:** 0\
**Last updated:** [February 13, 2006, 4:33am UTC](https://www.ruby-forum.com/t/unsubscribe/66374 "2006-02-13T04:33:06Z")

</div>

unsubscribe

---

## [My coding style](https://www.ruby-forum.com/t/my-coding-style/53222)

<div class="topic-metadata">

**Author:** [@dirk](https://www.ruby-forum.com/u/dirk)\
**Replies:** 8\
**Last updated:** [February 13, 2006, 3:14am UTC](https://www.ruby-forum.com/t/my-coding-style/53222 "2006-02-13T03:14:04Z")

</div>

hi all, i was wondering if my rubyness has increased above the ‘total newbie’-level… so below is some code in my coding style, can you give comments on how it looks and how effective it is. greetings Dirk. def fin…

---

## [Ruby course confusion](https://www.ruby-forum.com/t/ruby-course-confusion/66035)

<div class="topic-metadata">

**Author:** [@combas](https://www.ruby-forum.com/u/combas)\
**Replies:** 4\
**Last updated:** [February 13, 2006, 1:52am UTC](https://www.ruby-forum.com/t/ruby-course-confusion/66035 "2006-02-13T01:52:52Z")

</div>

Working my way through the “ruby course” I was wondering if anyone else finds this tutorial a little confusing. Its really good in parts, but other parts are really unclear but maybe its just me. For example: find\_…

---

## [SAFE levels](https://www.ruby-forum.com/t/safe-levels/66113)

<div class="topic-metadata">

**Author:** [@tma](https://www.ruby-forum.com/u/tma)\
**Replies:** 3\
**Last updated:** [February 13, 2006, 1:30am UTC](https://www.ruby-forum.com/t/safe-levels/66113 "2006-02-13T01:30:53Z")

</div>

Is there somewhere I can find some description on the proper care and feeding of Ruby SafeLevels? I was going to start looking into Rails, but the notion of SafeLevel = 0 being a requirement is kind of a “really bad…

---

## [Newbie question about blocks](https://www.ruby-forum.com/t/newbie-question-about-blocks/66282)

<div class="topic-metadata">

**Author:** [@braas](https://www.ruby-forum.com/u/braas)\
**Replies:** 4\
**Last updated:** [February 12, 2006, 11:34pm UTC](https://www.ruby-forum.com/t/newbie-question-about-blocks/66282 "2006-02-12T23:34:05Z")

</div>

Hi, I want to square every element in my array using a block: a = (1…1000).to\_a a.each {|x| x\*\*2} But this does not seem to work, it just outputs my array completely unchanged :frowning:

---

## [Implanting a new method for a class](https://www.ruby-forum.com/t/implanting-a-new-method-for-a-class/66232)

<div class="topic-metadata">

**Author:** [@braas](https://www.ruby-forum.com/u/braas)\
**Replies:** 4\
**Last updated:** [February 12, 2006, 9:57pm UTC](https://www.ruby-forum.com/t/implanting-a-new-method-for-a-class/66232 "2006-02-12T21:57:03Z")

</div>

Hi there, I have a question regarding how to implant a new method into the class Array. I would like to write a ruby file that sums all of the digits in an array. I have tried this: class Array def Array.sum unti…

---

## [Irb not working in stable snapshot](https://www.ruby-forum.com/t/irb-not-working-in-stable-snapshot/66233)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [February 12, 2006, 9:44pm UTC](https://www.ruby-forum.com/t/irb-not-working-in-stable-snapshot/66233 "2006-02-12T21:44:30Z")

</div>

Look what I have here: zeus:~ # ruby -v ruby 1.8.4 (2006-02-12) \[i686-linux\] zeus:~ # irb -v irb 0.9.5(05/04/13) zeus:~ # irb /usr/local/lib/ruby/1.8/irb/workspace.rb:52: undefined method \`irb\_binding’ for main:Ob…

---

## [Ruby/Python Continuations: Turning a block callback into a r](https://www.ruby-forum.com/t/ruby-python-continuations-turning-a-block-callback-into-a-r/66198)

<div class="topic-metadata">

**Author:** [@robert](https://www.ruby-forum.com/u/robert)\
**Replies:** 0\
**Last updated:** [February 12, 2006, 9:18pm UTC](https://www.ruby-forum.com/t/ruby-python-continuations-turning-a-block-callback-into-a-r/66198 "2006-02-12T21:18:38Z")

</div>

After failing on a yield/iterator-continuation problem in Python (see below) I tried the Ruby (1.8.2) language first time on that construct: The example tries to convert a block callback interface (Net::FTP.retrbinary…

---

## [The problem of install mysql driver using gem for Rails](https://www.ruby-forum.com/t/the-problem-of-install-mysql-driver-using-gem-for-rails/66071)

<div class="topic-metadata">

**Author:** [@gaoxt1983](https://www.ruby-forum.com/u/gaoxt1983)\
**Replies:** 1\
**Last updated:** [February 12, 2006, 8:07pm UTC](https://www.ruby-forum.com/t/the-problem-of-install-mysql-driver-using-gem-for-rails/66071 "2006-02-12T20:07:46Z")

</div>

No more words, see the console textï¼? Results logged to c:/ruby/lib/ruby/gems/1.8/gems/mysql-2.7/gem\_make.out C:\>gem install --remote mysql Attempting remote installation of ‘mysql’ Building native extensions. This …

---

## [Simultaneous text input/output in a command line game](https://www.ruby-forum.com/t/simultaneous-text-input-output-in-a-command-line-game/66073)

<div class="topic-metadata">

**Author:** [@rubyvic](https://www.ruby-forum.com/u/rubyvic)\
**Replies:** 2\
**Last updated:** [February 12, 2006, 7:26pm UTC](https://www.ruby-forum.com/t/simultaneous-text-input-output-in-a-command-line-game/66073 "2006-02-12T19:26:09Z")

</div>

Hi everyone! I?m currently learning Ruby, and have made this simple number guessing game: puts “I’m thinking of a number from 0 to 10. What’s your guess?” my\_number = rand(11) user\_guess = gets.chomp.to\_i until us…

---

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

<div class="topic-metadata">

**Author:** [@Joel\_VanderWerf](https://www.ruby-forum.com/u/Joel_VanderWerf)\
**Replies:** 5\
**Last updated:** [February 12, 2006, 5:38pm UTC](https://www.ruby-forum.com/t/thread-stop/65248 "2006-02-12T17:38:05Z")

</div>

Is it possible for one thread to put another thread in a stop (or sleep) state? (Unlike Thread.stop which stops the current thread.) The answer is currently no (Thread#stop was removed at one point), and Matz has said…

---

## [Immutable and enumerable?](https://www.ruby-forum.com/t/immutable-and-enumerable/66112)

<div class="topic-metadata">

**Author:** [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Replies:** 2\
**Last updated:** [February 12, 2006, 4:08pm UTC](https://www.ruby-forum.com/t/immutable-and-enumerable/66112 "2006-02-12T16:08:31Z")

</div>

Every language and profession has it’s own language. Ruby is no exception. Can someone explain to me what the two terms above mean and why they are so crucial to Ruby? Are they methods/classes ( don’t think so) /modul…

---

## [Ruby/dl question](https://www.ruby-forum.com/t/ruby-dl-question/65703)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 8\
**Last updated:** [February 12, 2006, 2:47pm UTC](https://www.ruby-forum.com/t/ruby-dl-question/65703 "2006-02-12T14:47:26Z")

</div>

if one has: struct flock { … short l\_type; /\* Type of lock: F\_RDLCK, F\_WRLCK, F\_UNLCK / short l\_whence; / How to interpret l\_start: SEEK\_SET, SEEK\_CUR, SEEK\_END / off\_t l\_start; / Starting offset for lock / …

---

## [Itterating through one's path(s)](https://www.ruby-forum.com/t/itterating-through-ones-path-s/66033)

<div class="topic-metadata">

**Author:** [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Replies:** 2\
**Last updated:** [February 12, 2006, 2:02pm UTC](https://www.ruby-forum.com/t/itterating-through-ones-path-s/66033 "2006-02-12T14:02:39Z")

</div>

I’d like to see if I can itterate through the directories of my PATH (or $PATH for Unix-based systems) using blocks. #!/usr/bin/ruby -w path = ENV\[‘PATH’\].split(File::PATH\_SEPARATOR) path.each{|zz| Dir.new zz} There…

---

## [Accessing Class from class symbol](https://www.ruby-forum.com/t/accessing-class-from-class-symbol/66110)

<div class="topic-metadata">

**Author:** [@treefrog](https://www.ruby-forum.com/u/treefrog)\
**Replies:** 1\
**Last updated:** [February 12, 2006, 1:18pm UTC](https://www.ruby-forum.com/t/accessing-class-from-class-symbol/66110 "2006-02-12T13:18:33Z")

</div>

Hi, I’m trying to work out how to access Class methods when I only have the class symbol class Foo def Foo.hello puts “Hello Foo” end end class Bar def Bar.hello puts “Hello Bar” end end str=“Foo” I could d…

---

## [OpenStruct problem](https://www.ruby-forum.com/t/openstruct-problem/65787)

<div class="topic-metadata">

**Author:** [@pool007](https://www.ruby-forum.com/u/pool007)\
**Replies:** 11\
**Last updated:** [February 12, 2006, 1:14pm UTC](https://www.ruby-forum.com/t/openstruct-problem/65787 "2006-02-12T13:14:11Z")

</div>

OpenStruct class seems to be misbehave when it comes to hashing. For example, irb(main):008:0\> o1 = OpenStruct.new =\> irb(main):009:0\> o1.val = “a” =\> “a” irb(main):010:0\> o1 = OpenStruct.new =\> irb(main):011:0\>…

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

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