# Ruby

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

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

---

## [What is wrong with this program?](https://www.ruby-forum.com/t/what-is-wrong-with-this-program/173343)

<div class="topic-metadata">

**Author:** [@prateekagarwal](https://www.ruby-forum.com/u/prateekagarwal)\
**Replies:** 6\
**Last updated:** [August 7, 2009, 9:42am UTC](https://www.ruby-forum.com/t/what-is-wrong-with-this-program/173343 "2009-08-07T09:42:04Z")

</div>

I don’t understand what is wrong with this program. It gives an error: ‘findarea’ undefined local variable or method ‘area\_of\_triangle’ Both ‘findarea’ and ‘area\_of\_triangle’ are clearly defined.

---

## [Re: remove commas from string](https://www.ruby-forum.com/t/re-remove-commas-from-string/173355)

<div class="topic-metadata">

**Author:** [@Yangtt](https://www.ruby-forum.com/u/Yangtt)\
**Replies:** 0\
**Last updated:** [August 7, 2009, 8:49am UTC](https://www.ruby-forum.com/t/re-remove-commas-from-string/173355 "2009-08-07T08:49:57Z")

</div>

Return Receipt Your Re: remove commas from string document: was removed\_email\_address@domain.invalid received by: at: 08/07/2009 02:30:24 PM

---

## [(named|keyword) arguments gem](https://www.ruby-forum.com/t/named-keyword-arguments-gem/173346)

<div class="topic-metadata">

**Author:** [@macario](https://www.ruby-forum.com/u/macario)\
**Replies:** 0\
**Last updated:** [August 7, 2009, 6:38am UTC](https://www.ruby-forum.com/t/named-keyword-arguments-gem/173346 "2009-08-07T06:38:19Z")

</div>

Hi I’ve made a gem for supporting keyword arguments in Ruby 1.8.6 and 1.9.1. I think is a good alternative to traditional options hash, usage is as follows: require ‘arguments’ class Example def meth(a = :a, b = :b,…

---

## [Inserting into sqlite3](https://www.ruby-forum.com/t/inserting-into-sqlite3/172933)

<div class="topic-metadata">

**Author:** [@bloodniece](https://www.ruby-forum.com/u/bloodniece)\
**Replies:** 3\
**Last updated:** [August 7, 2009, 5:04am UTC](https://www.ruby-forum.com/t/inserting-into-sqlite3/172933 "2009-08-07T05:04:05Z")

</div>

I have a text file, called maillog that I want to insert into a table. My pseudo-code is open mail file connect to database =\> ‘require dbi’ here? create table for maillog data create primary key in table for each …

---

## [Testing with Mechanize](https://www.ruby-forum.com/t/testing-with-mechanize/173265)

<div class="topic-metadata">

**Author:** [@michaelb](https://www.ruby-forum.com/u/michaelb)\
**Replies:** 3\
**Last updated:** [August 7, 2009, 4:49am UTC](https://www.ruby-forum.com/t/testing-with-mechanize/173265 "2009-08-07T04:49:12Z")

</div>

Hello, I’m trying to jump onto the habit of testing and I’m not finding to too easy because most of the code I write has to do with third party web services. My current dilemma is how to stub or mock a Mechanize objec…

---

## [Markup\_validity 1.1.0 Released](https://www.ruby-forum.com/t/markup-validity-1-1-0-released/173342)

<div class="topic-metadata">

**Author:** [@aaronpowell](https://www.ruby-forum.com/u/aaronpowell)\
**Replies:** 0\
**Last updated:** [August 7, 2009, 4:47am UTC](https://www.ruby-forum.com/t/markup-validity-1-1-0-released/173342 "2009-08-07T04:47:41Z")

</div>

markup\_validity version 1.1.0 has been released! http://github.com/tenderlove/markup\_validity MarkupValidity provides test/unit and rspec helpers for checking the validity of your documents. Shortcuts for verifying…

---

## [Push only unique messages with Stomp (ActiveMQ)](https://www.ruby-forum.com/t/push-only-unique-messages-with-stomp-activemq/173340)

<div class="topic-metadata">

**Author:** [@white](https://www.ruby-forum.com/u/white)\
**Replies:** 0\
**Last updated:** [August 7, 2009, 4:45am UTC](https://www.ruby-forum.com/t/push-only-unique-messages-with-stomp-activemq/173340 "2009-08-07T04:45:38Z")

</div>

Hi ppl, Are there any good way how can I push only unique messages into queue with Stomp? The queue is ActiveMQ. The sample case is that I need to push the IDs of items to be processed, and I want them to appear onl…

---

## [Unicorn 0.8.4](https://www.ruby-forum.com/t/unicorn-0-8-4/173334)

<div class="topic-metadata">

**Author:** [@ericw](https://www.ruby-forum.com/u/ericw)\
**Replies:** 0\
**Last updated:** [August 7, 2009, 1:08am UTC](https://www.ruby-forum.com/t/unicorn-0-8-4/173334 "2009-08-07T01:08:50Z")

</div>

Unicorn is a Rack HTTP server for Unix, fast clients and nothing else This release allows graceful degradation in case a user is using a status code not defined by Rack::Utils::HTTP\_STATUS\_CODES. A patch has been sub…

---

## [Ri\_cal 0.7.7 Released](https://www.ruby-forum.com/t/ri-cal-0-7-7-released/173332)

<div class="topic-metadata">

**Author:** [@rykkers](https://www.ruby-forum.com/u/rykkers)\
**Replies:** 0\
**Last updated:** [August 6, 2009, 11:56pm UTC](https://www.ruby-forum.com/t/ri-cal-0-7-7-released/173332 "2009-08-06T23:56:51Z")

</div>

ri\_cal version 0.7.7 has been released! NOTE: This is identical to 0.7.6 other than the version number. For some reason github failed to publish a gem for that version. http://ri-cal.rubyforge.org/ A new Ruby imp…

---

## [Change console forground to Red or Green](https://www.ruby-forum.com/t/change-console-forground-to-red-or-green/173258)

<div class="topic-metadata">

**Author:** [@b1gtuna](https://www.ruby-forum.com/u/b1gtuna)\
**Replies:** 7\
**Last updated:** [August 6, 2009, 11:53pm UTC](https://www.ruby-forum.com/t/change-console-forground-to-red-or-green/173258 "2009-08-06T23:53:56Z")

</div>

Hi All, I’m looking for a way to change a Window’s console foreground color in Ruby. I have a script that outputs passes and fails and I would like to know how to change the text to green or red specfically. I don’t…

---

## [Including gems with standalone app](https://www.ruby-forum.com/t/including-gems-with-standalone-app/173270)

<div class="topic-metadata">

**Author:** [@epasquier](https://www.ruby-forum.com/u/epasquier)\
**Replies:** 9\
**Last updated:** [August 6, 2009, 11:08pm UTC](https://www.ruby-forum.com/t/including-gems-with-standalone-app/173270 "2009-08-06T23:08:16Z")

</div>

Morning, I have a situation where I do not have the ability to add gems into production. I can provide a ruby script to be ran by the Operations Team, but I can’t ask that they install a gem I use. Also, stuck at R…

---

## [Session in Eruby](https://www.ruby-forum.com/t/session-in-eruby/173324)

<div class="topic-metadata">

**Author:** [@steux](https://www.ruby-forum.com/u/steux)\
**Replies:** 0\
**Last updated:** [August 6, 2009, 9:35pm UTC](https://www.ruby-forum.com/t/session-in-eruby/173324 "2009-08-06T21:35:20Z")

</div>

I’m trying to make a simple use of CGI::Session. For example, if page1.rhtml is like this: 1 \<% 2 require ‘cgi’ 3 require ‘cgi/session’ 4 require ‘cgi/session/pstore’ # provides CGI::Session::PStore 5 6 …

---

## [ShinyCocos 0.1.0 - coding iphone games in ruby](https://www.ruby-forum.com/t/shinycocos-0-1-0-coding-iphone-games-in-ruby/173319)

<div class="topic-metadata">

**Author:** [@Rolando\_A](https://www.ruby-forum.com/u/Rolando_A)\
**Replies:** 0\
**Last updated:** [August 6, 2009, 9:04pm UTC](https://www.ruby-forum.com/t/shinycocos-0-1-0-coding-iphone-games-in-ruby/173319 "2009-08-06T21:04:46Z")

</div>

Hi all, I’m really happy to announce the first public release of ShinyCocos: 0.1.0 (Birthday Pinata) What the heck is ShinyCocos? In a few words: ruby bindings for cocos2d-iphone (it also includes the Chipmunk ruby b…

---

## [Kernel's module methods?](https://www.ruby-forum.com/t/kernels-module-methods/173301)

<div class="topic-metadata">

**Author:** [@7stud](https://www.ruby-forum.com/u/7stud)\
**Replies:** 10\
**Last updated:** [August 6, 2009, 8:54pm UTC](https://www.ruby-forum.com/t/kernels-module-methods/173301 "2009-08-06T20:54:48Z")

</div>

According to pickaxe2, p516: Module Kernel The Kernel module is included by class Object, so its \[instance\] methods are available in every Ruby object. The Kernel instance methods are documented in class Object begin…

---

## [Soap4r and java data types](https://www.ruby-forum.com/t/soap4r-and-java-data-types/173320)

<div class="topic-metadata">

**Author:** [@dhill](https://www.ruby-forum.com/u/dhill)\
**Replies:** 0\
**Last updated:** [August 6, 2009, 8:29pm UTC](https://www.ruby-forum.com/t/soap4r-and-java-data-types/173320 "2009-08-06T20:29:26Z")

</div>

Is there any way using soap4r and wsdl2rb to use java Map. I ran wsdl2rb and it generates fine but when I try and use the service I get the following error. #SOAP::Mapping::Object:0x7fe6dec4: could not find a type wit…

---

## [How to read parse data from two file to generate one one file](https://www.ruby-forum.com/t/how-to-read-parse-data-from-two-file-to-generate-one-one-file/173313)

<div class="topic-metadata">

**Author:** [@Asif\_Iqbal](https://www.ruby-forum.com/u/Asif_Iqbal)\
**Replies:** 0\
**Last updated:** [August 6, 2009, 6:48pm UTC](https://www.ruby-forum.com/t/how-to-read-parse-data-from-two-file-to-generate-one-one-file/173313 "2009-08-06T18:48:22Z")

</div>

\#!/usr/bin/ruby ARGF.each do |line| sunetid, tmp, uid, gid, name, homedir, shell = line.split(/:/) puts " user { “” + sunetid + “”:" puts " ensure =\> “present”," puts " uid =\> “” + uid + “”," …

---

## [Any tool for examine ruby's thread?](https://www.ruby-forum.com/t/any-tool-for-examine-rubys-thread/173224)

<div class="topic-metadata">

**Author:** [@femto\_Zheng](https://www.ruby-forum.com/u/femto_Zheng)\
**Replies:** 8\
**Last updated:** [August 6, 2009, 6:23pm UTC](https://www.ruby-forum.com/t/any-tool-for-examine-rubys-thread/173224 "2009-08-06T18:23:12Z")

</div>

Hello all,I’m doing a multithreaded ruby application, I want to examine the thread because the application’s logic is quite complex, so it helps if I can see each thread clearly, but the problem is, if I use IDE with…

---

## [Trimming some string using ruby](https://www.ruby-forum.com/t/trimming-some-string-using-ruby/173283)

<div class="topic-metadata">

**Author:** [@shekarls](https://www.ruby-forum.com/u/shekarls)\
**Replies:** 9\
**Last updated:** [August 6, 2009, 6:20pm UTC](https://www.ruby-forum.com/t/trimming-some-string-using-ruby/173283 "2009-08-06T18:20:51Z")

</div>

Hi guys, I have the following information in a text file, which looks like this: -rw-rw-r-- 1 user user 12203 Aug 6 01:02 app1.sql -rw-rw-r-- 1 user user 12343 Aug 6 01:02 app2.sql -rw-rw-r-- 1 user user 12238 Aug…

---

## [Logging install](https://www.ruby-forum.com/t/logging-install/173308)

<div class="topic-metadata">

**Author:** [@biospank](https://www.ruby-forum.com/u/biospank)\
**Replies:** 1\
**Last updated:** [August 6, 2009, 6:09pm UTC](https://www.ruby-forum.com/t/logging-install/173308 "2009-08-06T18:09:08Z")

</div>

Hi all, is it possible to install logging (the Tim P. logging library) into ruby lib path bypassing rubygems? thank you all. bio.

---

## [Remove commas from string](https://www.ruby-forum.com/t/remove-commas-from-string/173222)

<div class="topic-metadata">

**Author:** [@leveille](https://www.ruby-forum.com/u/leveille)\
**Replies:** 13\
**Last updated:** [August 6, 2009, 5:51pm UTC](https://www.ruby-forum.com/t/remove-commas-from-string/173222 "2009-08-06T17:51:41Z")

</div>

I have following string: s = “B747-400, 8,357 miles, 561 mph, 4 Pratt & Whitney PW 4056 turbofans, 56,000 lbs.” I want to remove the comma only from the numbers (8,357 miles and 56,000 lbs) separating the thousands. …

---

## [Basic XML to nested Array](https://www.ruby-forum.com/t/basic-xml-to-nested-array/173306)

<div class="topic-metadata">

**Author:** [@mode](https://www.ruby-forum.com/u/mode)\
**Replies:** 2\
**Last updated:** [August 6, 2009, 5:43pm UTC](https://www.ruby-forum.com/t/basic-xml-to-nested-array/173306 "2009-08-06T17:43:17Z")

</div>

Hey, I’ve been having some trouble getting to grips with the various XML libraries, I just want to put together a ruby script that will convert a basic XML file into a nested array then just output that array to the …

---

## [Insertion and removal time for ruby datastructures](https://www.ruby-forum.com/t/insertion-and-removal-time-for-ruby-datastructures/173312)

<div class="topic-metadata">

**Author:** [@nicken](https://www.ruby-forum.com/u/nicken)\
**Replies:** 0\
**Last updated:** [August 6, 2009, 4:55pm UTC](https://www.ruby-forum.com/t/insertion-and-removal-time-for-ruby-datastructures/173312 "2009-08-06T16:55:40Z")

</div>

Has anyone ever analyzed the built-in ruby datastructures (array, hash, set, etc.) for their insertion, removal, and look-up times? I regularly use ruby to handle very large datasets, so this sort of information would…

---

## [Inexistent instance variable value](https://www.ruby-forum.com/t/inexistent-instance-variable-value/173154)

<div class="topic-metadata">

**Author:** [@Ricardo\_Amorim](https://www.ruby-forum.com/u/Ricardo_Amorim)\
**Replies:** 1\
**Last updated:** [August 6, 2009, 4:08pm UTC](https://www.ruby-forum.com/t/inexistent-instance-variable-value/173154 "2009-08-06T16:08:33Z")

</div>

Howdy, I have noticed this a while ago and someone asked in IRC, and I have no clue on WHY this happens: irb(main):001:0\> local\_var NameError: undefined local variable or method \`local\_var’ for main:Object from (ir…

---

## [\[bug:trunk\] Re: \[ruby-cvs:31633\] Ruby:r24415 (trunk): \* ext/digest/sha2/sha2.\[ch\]: Update to 1.0 REL](https://www.ruby-forum.com/t/bug-trunk-re-ruby-cvs-31633-ruby-r24415-trunk-ext-digest-sha2-sha2-ch-update-to-1-0-rel/173281)

<div class="topic-metadata">

**Author:** [@U.Nakamura](https://www.ruby-forum.com/u/U.Nakamura)\
**Replies:** 5\
**Last updated:** [August 6, 2009, 3:00pm UTC](https://www.ruby-forum.com/t/bug-trunk-re-ruby-cvs-31633-ruby-r24415-trunk-ext-digest-sha2-sha2-ch-update-to-1-0-rel/173281 "2009-08-06T15:00:04Z")

</div>

e$B$3$s$K$A$O!"$J$+$\`$ie(B(e$B$&e(B)e$B$G$9!#e(B e$B2\<5-$Ne(Bcommite$B$N7k2L!"e(BVCe$B$G$O%S%k%I$,$G$-$^$;$s!#e(B (1) BYTE\_ORDERe$B%^%/%mEy$NDj5A$,I,MW$J$i!“e(Bextconf.rbe$B$GM-L5$r3Ne(B e$BG’$7$F!”$J$1$l$PDj5A$9$k$+%…

---

## [How to logout when using Rake::Auth::Basic in Sinatra](https://www.ruby-forum.com/t/how-to-logout-when-using-rake-basic-in-sinatra/173276)

<div class="topic-metadata">

**Author:** [@bagadoughnuts](https://www.ruby-forum.com/u/bagadoughnuts)\
**Replies:** 2\
**Last updated:** [August 6, 2009, 2:57pm UTC](https://www.ruby-forum.com/t/how-to-logout-when-using-rake-basic-in-sinatra/173276 "2009-08-06T14:57:44Z")

</div>

Hi all, Sorry for the repost - I think I have the correct forum now! I’m writting a small app that requires basic authentication in Sinatra. I followed the advice of the official Sinatra faq (Sinatra: Frequently Aske…

---

## [Terminal escape sequences](https://www.ruby-forum.com/t/terminal-escape-sequences/173292)

<div class="topic-metadata">

**Author:** [@james-calivar](https://www.ruby-forum.com/u/james-calivar)\
**Replies:** 6\
**Last updated:** [August 6, 2009, 1:25pm UTC](https://www.ruby-forum.com/t/terminal-escape-sequences/173292 "2009-08-06T13:25:50Z")

</div>

Hi all, Looking through the PDoc source to see how it renders the build progress meter, I see: log “\\c\[\[F\\c\[\[K Rendering: #{dest}” Is there a good reference for these escape sequences anywhere? They’re not terri…

---

## [Compiling Ruby scripts for distribution to Windows and OS X](https://www.ruby-forum.com/t/compiling-ruby-scripts-for-distribution-to-windows-and-os-x/173215)

<div class="topic-metadata">

**Author:** [@dezrtdude](https://www.ruby-forum.com/u/dezrtdude)\
**Replies:** 3\
**Last updated:** [August 6, 2009, 8:20am UTC](https://www.ruby-forum.com/t/compiling-ruby-scripts-for-distribution-to-windows-and-os-x/173215 "2009-08-06T08:20:49Z")

</div>

Hi All, I need to create a binary from ruby scripts for both Windows and OS X. I need it to include all the necessary gems, etc. I’ve got OCRA working for Windows, however I need something for OS X. Ruby2Exe was s…

---

## [Zero placeholder exponential sprintf?](https://www.ruby-forum.com/t/zero-placeholder-exponential-sprintf/173213)

<div class="topic-metadata">

**Author:** [@Bil\_K](https://www.ruby-forum.com/u/Bil_K)\
**Replies:** 8\
**Last updated:** [August 6, 2009, 8:16am UTC](https://www.ruby-forum.com/t/zero-placeholder-exponential-sprintf/173213 "2009-08-06T08:16:09Z")

</div>

Hi, We have a request for 0.112345e+02 instead of, % ruby -e “puts ‘%.6e’ % \[ 1.123450e+2 \]” 1.123450e+02 Possible? Thanks,

---

## [A question about ruby-doc](https://www.ruby-forum.com/t/a-question-about-ruby-doc/154822)

<div class="topic-metadata">

**Author:** [@youhaodeyi](https://www.ruby-forum.com/u/youhaodeyi)\
**Replies:** 5\
**Last updated:** [August 6, 2009, 6:04am UTC](https://www.ruby-forum.com/t/a-question-about-ruby-doc/154822 "2009-08-06T06:04:50Z")

</div>

I installed ruby-doc-stdlib-0.10.1 in my computer and open the index file. I failed to show the method of String class. There are a lot of packages in the left frame and I don’t know which one contains string class. H…

---

## [Chars method](https://www.ruby-forum.com/t/chars-method/155285)

<div class="topic-metadata">

**Author:** [@georgeuoa](https://www.ruby-forum.com/u/georgeuoa)\
**Replies:** 7\
**Last updated:** [August 6, 2009, 5:15am UTC](https://www.ruby-forum.com/t/chars-method/155285 "2009-08-06T05:15:55Z")

</div>

Any ideas why this code returns : undefined method \`chars’ for “mystring”:String (NoMethodError) require ‘rubygems’ “mystring”.chars .to\_a Am using Ruby 1.8.6 on ubuntu 8.04 Thank you GG

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

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