# Ruby

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

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

---

## [Failed Metaprogramming PLUS Stack Level Too Deep](https://www.ruby-forum.com/t/failed-metaprogramming-plus-stack-level-too-deep/114783)

<div class="topic-metadata">

**Author:** [@Ari\_B](https://www.ruby-forum.com/u/Ari_B)\
**Replies:** 3\
**Last updated:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/failed-metaprogramming-plus-stack-level-too-deep/114783 "2007-09-25T23:10:36Z")

</div>

Hey all I’m trying to dynamically define a method which will do the following. Example: def INPUT(&b) @chain = “INPUT” @file \<\< " # BEGIN rules for chain INPUT\\n" instance\_eval(&b) @file \<\< " # END rules for…

---

## [Code explanation requeted](https://www.ruby-forum.com/t/code-explanation-requeted/84558)

<div class="topic-metadata">

**Author:** [@nevf](https://www.ruby-forum.com/u/nevf)\
**Replies:** 4\
**Last updated:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/code-explanation-requeted/84558 "2007-09-25T23:10:36Z")

</div>

Hi, Can someone please shed some light on the following code: def test\_listen s = nil log = Object.new class \<\< log; self end.send(:define\_method, :to\_int) { s.close 2 } inet\_stream do |s| assert\_raise(IOError…

---

## [CruiseControl.rb 1.0](https://www.ruby-forum.com/t/cruisecontrol-rb-1-0/88623)

<div class="topic-metadata">

**Author:** [@alexeyv](https://www.ruby-forum.com/u/alexeyv)\
**Replies:** 18\
**Last updated:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/cruisecontrol-rb-1-0/88623 "2007-09-25T23:10:33Z")

</div>

Hmmm. Another Continuous Integration tool? What is that, the millionth one? Yup, pretty much, but we’re taking a different approach than the others in a way, back to the basics. Here’s our motto: Easy to instal…

---

## [Problem wrapping the C++ STL](https://www.ruby-forum.com/t/problem-wrapping-the-c-stl/107145)

<div class="topic-metadata">

**Author:** [@danielb](https://www.ruby-forum.com/u/danielb)\
**Replies:** 10\
**Last updated:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/problem-wrapping-the-c-stl/107145 "2007-09-25T23:10:33Z")

</div>

Hi all, Is it possible to wrap the C++ STL stuff? Say, for example, vector? #include “ruby.h” #include using namespace std; struct cvector{ vector array(0); }; void Init\_cvector(){ VALUE cVector = rb\_define\_cla…

---

## [\#send in 1.9](https://www.ruby-forum.com/t/send-in-1-9/111102)

<div class="topic-metadata">

**Author:** [@Trans](https://www.ruby-forum.com/u/Trans)\
**Replies:** 61\
**Last updated:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/send-in-1-9/111102 "2007-09-25T23:10:31Z")

</div>

Looking over 1.9’s change of #send, ie. send doesn’t always call private methods anymore (#\_\_send, #\_\_send!, #funcall) ruby-talk:153672 It is still possible to call them with the newly introduced #\_\_send! and funcall…

---

## [The Pebble in the Ruby Shoe](https://www.ruby-forum.com/t/the-pebble-in-the-ruby-shoe/109533)

<div class="topic-metadata">

**Author:** [@rgillett](https://www.ruby-forum.com/u/rgillett)\
**Replies:** 108\
**Last updated:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/the-pebble-in-the-ruby-shoe/109533 "2007-09-25T23:10:30Z")

</div>

Ruby aims to be a human friendly programming language that embodies the principle of least surprise. However, there is an important feature of the language that, despite being a glaring exception to this laudable goa…

---

## [IP to Country (#139)](https://www.ruby-forum.com/t/ip-to-country-139/114624)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 38\
**Last updated:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/ip-to-country-139/114624 "2007-09-25T23:10:30Z")

</div>

The three rules of Ruby Q.: Please do not post any solutions or spoiler discussion for this quiz until 48 hours have passed from the time on this message. Support Ruby Q. by submitting ideas as often as you can: …

---

## [Any word yet?](https://www.ruby-forum.com/t/any-word-yet/83895)

<div class="topic-metadata">

**Author:** [@joep](https://www.ruby-forum.com/u/joep)\
**Replies:** 2\
**Last updated:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/any-word-yet/83895 "2007-09-25T23:10:29Z")

</div>

Can anybody show me how to grab a parameter in ruby? I have: \<% require “dbi” require ‘cgi’ cgi = CGI.new year = cgi.params\[‘year’\] make = cgi.params\[‘make’\] category = cgi.params\[‘category’\] %\> for pas…

---

## [Newbie help](https://www.ruby-forum.com/t/newbie-help/114574)

<div class="topic-metadata">

**Author:** [@akoubeissi](https://www.ruby-forum.com/u/akoubeissi)\
**Replies:** 17\
**Last updated:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/newbie-help/114574 "2007-09-25T23:10:26Z")

</div>

Hey, I’ve started with Ruby two days ago, and I have some questions. 1- What’s the use of Symbols? I’ve read that symbols are (Symbols are lightweight strings. Usually, symbols are used in situations where you need a …

---

## [How many computers in the house?](https://www.ruby-forum.com/t/how-many-computers-in-the-house/114544)

<div class="topic-metadata">

**Author:** [@toadkicker](https://www.ruby-forum.com/u/toadkicker)\
**Replies:** 41\
**Last updated:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/how-many-computers-in-the-house/114544 "2007-09-25T23:10:26Z")

</div>

I went to the Lone Star Ruby Conference last week. 7 of us went out to dinner one night, and we counted up how many computers each of us had at home, that were operational and could be use if needed. We counted 53 be…

---

## [Split a string based on change of character](https://www.ruby-forum.com/t/split-a-string-based-on-change-of-character/111807)

<div class="topic-metadata">

**Author:** [@starmaerker](https://www.ruby-forum.com/u/starmaerker)\
**Replies:** 26\
**Last updated:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/split-a-string-based-on-change-of-character/111807 "2007-09-25T23:10:22Z")

</div>

For a string “ZBBBCZZ”, I want to produce a list \[“Z”, “BBB”, “C”, “ZZ”\] That is, break the string into pieces based on change of character. Though this works: s = “ZBBBCZZ” x = s.scan(/((.)\\2\*)/).map {|i| i\[0\]} I’m…

---

## [About assert\_difference problem. help!](https://www.ruby-forum.com/t/about-assert-difference-problem-help/113629)

<div class="topic-metadata">

**Author:** [@zlai](https://www.ruby-forum.com/u/zlai)\
**Replies:** 7\
**Last updated:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/about-assert-difference-problem-help/113629 "2007-09-25T23:10:22Z")

</div>

class PersonTest \< Test::Unit::TestCase fixtures :people def setup end def test\_should\_create\_person assert\_difference people, :count do person=Person.newly\_created assert !person.new\_record?, “#{person.errors.fu…

---

## [Problem with Array#delete](https://www.ruby-forum.com/t/problem-with-array-delete/112391)

<div class="topic-metadata">

**Author:** [@Matthew\_B\_Gardner](https://www.ruby-forum.com/u/Matthew_B_Gardner)\
**Replies:** 15\
**Last updated:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/problem-with-array-delete/112391 "2007-09-25T23:10:21Z")

</div>

Hello, I’m baffled by the following problem: I have an Account class and an external array that keeps them in a list. I’m trying to delete the account objects one at a time as needed, by: class Account def quit arr…

---

## [String replacement](https://www.ruby-forum.com/t/string-replacement/93083)

<div class="topic-metadata">

**Author:** [@Josselin](https://www.ruby-forum.com/u/Josselin)\
**Replies:** 14\
**Last updated:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/string-replacement/93083 "2007-09-25T23:10:21Z")

</div>

I have a string : str = “/proposal/list/31551” I would like to change the 31551 by another value “9999”, but I don’t see whicj method I should use ? str.each and block ? or str.rindex(’/’) and concatenating the new …

---

## [Where have Ruby/Tk examples gone?](https://www.ruby-forum.com/t/where-have-ruby-tk-examples-gone/90738)

<div class="topic-metadata">

**Author:** [@Morton\_G](https://www.ruby-forum.com/u/Morton_G)\
**Replies:** 9\
**Last updated:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/where-have-ruby-tk-examples-gone/90738 "2007-09-25T23:10:21Z")

</div>

I have previously been able to access Hidetoshi NAGAI’s examples of Ruby/Tk code with the following URL: http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/ruby/ext/tk/sample/ Now I’m getting a 404 Not Found error when I poi…

---

## [NoMethodError: undefined method \`scanf' for main:Object](https://www.ruby-forum.com/t/nomethoderror-undefined-method-scanf-for-main-object/114616)

<div class="topic-metadata">

**Author:** [@asoto](https://www.ruby-forum.com/u/asoto)\
**Replies:** 4\
**Last updated:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/nomethoderror-undefined-method-scanf-for-main-object/114616 "2007-09-25T23:10:21Z")

</div>

Hi, I’m trying to use scanf(), but no luck: $ ruby --version ruby 1.8.6 (2007-06-07 patchlevel 36) \[i486-linux\] $ uname -a Linux zrbite 2.6.21-2-686 #1 SMP Wed Jul 11 03:53:02 UTC 2007 i686 GNU/ Linux $ irb irb(m…

---

## [Ruby tutorial](https://www.ruby-forum.com/t/ruby-tutorial/109630)

<div class="topic-metadata">

**Author:** [@harper](https://www.ruby-forum.com/u/harper)\
**Replies:** 12\
**Last updated:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/ruby-tutorial/109630 "2007-09-25T23:10:20Z")

</div>

Hi, i’ve been working with ruby a long time now, and i love the language; but i feel like i don’t really know EVERY little thing there is to know about it… i read “Programming Ruby - The Pragramtic Programmers Guide”…

---

## [Rubyhitsquad's vlad 1.0.0 Released](https://www.ruby-forum.com/t/rubyhitsquads-vlad-1-0-0-released/111985)

<div class="topic-metadata">

**Author:** [@aguynamedryan](https://www.ruby-forum.com/u/aguynamedryan)\
**Replies:** 6\
**Last updated:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/rubyhitsquads-vlad-1-0-0-released/111985 "2007-09-25T23:10:20Z")

</div>

vlad version 1.0.0 has been released! http://rubyhitsquad.com/ http://rubyforge.org/projects/hitsquad/ Vlad the Deployer is pragmatic application deployment automation, without mercy. Much like Capistrano, but with 1…

---

## [Web Ruby w/o Rails](https://www.ruby-forum.com/t/web-ruby-w-o-rails/107608)

<div class="topic-metadata">

**Author:** [@SSSSSSSSS\_SSSSSSSS\_S](https://www.ruby-forum.com/u/SSSSSSSSS_SSSSSSSS_S)\
**Replies:** 7\
**Last updated:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/web-ruby-w-o-rails/107608 "2007-09-25T23:10:16Z")

</div>

Hi, I want to start developing a web application in Ruby, but can’t configure it to work. There are so much options that I get confused :slight\_smile: eruby, mod\_ruby (which I think, but unsure, is depreciated), cgi, …

---

## [Validating an Image file is an image file](https://www.ruby-forum.com/t/validating-an-image-file-is-an-image-file/109753)

<div class="topic-metadata">

**Author:** [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Replies:** 18\
**Last updated:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/validating-an-image-file-is-an-image-file/109753 "2007-09-25T23:10:15Z")

</div>

I know how to validate a file based only on the file name dot extension, but this seems wholly insecure to me. I feel that just testing for .jpg, .png, .jpeg, .gif, etc… is not enough. Clearly renaming a file to anyt…

---

## [Metadata 0.3](https://www.ruby-forum.com/t/metadata-0-3/114748)

<div class="topic-metadata">

**Author:** [@Ilmari\_H](https://www.ruby-forum.com/u/Ilmari_H)\
**Replies:** 6\
**Last updated:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/metadata-0-3/114748 "2007-09-25T23:10:15Z")

</div>

On 9/15/07, Konrad M. removed\_email\_address@domain.invalid wrote: Any ideas? Yeah, I failed at using git. Jeez. Sorry about that. Here’s 0.3, it oughta work: tarball: http://dark.fhtr.org/repos/metadata/metadata-0.…

---

## [Will we have rand(m, n)?](https://www.ruby-forum.com/t/will-we-have-rand-m-n/114664)

<div class="topic-metadata">

**Author:** [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Replies:** 3\
**Last updated:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/will-we-have-rand-m-n/114664 "2007-09-25T23:10:15Z")

</div>

given the ease of using Ruby, I wonder whether we will have rand(m, n) in the future… right now, we need to use rand(range) + start and it can cause a bug that can otherwise be avoided if we have rand(m, n) for the…

---

## [Help me condence my code?](https://www.ruby-forum.com/t/help-me-condence-my-code/114009)

<div class="topic-metadata">

**Author:** [@simonsaid](https://www.ruby-forum.com/u/simonsaid)\
**Replies:** 22\
**Last updated:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/help-me-condence-my-code/114009 "2007-09-25T23:10:12Z")

</div>

I know this could be more idiomatic to ruby. it’s basically to turn Fifteen Thousand Useful Phrases by Grenville Kleiser - Free Ebook into an array. the “\_no\_extras” refers to me having snipped the intro and outro of …

---

## [Newbe - strange behavior of print](https://www.ruby-forum.com/t/newbe-strange-behavior-of-print/91661)

<div class="topic-metadata">

**Author:** [@caof2005](https://www.ruby-forum.com/u/caof2005)\
**Replies:** 5\
**Last updated:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/newbe-strange-behavior-of-print/91661 "2007-09-25T23:10:10Z")

</div>

Hello folks, this is the scenario: I tried to run the following code in EasyEclipse for Ruby IDE and SciTE on WinXP Both has the same behavior. def main print "Enter the number of employees: " numEmp = gets puts …

---

## [Need advice for a script to scrap my Verizon account](https://www.ruby-forum.com/t/need-advice-for-a-script-to-scrap-my-verizon-account/103387)

<div class="topic-metadata">

**Author:** [@steve](https://www.ruby-forum.com/u/steve)\
**Replies:** 9\
**Last updated:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/need-advice-for-a-script-to-scrap-my-verizon-account/103387 "2007-09-25T23:10:10Z")

</div>

I am new to Ruby. I would like to write a script that will login to my Verizon account and grab my minute details and calculate my remaining unused minutes for the month. This would involve opening an HTTPS connecti…

---

## [Object.id problem](https://www.ruby-forum.com/t/object-id-problem/83786)

<div class="topic-metadata">

**Author:** [@alexamat](https://www.ruby-forum.com/u/alexamat)\
**Replies:** 9\
**Last updated:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/object-id-problem/83786 "2007-09-25T23:10:10Z")

</div>

Hi yet another Soap problem I have a web service with a method called {}id however when i call this method project.id it returns the Object id instead of calling the method id. Any ideas on how to call the method id

---

## [Ruby script to EXE](https://www.ruby-forum.com/t/ruby-script-to-exe/85623)

<div class="topic-metadata">

**Author:** [@vinod](https://www.ruby-forum.com/u/vinod)\
**Replies:** 6\
**Last updated:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/ruby-script-to-exe/85623 "2007-09-25T23:10:09Z")

</div>

Hi , Is there any other utility to create EXE out of Ruby scripts other than RubyScript2EXE.rb? I think RubyScript2EXE.rb is too buggy. in couple of weeks 3-4 times the generated EXE is producing different result tha…

---

## [Maximum Sub-Array (#131)](https://www.ruby-forum.com/t/maximum-sub-array-131/109345)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 48\
**Last updated:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/maximum-sub-array-131/109345 "2007-09-25T23:10:06Z")

</div>

The three rules of Ruby Q.: Please do not post any solutions or spoiler discussion for this quiz until 48 hours have passed from the time on this message. Support Ruby Q. by submitting ideas as often as you can: …

---

## [DRbFire testing fails](https://www.ruby-forum.com/t/drbfire-testing-fails/113042)

<div class="topic-metadata">

**Author:** [@perevillega](https://www.ruby-forum.com/u/perevillega)\
**Replies:** 2\
**Last updated:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/drbfire-testing-fails/113042 "2007-09-25T23:10:01Z")

</div>

I’ve download DRbfire to be able to run DRb through NAT, but when I run test\_drbfire.rb to validate the installation, it shows me this errors: Loaded suite G:/Projectes/KademliaRuby/lib/drbtesting/test\_drbfire Started …

---

## [How to get the key, value pairs of RHASH?](https://www.ruby-forum.com/t/how-to-get-the-key-value-pairs-of-rhash/112311)

<div class="topic-metadata">

**Author:** [@unbewust](https://www.ruby-forum.com/u/unbewust)\
**Replies:** 5\
**Last updated:** [September 25, 2007, 11:09pm UTC](https://www.ruby-forum.com/t/how-to-get-the-key-value-pairs-of-rhash/112311 "2007-09-25T23:09:59Z")

</div>

i’d like to have, in my module options (is in FileUtils for ex) like that in the Ruby side: symt = SYMBOL\_TEST.new( “/my/src/path”, :verbose =\> true, :noop =\> true ) i know, from experiment, that, in my C init i get …

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

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