# Ruby

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

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

---

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

<div class="topic-metadata">

**Author:** [@keith](https://www.ruby-forum.com/u/keith)\
**Replies:** 9\
**Last updated:** [January 24, 2008, 6:17am UTC](https://www.ruby-forum.com/t/help-with-eval/126973 "2008-01-24T06:17:22Z")

</div>

Am I missing something with eval? Why does this code not work? eval(“foo = 1”) puts foo Gives: C:\\example\\trunk\>ruby script/runner lib/aggregate/keith.rb C:/example/trunk/vendor/rails/railties/lib/commands/runner.rb…

---

## [Weird gsub behavior](https://www.ruby-forum.com/t/weird-gsub-behavior/127005)

<div class="topic-metadata">

**Author:** [@lzell](https://www.ruby-forum.com/u/lzell)\
**Replies:** 3\
**Last updated:** [January 24, 2008, 5:12am UTC](https://www.ruby-forum.com/t/weird-gsub-behavior/127005 "2008-01-24T05:12:17Z")

</div>

Hi, I came across a problem in a gsub and boiled it down to this difference, can anyone explain? b=“trying to match whole string” =\> “trying to match whole string” b.gsub(/(.+)/,‘MATCH:\\1’) =\> “MATCH:trying t…

---

## [Parsing poorly written XML](https://www.ruby-forum.com/t/parsing-poorly-written-xml/126989)

<div class="topic-metadata">

**Author:** [@cghost](https://www.ruby-forum.com/u/cghost)\
**Replies:** 4\
**Last updated:** [January 24, 2008, 5:00am UTC](https://www.ruby-forum.com/t/parsing-poorly-written-xml/126989 "2008-01-24T05:00:59Z")

</div>

I’ve found an application which dumps all the registry settings for installed applications into an .xml file for me (you can find it as “myuninstall” via google). I can’t figure out the ruby code I need from REXML to …

---

## [Stuff method](https://www.ruby-forum.com/t/stuff-method/126999)

<div class="topic-metadata">

**Author:** [@cgramona](https://www.ruby-forum.com/u/cgramona)\
**Replies:** 3\
**Last updated:** [January 24, 2008, 4:22am UTC](https://www.ruby-forum.com/t/stuff-method/126999 "2008-01-24T04:22:58Z")

</div>

Hi, I missed the stuff function or method found in some languages so I added this method to my Helpers mixin. def stuff(str, substr, rplstr, prefix = ‘.’) r1 = Regexp.new("(#{prefix})(#{substr})(.)") str.gsub(r1,’\\1…

---

## [Reusing chunks of code](https://www.ruby-forum.com/t/reusing-chunks-of-code/127002)

<div class="topic-metadata">

**Author:** [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Replies:** 1\
**Last updated:** [January 24, 2008, 3:18am UTC](https://www.ruby-forum.com/t/reusing-chunks-of-code/127002 "2008-01-24T03:18:07Z")

</div>

Hi guys, I wanted to avoid using the word “block” as it’s such a key word in Ruby. I’m performing the same test twice here and there must be a way to reuse it… =begin Mon Jan 21 12:51:19 GMT 2008 simple plays with…

---

## [Ruby Insider](https://www.ruby-forum.com/t/ruby-insider/126998)

<div class="topic-metadata">

**Author:** [@cgramona](https://www.ruby-forum.com/u/cgramona)\
**Replies:** 1\
**Last updated:** [January 24, 2008, 1:05am UTC](https://www.ruby-forum.com/t/ruby-insider/126998 "2008-01-24T01:05:21Z")

</div>

Hi All, I am new to this forum and have joined to assist and get assistance and find out about new Ruby stuff. I used to really enjoy the Ruby Insider but in my opinion that site seems to been taken over by Ruby hate…

---

## [Need to convert string to array](https://www.ruby-forum.com/t/need-to-convert-string-to-array/126981)

<div class="topic-metadata">

**Author:** [@jackster](https://www.ruby-forum.com/u/jackster)\
**Replies:** 3\
**Last updated:** [January 24, 2008, 12:26am UTC](https://www.ruby-forum.com/t/need-to-convert-string-to-array/126981 "2008-01-24T00:26:28Z")

</div>

I have the following data stored in a string. This data is composed of many records. This is a single record: 2008-01-22,88.34,98.56,86.68,96.54,2175600,96.54 This is the string: “2008-01-22,88.34,98.56,86.68,96.54,…

---

## [Ruby 1.9 and ./libruby-static.a](https://www.ruby-forum.com/t/ruby-1-9-and-libruby-static-a/126991)

<div class="topic-metadata">

**Author:** [@fedzor](https://www.ruby-forum.com/u/fedzor)\
**Replies:** 0\
**Last updated:** [January 23, 2008, 11:53pm UTC](https://www.ruby-forum.com/t/ruby-1-9-and-libruby-static-a/126991 "2008-01-23T23:53:56Z")

</div>

Hopefully someone has run into this before: % make … … /usr/bin/ld: archive: ./libruby19-static.a has no table of contents, add one with ranlib(1) (can’t load from it) collect2: ld returned 1 exit status make\[1\]: …

---

## [Ruby on Windows with mysql and net](https://www.ruby-forum.com/t/ruby-on-windows-with-mysql-and-net/126920)

<div class="topic-metadata">

**Author:** [@Simon\_Jones](https://www.ruby-forum.com/u/Simon_Jones)\
**Replies:** 6\
**Last updated:** [January 23, 2008, 11:46pm UTC](https://www.ruby-forum.com/t/ruby-on-windows-with-mysql-and-net/126920 "2008-01-23T23:46:17Z")

</div>

Hello all, I’m a new Ruby user, so pardon me if this is a silly question, but I’ve done some googling and not found any answers so far. Apologies in advance if this post is a little long, but I thought it might help…

---

## [130 lines of code uses around 20MByte of mem](https://www.ruby-forum.com/t/130-lines-of-code-uses-around-20mbyte-of-mem/126984)

<div class="topic-metadata">

**Author:** [@heinrich1208](https://www.ruby-forum.com/u/heinrich1208)\
**Replies:** 1\
**Last updated:** [January 23, 2008, 11:38pm UTC](https://www.ruby-forum.com/t/130-lines-of-code-uses-around-20mbyte-of-mem/126984 "2008-01-23T23:38:55Z")

</div>

Hi, anybody an idea which of these requires could use that much memory? require ‘yaml’ require ‘net/https’ require ‘net/http’ require ‘openssl’ require ‘csv’ require ‘date’ require ‘time’ require ‘socket’ inclu…

---

## [Segmentation fault with Ruby 1.8.6-p111 on 64bit Linux](https://www.ruby-forum.com/t/segmentation-fault-with-ruby-1-8-6-p111-on-64bit-linux/126988)

<div class="topic-metadata">

**Author:** [@destiney](https://www.ruby-forum.com/u/destiney)\
**Replies:** 0\
**Last updated:** [January 23, 2008, 11:34pm UTC](https://www.ruby-forum.com/t/segmentation-fault-with-ruby-1-8-6-p111-on-64bit-linux/126988 "2008-01-23T23:34:31Z")

</div>

I realize this isn’t a Rails list but my problem is with Ruby as far as I can tell. I’m having issues getting a Rails app to run on a new 64bit Linux box. The app has been working fine for some time on an older 32bit …

---

## [Mms2r 2.0.0 Released](https://www.ruby-forum.com/t/mms2r-2-0-0-released/126983)

<div class="topic-metadata">

**Author:** [@mike-moscow](https://www.ruby-forum.com/u/mike-moscow)\
**Replies:** 0\
**Last updated:** [January 23, 2008, 11:14pm UTC](https://www.ruby-forum.com/t/mms2r-2-0-0-released/126983 "2008-01-23T23:14:33Z")

</div>

mms2r version 2.0.0 has been released! http://mms2r.rubyforge.org/ http://rubyforge.org/tracker/?group\_id=3065 DESCRIPTION: MMS2R is a library that decodes the parts of an MMS message to disk while stripping out ad…

---

## [BMC Remedy ARS wrapper](https://www.ruby-forum.com/t/bmc-remedy-ars-wrapper/126942)

<div class="topic-metadata">

**Author:** [@Helbrax](https://www.ruby-forum.com/u/Helbrax)\
**Replies:** 1\
**Last updated:** [January 23, 2008, 11:11pm UTC](https://www.ruby-forum.com/t/bmc-remedy-ars-wrapper/126942 "2008-01-23T23:11:29Z")

</div>

Does anyone know of a ruby wrapper to the Remedy Action Request System from BMC? We currently handle all of our remedy automation via a perl script using ARSPerl, which is a perl wrapper around the Remedy API. We als…

---

## [Specs and mocks in Ruby 1.9](https://www.ruby-forum.com/t/specs-and-mocks-in-ruby-1-9/126963)

<div class="topic-metadata">

**Author:** [@inspire22](https://www.ruby-forum.com/u/inspire22)\
**Replies:** 1\
**Last updated:** [January 23, 2008, 10:55pm UTC](https://www.ruby-forum.com/t/specs-and-mocks-in-ruby-1-9/126963 "2008-01-23T22:55:06Z")

</div>

I would like to use RSpec syntax for some code I want to write for Ruby 1.9. RSpec hasn’t been released with a 1.9-compatible release yet. What alternatives are there for spec-syntax and mocking in Ruby 1.9? Bacon? Mo…

---

## [How to improve this code?](https://www.ruby-forum.com/t/how-to-improve-this-code/126882)

<div class="topic-metadata">

**Author:** [@jrjuniorsp](https://www.ruby-forum.com/u/jrjuniorsp)\
**Replies:** 15\
**Last updated:** [January 23, 2008, 9:48pm UTC](https://www.ruby-forum.com/t/how-to-improve-this-code/126882 "2008-01-23T21:48:47Z")

</div>

Hi guys, I am new in the Ruby world, I am coming from Java, and I would like to "think " in Ruby instead Java. I did a code to read a CSV file (separated by comma), organize the values and print the output. Basicall…

---

## [Quick ruby-powered html-forms?](https://www.ruby-forum.com/t/quick-ruby-powered-html-forms/126803)

<div class="topic-metadata">

**Author:** [@Casimir](https://www.ruby-forum.com/u/Casimir)\
**Replies:** 5\
**Last updated:** [January 23, 2008, 8:37pm UTC](https://www.ruby-forum.com/t/quick-ruby-powered-html-forms/126803 "2008-01-23T20:37:04Z")

</div>

I am certain someone has made a solution for quickly creating forms with ruby. Any ideas? (other than installing rails) Thanks Casimir

---

## [HTTP Proxy instruction?](https://www.ruby-forum.com/t/http-proxy-instruction/126836)

<div class="topic-metadata">

**Author:** [@blacknight](https://www.ruby-forum.com/u/blacknight)\
**Replies:** 4\
**Last updated:** [January 23, 2008, 8:24pm UTC](https://www.ruby-forum.com/t/http-proxy-instruction/126836 "2008-01-23T20:24:10Z")

</div>

I’m looking to create a proxy that will scrape all my http headers and post them to stdout. My searches have been vacant on this topic, does anybody know of any good tutorials out there? -Ben

---

## [Strange syntax error in while loop](https://www.ruby-forum.com/t/strange-syntax-error-in-while-loop/126951)

<div class="topic-metadata">

**Author:** [@laredotornado](https://www.ruby-forum.com/u/laredotornado)\
**Replies:** 2\
**Last updated:** [January 23, 2008, 7:03pm UTC](https://www.ruby-forum.com/t/strange-syntax-error-in-while-loop/126951 "2008-01-23T19:03:08Z")

</div>

Hi, I’m getting the error SyntaxError in OrderController#confirm /usr/local/apache2/htdocs/easyrx/app/controllers/order\_controller.rb: 11: syntax error, unexpected kEND end ^ /usr/local/apache2/htdocs/easyrx/a…

---

## [Floating point conversion error?](https://www.ruby-forum.com/t/floating-point-conversion-error/126939)

<div class="topic-metadata">

**Author:** [@bhoult](https://www.ruby-forum.com/u/bhoult)\
**Replies:** 4\
**Last updated:** [January 23, 2008, 4:38pm UTC](https://www.ruby-forum.com/t/floating-point-conversion-error/126939 "2008-01-23T16:38:45Z")

</div>

(2241.18 \* 100).to\_i =\> 224117 Anyone know what is up with that?

---

## [Longest Repeated Substring (#153)](https://www.ruby-forum.com/t/longest-repeated-substring-153/126466)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 61\
**Last updated:** [January 23, 2008, 4:06pm UTC](https://www.ruby-forum.com/t/longest-repeated-substring-153/126466 "2008-01-23T16:06:45Z")

</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: …

---

## [Singleton definition differences](https://www.ruby-forum.com/t/singleton-definition-differences/126886)

<div class="topic-metadata">

**Author:** [@nickrahn](https://www.ruby-forum.com/u/nickrahn)\
**Replies:** 7\
**Last updated:** [January 23, 2008, 3:05pm UTC](https://www.ruby-forum.com/t/singleton-definition-differences/126886 "2008-01-23T15:05:28Z")

</div>

would someone please explain the difference between these definitions class A class \<\< self def hello puts ‘hello’ end end end class B def B.hello puts ‘hello’ end end A.hello B.hello

---

## [How to find existence of method in ruby class?](https://www.ruby-forum.com/t/how-to-find-existence-of-method-in-ruby-class/126914)

<div class="topic-metadata">

**Author:** [@chirag\_mistry\_ruby](https://www.ruby-forum.com/u/chirag_mistry_ruby)\
**Replies:** 0\
**Last updated:** [January 23, 2008, 12:35pm UTC](https://www.ruby-forum.com/t/how-to-find-existence-of-method-in-ruby-class/126914 "2008-01-23T12:35:32Z")

</div>

Hi We can define method in Ruby class using â€œrb\_define\_methodâ€ C API in C application. We can also call that method using â€œrb\_funcall2â€ or â€œrb\_funcall3â€ C APIs. How do I know whether method with given name…

---

## [Lyrics and Chinese in Ruby?](https://www.ruby-forum.com/t/lyrics-and-chinese-in-ruby/126686)

<div class="topic-metadata">

**Author:** [@NewtonApple](https://www.ruby-forum.com/u/NewtonApple)\
**Replies:** 1\
**Last updated:** [January 23, 2008, 12:10pm UTC](https://www.ruby-forum.com/t/lyrics-and-chinese-in-ruby/126686 "2008-01-23T12:10:38Z")

</div>

Hello, has anyone used Chinese with Ruby? I’m trying to write a script that would import/export my lyrics from/to lyricwiki.org. Since they don’t have a lot of Chinese lyrics, I thought I’d help them out by exporting…

---

## [How to expire session on window close](https://www.ruby-forum.com/t/how-to-expire-session-on-window-close/126907)

<div class="topic-metadata">

**Author:** [@varunkumargoel](https://www.ruby-forum.com/u/varunkumargoel)\
**Replies:** 1\
**Last updated:** [January 23, 2008, 12:06pm UTC](https://www.ruby-forum.com/t/how-to-expire-session-on-window-close/126907 "2008-01-23T12:06:29Z")

</div>

Hi all, I created one login page using LDAP server authentication now when i have logged into the system and without logout i just closed the window and when i again come and open the window it’s come as log in. But …

---

## [Is there any way to pass further the "hidden" block?](https://www.ruby-forum.com/t/is-there-any-way-to-pass-further-the-hidden-block/123383)

<div class="topic-metadata">

**Author:** [@Chiyuan\_Z](https://www.ruby-forum.com/u/Chiyuan_Z)\
**Replies:** 13\
**Last updated:** [January 23, 2008, 9:35am UTC](https://www.ruby-forum.com/t/is-there-any-way-to-pass-further-the-hidden-block/123383 "2008-01-23T09:35:47Z")

</div>

Like this: def foo yield end def bar(&brk) foo(&brk) end bar { puts “foo” } What I want to know is: is there any way to define \`bar’ like this: def bar foo end so that foo will get the block passed to bar? I …

---

## [ASCII-8BIT regexp](https://www.ruby-forum.com/t/ascii-8bit-regexp/126824)

<div class="topic-metadata">

**Author:** [@sheepman](https://www.ruby-forum.com/u/sheepman)\
**Replies:** 2\
**Last updated:** [January 23, 2008, 8:11am UTC](https://www.ruby-forum.com/t/ascii-8bit-regexp/126824 "2008-01-23T08:11:48Z")

</div>

e$B$3$s$P$s$Oe(B sheepman e$B$G$9!#e(B e$B%(%s%3!\<%G%#%s%0$,e(B ASCII-8BIT e$B$G$"$k@55,I=8=%%V%8%’%/%H$Ke(B e$B4X$7$F\<ALd$G$9!#J9$-$?$$$N$O!V@55,I=8=$N%(%s%3!\<%G%#%s%0$,e(B ASCII-8BITe$B$G$"$k$H$$$&$N$O$I$&$$$&$3$H$J…

---

## [Converting Strings](https://www.ruby-forum.com/t/converting-strings/126893)

<div class="topic-metadata">

**Author:** [@zenki99](https://www.ruby-forum.com/u/zenki99)\
**Replies:** 3\
**Last updated:** [January 23, 2008, 7:43am UTC](https://www.ruby-forum.com/t/converting-strings/126893 "2008-01-23T07:43:21Z")

</div>

hey, I’m trying to convert the strings below into an array of all the unique words converted to lower case. comment \<\< COMMENT This is a ruby code. More lovely code. Better than PHP. That is it. COMMENT result\_s…

---

## [\[ANN\] Gerbil 1.1.0](https://www.ruby-forum.com/t/ann-gerbil-1-1-0/126896)

<div class="topic-metadata">

**Author:** [@snk](https://www.ruby-forum.com/u/snk)\
**Replies:** 0\
**Last updated:** [January 23, 2008, 6:39am UTC](https://www.ruby-forum.com/t/ann-gerbil-1-1-0/126896 "2008-01-23T06:39:30Z")

</div>

Gerbil Gerbil is an extensible document generator based on eRuby that outputs to any format you want: plain text, HTML, LaTeX, UNIX man page, your own custom format, and so on. http://gerb…

---

## [Requests to transcode](https://www.ruby-forum.com/t/requests-to-transcode/126672)

<div class="topic-metadata">

**Author:** [@U.Nakamura](https://www.ruby-forum.com/u/U.Nakamura)\
**Replies:** 7\
**Last updated:** [January 23, 2008, 5:17am UTC](https://www.ruby-forum.com/t/requests-to-transcode/126672 "2008-01-23T05:17:25Z")

</div>

e$B$3$s$K$A$O!"$J$+$\`$ie(B(e$B$&e(B)e$B$G$9!#e(B transcodee$B$K4X$7$F!“e(B3e$BE@$\[$IMWK\>$,$”$k$N$G$9$,!"$=$l$\>$l\<B8=2De(B e$BG=@-e(B(e$B$H!"\<B8=$9$k$J$i;~4|e(B)e$B$O$I$s$J$b$s$G$7$g$&$+e(B? (1) Windows-31Je$B%5%\]!\<%He…

---

## [Comment about Math#asin](https://www.ruby-forum.com/t/comment-about-math-asin/126819)

<div class="topic-metadata">

**Author:** [@Yusuke\_ENDOH](https://www.ruby-forum.com/u/Yusuke_ENDOH)\
**Replies:** 2\
**Last updated:** [January 23, 2008, 5:15am UTC](https://www.ruby-forum.com/t/comment-about-math-asin/126819 "2008-01-23T05:15:05Z")

</div>

e$B1sF#$H?=$7$^$9!#e(B Math#asin e$B$O%3%a%s%H$K$h$k$He(B 0…PI e$B$NCM$rJV$9$3$H$K$J$C$F$$$^$9$,e(B e$B\<B:\]$K$Oe(B -{PI/2} … {PI/2} e$B$@$H;W$$$^$9!#e(B e$B8H$$?$$$J%D%C%3%$P$+$j$G$9$\_$^$;$se(B (e$B\>Pe(B) Index: math…

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

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