# Ruby

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

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

---

## [Insert into erb binding](https://www.ruby-forum.com/t/insert-into-erb-binding/78636)

<div class="topic-metadata">

**Author:** [@nuby2ruby](https://www.ruby-forum.com/u/nuby2ruby)\
**Replies:** 4\
**Last updated:** [December 8, 2006, 3:08pm UTC](https://www.ruby-forum.com/t/insert-into-erb-binding/78636 "2006-12-08T15:08:43Z")

</div>

I have a class that takes a template, parses it through ERB, then takes the output for some custom manipulation. When the class is created as an object a binding is passed to it to be passed to the template. Is it pos…

---

## [Fwd: Please Forward: Ruby Quiz Submission](https://www.ruby-forum.com/t/fwd-please-forward-ruby-quiz-submission/78777)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 0\
**Last updated:** [December 8, 2006, 3:00pm UTC](https://www.ruby-forum.com/t/fwd-please-forward-ruby-quiz-submission/78777 "2006-12-08T15:00:42Z")

</div>

Begin forwarded message:

---

## [Anyone using ragi without rails?](https://www.ruby-forum.com/t/anyone-using-ragi-without-rails/78775)

<div class="topic-metadata">

**Author:** [@shawn\_bright](https://www.ruby-forum.com/u/shawn_bright)\
**Replies:** 0\
**Last updated:** [December 8, 2006, 2:56pm UTC](https://www.ruby-forum.com/t/anyone-using-ragi-without-rails/78775 "2006-12-08T14:56:40Z")

</div>

Hello there all. I have been looking at RAGI to replace the software that i now use to interface with Asterisk. All of the examples that i have seen for it, including the tutorials, show RAGI being used with RoR. W…

---

## [Invasive parameters as method mode variables](https://www.ruby-forum.com/t/invasive-parameters-as-method-mode-variables/78524)

<div class="topic-metadata">

**Author:** [@Trans](https://www.ruby-forum.com/u/Trans)\
**Replies:** 14\
**Last updated:** [December 8, 2006, 2:40pm UTC](https://www.ruby-forum.com/t/invasive-parameters-as-method-mode-variables/78524 "2006-12-08T14:40:39Z")

</div>

Working on a method where I would like one part of it’s operations to be optional. Here’s the crux of the code: def parse\_multicommand( line=nil, arity={} ) argv = parse\_line(line) argv = multi\_flag(argv) # optional…

---

## [FireWatir](https://www.ruby-forum.com/t/firewatir/78774)

<div class="topic-metadata">

**Author:** [@splattael](https://www.ruby-forum.com/u/splattael)\
**Replies:** 0\
**Last updated:** [December 8, 2006, 2:28pm UTC](https://www.ruby-forum.com/t/firewatir/78774 "2006-12-08T14:28:37Z")

</div>

Hello, Did anyone install FireWatir on linux (or on anything else) already? I would appreciate any info on this, since what I found so far online is not very much, to say the least. Of course I can google and all, bu…

---

## [Curb 0.0.6 - Post and Cookies](https://www.ruby-forum.com/t/curb-0-0-6-post-and-cookies/78768)

<div class="topic-metadata">

**Author:** [@ross\_b](https://www.ruby-forum.com/u/ross_b)\
**Replies:** 0\
**Last updated:** [December 8, 2006, 12:48pm UTC](https://www.ruby-forum.com/t/curb-0-0-6-post-and-cookies/78768 "2006-12-08T12:48:28Z")

</div>

Curb 0.0.6 is now available from Rubyforge (http://curb.rubyforge.org/). Curb provides easy-to-use bindings to the libcurl URL transfer library. This release addresses two major shortcomings in Curb, implementing both …

---

## [Pam\_ruby and "require" statement](https://www.ruby-forum.com/t/pam-ruby-and-require-statement/78764)

<div class="topic-metadata">

**Author:** [@prhlava](https://www.ruby-forum.com/u/prhlava)\
**Replies:** 4\
**Last updated:** [December 8, 2006, 12:41pm UTC](https://www.ruby-forum.com/t/pam-ruby-and-require-statement/78764 "2006-12-08T12:41:22Z")

</div>

i am trying to write a pam module in ruby (using the latest pam-ruby and ruby-pam). the basic test module/script works but it fails when trying to use “require” statement (the same require statement succeeds from irb …

---

## [Ruby 3D Math libraries?](https://www.ruby-forum.com/t/ruby-3d-math-libraries/78618)

<div class="topic-metadata">

**Author:** [@bartb](https://www.ruby-forum.com/u/bartb)\
**Replies:** 8\
**Last updated:** [December 8, 2006, 10:46am UTC](https://www.ruby-forum.com/t/ruby-3d-math-libraries/78618 "2006-12-08T10:46:14Z")

</div>

Hello, Does anyone know good Ruby 3D Math libraries? I found Math3D (http://raa.ruby-lang.org/project/math3d/) but I can not get it working, ruby extconf.rb fails: $ ruby -r mkmf extconf.rb checking for atan() in -…

---

## [A beginner's question on exceptional handling,please help](https://www.ruby-forum.com/t/a-beginners-question-on-exceptional-handling-please-help/78746)

<div class="topic-metadata">

**Author:** [@sampurna](https://www.ruby-forum.com/u/sampurna)\
**Replies:** 1\
**Last updated:** [December 8, 2006, 10:12am UTC](https://www.ruby-forum.com/t/a-beginners-question-on-exceptional-handling-please-help/78746 "2006-12-08T10:12:08Z")

</div>

Hi All, In my code i am getting this exception. (Watir::Exception::UnknownObjectException) Can anybody help how to handle it When this exception raises i want to do 1 operation $IE0.image(:src, " http://172.16.5.8…

---

## [Math3D problems](https://www.ruby-forum.com/t/math3d-problems/78655)

<div class="topic-metadata">

**Author:** [@bartb](https://www.ruby-forum.com/u/bartb)\
**Replies:** 3\
**Last updated:** [December 8, 2006, 9:16am UTC](https://www.ruby-forum.com/t/math3d-problems/78655 "2006-12-08T09:16:06Z")

</div>

After my previous batch of test failures I am now up to this point: tests run but they fail. I had to fix a lot of problems with TestCase setup methods being called set\_up instead of setup, could that be an old namin…

---

## [ANN: A new Capistrano subversion SCM module](https://www.ruby-forum.com/t/ann-a-new-capistrano-subversion-scm-module/78747)

<div class="topic-metadata">

**Author:** [@wolfmanjm](https://www.ruby-forum.com/u/wolfmanjm)\
**Replies:** 0\
**Last updated:** [December 8, 2006, 8:38am UTC](https://www.ruby-forum.com/t/ann-a-new-capistrano-subversion-scm-module/78747 "2006-12-08T08:38:01Z")

</div>

I’d like to announce a new subversion SCM module for Capistrano. In addition to all the old functionality, it adds three new features. Handles the subversion repository only being accessible from the local machine, …

---

## [NoMethodError in protocol.rb](https://www.ruby-forum.com/t/nomethoderror-in-protocol-rb/78624)

<div class="topic-metadata">

**Author:** [@regularfry](https://www.ruby-forum.com/u/regularfry)\
**Replies:** 4\
**Last updated:** [December 8, 2006, 8:14am UTC](https://www.ruby-forum.com/t/nomethoderror-in-protocol-rb/78624 "2006-12-08T08:14:00Z")

</div>

Does this look familiar to anyone? NoMethodError: undefined method +' for nil:NilClass at /usr/local/lib/ruby/1.8/net/protocol.rb:176:inwrite0’ I’m getting it sporadically during some fairly heavy XMLRPC traffic. It …

---

## [Nighttime fun with ruby :wq](https://www.ruby-forum.com/t/nighttime-fun-with-ruby-wq/78743)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [December 8, 2006, 8:11am UTC](https://www.ruby-forum.com/t/nighttime-fun-with-ruby-wq/78743 "2006-12-08T08:11:59Z")

</div>

i can’t put much of what we work on online, but we just put this up for a conference so i thought i’d share NOAA/NGDC - Earth Observation Group - Defense Meteorological Satellite Progam, Boulder - NRT UT Night Mosaics …

---

## [Execute environment - rake aborted! - no such file to load -](https://www.ruby-forum.com/t/execute-environment-rake-aborted-no-such-file-to-load/78740)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [December 8, 2006, 6:55am UTC](https://www.ruby-forum.com/t/execute-environment-rake-aborted-no-such-file-to-load/78740 "2006-12-08T06:55:55Z")

</div>

Env: Ruby 1.8.5, Linux Any help would be greatly appreciated with this issue Thanks This post contains: rake --trace db:schema:load gem list --local environment.rb 1.////////////////////////////////////////////////…

---

## [Need help with a regexp](https://www.ruby-forum.com/t/need-help-with-a-regexp/78736)

<div class="topic-metadata">

**Author:** [@rpheath](https://www.ruby-forum.com/u/rpheath)\
**Replies:** 5\
**Last updated:** [December 8, 2006, 6:17am UTC](https://www.ruby-forum.com/t/need-help-with-a-regexp/78736 "2006-12-08T06:17:29Z")

</div>

I’m trying to write a regular expression to replace a … block or a … block with a blank (’’). I can only get the … to work correctly. Here’s what I have: text.gsub(/^ \[^\<\]\</pre\>$|^(. ?)\</p\>\</blockquote\>$/,’’) Can s…

---

## [Active Record error with Association](https://www.ruby-forum.com/t/active-record-error-with-association/102618)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [December 8, 2006, 4:45am UTC](https://www.ruby-forum.com/t/active-record-error-with-association/102618 "2006-12-08T04:45:46Z")

</div>

I am learning to use ActiveRecord so bear with me. I have a script that looks like this class Product \< ActiveRecord::Base set\_primary\_key “ProductID” set\_table\_name “Product” has\_many :variants, :foreign\_key =\> ‘Pr…

---

## [\[Puzzle\] How to do parameter variation?](https://www.ruby-forum.com/t/puzzle-how-to-do-parameter-variation/78612)

<div class="topic-metadata">

**Author:** [@gfburke](https://www.ruby-forum.com/u/gfburke)\
**Replies:** 3\
**Last updated:** [December 8, 2006, 4:28am UTC](https://www.ruby-forum.com/t/puzzle-how-to-do-parameter-variation/78612 "2006-12-08T04:28:37Z")

</div>

Suppose you want to do several runs of a program or function, varying the parameters each time. You start with a hash of parameter lists: params = { speed=\>\[1,2,3\], beta=\>\[0.1, 0.002, 0.4\], x=\>\['a', 'b'\] } Given this …

---

## [Ruby enums in C](https://www.ruby-forum.com/t/ruby-enums-in-c/78708)

<div class="topic-metadata">

**Author:** [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Replies:** 4\
**Last updated:** [December 8, 2006, 1:39am UTC](https://www.ruby-forum.com/t/ruby-enums-in-c/78708 "2006-12-08T01:39:33Z")

</div>

Each instance of Joe has a MOOD which can be HAPPY, SAD, or NEUTRAL. The Joe class is written in C. In C, what’s the appropriate way for setting MOOD to one of the appropriate values? Thanks, An instantiated Joe obj…

---

## [IEEE-488 (GP-IB) Interface Lib for Ruby](https://www.ruby-forum.com/t/ieee-488-gp-ib-interface-lib-for-ruby/78641)

<div class="topic-metadata">

**Author:** [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Replies:** 3\
**Last updated:** [December 8, 2006, 1:37am UTC](https://www.ruby-forum.com/t/ieee-488-gp-ib-interface-lib-for-ruby/78641 "2006-12-08T01:37:32Z")

</div>

Greetings, Is anyone aware of a Ruby library for controlling IEEE-488 interface cards? The specific application that I am having to work with is running MS-Windows XP and uses National Instruments IEEE-488 interface …

---

## [Help with rake](https://www.ruby-forum.com/t/help-with-rake/78707)

<div class="topic-metadata">

**Author:** [@nuby2ruby](https://www.ruby-forum.com/u/nuby2ruby)\
**Replies:** 3\
**Last updated:** [December 8, 2006, 12:25am UTC](https://www.ruby-forum.com/t/help-with-rake/78707 "2006-12-08T00:25:17Z")

</div>

Can anyone tell me exactly how rake works? How does it know what to do? Also, when I run rake db:anything, it changes my schema file to an autogenerated format, can anyone tell me where it gets the info for this? Tha…

---

## [\[ANN\] Ruby-VPI 12.0.0](https://www.ruby-forum.com/t/ann-ruby-vpi-12-0-0/78710)

<div class="topic-metadata">

**Author:** [@snk](https://www.ruby-forum.com/u/snk)\
**Replies:** 0\
**Last updated:** [December 8, 2006, 12:24am UTC](https://www.ruby-forum.com/t/ann-ruby-vpi-12-0-0/78710 "2006-12-08T00:24:01Z")

</div>

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-vpi.rubyforge.org Install: gem install ruby-vpi Version 12.0.0 (2006-12…

---

## [Re: Turtle Graphics (#104)](https://www.ruby-forum.com/t/re-turtle-graphics-104/78661)

<div class="topic-metadata">

**Author:** [@davidtl](https://www.ruby-forum.com/u/davidtl)\
**Replies:** 1\
**Last updated:** [December 7, 2006, 9:57pm UTC](https://www.ruby-forum.com/t/re-turtle-graphics-104/78661 "2006-12-07T21:57:00Z")

</div>

Most of those should be obvious implementations. The surprise, if any, comes from the fact that pen\_down() puts a point on the track. This makes sense though, if you think about it. If you touch a pen to a piece of…

---

## [Turtle Graphics (#104)](https://www.ruby-forum.com/t/turtle-graphics-104/78653)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 2\
**Last updated:** [December 7, 2006, 9:28pm UTC](https://www.ruby-forum.com/t/turtle-graphics-104/78653 "2006-12-07T21:28:55Z")

</div>

I’m going to move my standard thank you note right to the beginning of this summary, because it’s very important this time. Morton put in a lot of work prepping this problem so it would be Ruby Q. size and fun at th…

---

## [Openstruct oddity](https://www.ruby-forum.com/t/openstruct-oddity/78687)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [December 7, 2006, 9:20pm UTC](https://www.ruby-forum.com/t/openstruct-oddity/78687 "2006-12-07T21:20:52Z")

</div>

In reference to thread 117889 Wed, 27 Oct 2004, http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/117889 does anyone know what's happened to this? This is about openstruct picking up a defined method when…

---

## [Re: \[Quiz\] Turtle Graphics (#104)](https://www.ruby-forum.com/t/re-quiz-turtle-graphics-104/78680)

<div class="topic-metadata">

**Author:** [@davidtl](https://www.ruby-forum.com/u/davidtl)\
**Replies:** 1\
**Last updated:** [December 7, 2006, 8:56pm UTC](https://www.ruby-forum.com/t/re-quiz-turtle-graphics-104/78680 "2006-12-07T20:56:46Z")

</div>

Paul L. wrote: These two lines can be replaced with: degrees %= 360 And the resulting method will run much faster if the degrees argument is large. Got it. Thanks. ( the result of a % b will be \>= 0 if b \> 0 … )

---

## [Replace delimiter in unicode encdoded file](https://www.ruby-forum.com/t/replace-delimiter-in-unicode-encdoded-file/78247)

<div class="topic-metadata">

**Author:** [@ciapecki](https://www.ruby-forum.com/u/ciapecki)\
**Replies:** 19\
**Last updated:** [December 7, 2006, 8:50pm UTC](https://www.ruby-forum.com/t/replace-delimiter-in-unicode-encdoded-file/78247 "2006-12-07T20:50:43Z")

</div>

Is there a way in ruby to: open a file encoded in ucs-2le, replace every occurance of ‘\\t’ (X’0009’) with ‘,’ (X’002c’), and save it back in ucs-2le, without loosing any content? thanks chris

---

## [Is ruby a viable corporate alternative?](https://www.ruby-forum.com/t/is-ruby-a-viable-corporate-alternative/77525)

<div class="topic-metadata">

**Author:** [@Mr\_P](https://www.ruby-forum.com/u/Mr_P)\
**Replies:** 26\
**Last updated:** [December 7, 2006, 8:38pm UTC](https://www.ruby-forum.com/t/is-ruby-a-viable-corporate-alternative/77525 "2006-12-07T20:38:37Z")

</div>

Our team uses Perl for almost 100% of our projects, as we have for the past 10 year or so. At that point we broke from the C/C++ herd and never looked back. Our productivity has been the best in the corporation since,…

---

## [Get Number of regex matches](https://www.ruby-forum.com/t/get-number-of-regex-matches/78561)

<div class="topic-metadata">

**Author:** [@ingoweiss](https://www.ruby-forum.com/u/ingoweiss)\
**Replies:** 6\
**Last updated:** [December 7, 2006, 8:10pm UTC](https://www.ruby-forum.com/t/get-number-of-regex-matches/78561 "2006-12-07T20:10:28Z")

</div>

Hi, how can I get the NUMBER of matches for a regular expression in a given string? For example: for string ‘Banana’ and regex /a/ I should get ‘3’ (matches) Thanks! Ingo

---

## [YAML problem with cyclic data structures](https://www.ruby-forum.com/t/yaml-problem-with-cyclic-data-structures/78569)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [December 7, 2006, 7:56pm UTC](https://www.ruby-forum.com/t/yaml-problem-with-cyclic-data-structures/78569 "2006-12-07T19:56:25Z")

</div>

I’m having a problem with YAML in the first slightly-more-than-toy application that I’ve writing with it. Oddly, when I searched on “ruby yaml cyclic” - the first phrase I thought of to get help - I found that someone…

---

## [\[Quiz\] Turtle Graphics (#104)](https://www.ruby-forum.com/t/quiz-turtle-graphics-104/78649)

<div class="topic-metadata">

**Author:** [@davidtl](https://www.ruby-forum.com/u/davidtl)\
**Replies:** 1\
**Last updated:** [December 7, 2006, 7:50pm UTC](https://www.ruby-forum.com/t/quiz-turtle-graphics-104/78649 "2006-12-07T19:50:24Z")

</div>

My second solution. This solution pass the unit test. It tests all parameters also makes sure 0.0 \<= @heading \< 360.0 Created by Morton G. on November 02, 2006. Modified on November 14, 2006 turtle.rb An implementatio…

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

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