# Ruby

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

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

---

## [$loadpath](https://www.ruby-forum.com/t/loadpath/135642)

<div class="topic-metadata">

**Author:** [@chinnakaruppan](https://www.ruby-forum.com/u/chinnakaruppan)\
**Replies:** 2\
**Last updated:** [April 23, 2008, 9:05pm UTC](https://www.ruby-forum.com/t/loadpath/135642 "2008-04-23T21:05:15Z")

</div>

Hi, I am using irb and when ever i open IRB session I have to update my $LOADPATH with my ruby program directory. $LOADPATH \<\< “c:/rb” .How can I avoid this.becauze I find some paths already set.So I was checking the …

---

## [Ridiculously cool Ruby snippets?](https://www.ruby-forum.com/t/ridiculously-cool-ruby-snippets/135536)

<div class="topic-metadata">

**Author:** [@stedwick](https://www.ruby-forum.com/u/stedwick)\
**Replies:** 5\
**Last updated:** [April 23, 2008, 8:34pm UTC](https://www.ruby-forum.com/t/ridiculously-cool-ruby-snippets/135536 "2008-04-23T20:34:05Z")

</div>

I came across this site: http://gilesbowkett.blogspot.com/2008/04/ruby-golf-ascii-sierpinski-triangle.html And it got me thinking. Is there a site somewhere dedicated solely to ridiculously cool ruby snippets? Also, i…

---

## [Newbie question -how do I add values to a result?](https://www.ruby-forum.com/t/newbie-question-how-do-i-add-values-to-a-result/135639)

<div class="topic-metadata">

**Author:** [@newrubygirl](https://www.ruby-forum.com/u/newrubygirl)\
**Replies:** 0\
**Last updated:** [April 23, 2008, 8:26pm UTC](https://www.ruby-forum.com/t/newbie-question-how-do-i-add-values-to-a-result/135639 "2008-04-23T20:26:33Z")

</div>

I know that I’m missing something simple here, but the solution is evading me. I want to get the values in the fruits field for my first order. Cart.find(:first, :select =\> “fruits”) =\>#(Car fruits: “apple, orange,…

---

## [Ruby and Visual Studio .NET](https://www.ruby-forum.com/t/ruby-and-visual-studio-net/135543)

<div class="topic-metadata">

**Author:** [@bado](https://www.ruby-forum.com/u/bado)\
**Replies:** 2\
**Last updated:** [April 23, 2008, 7:02pm UTC](https://www.ruby-forum.com/t/ruby-and-visual-studio-net/135543 "2008-04-23T19:02:21Z")

</div>

Do you have any experience working with Ruby and Visual Studio .NET? Is there any plugin or something to add support for Ruby to VS? Thanks in advance.

---

## [Stdin](https://www.ruby-forum.com/t/stdin/135624)

<div class="topic-metadata">

**Author:** [@chinnakaruppan](https://www.ruby-forum.com/u/chinnakaruppan)\
**Replies:** 1\
**Last updated:** [April 23, 2008, 6:47pm UTC](https://www.ruby-forum.com/t/stdin/135624 "2008-04-23T18:47:42Z")

</div>

Hi, I was trying to use the STDIN.read in the IRB .This keep eating what ever I type .it never comes to the next line.I am not sure what is happening …I not that famailiar with IO blocking …probably the STDIN blocked…

---

## [Is possible to extend "attr\_accessor" "attribue=" method?](https://www.ruby-forum.com/t/is-possible-to-extend-attr-accessor-attribue-method/135579)

<div class="topic-metadata">

**Author:** [@ISSSSaki\_Baz\_C](https://www.ruby-forum.com/u/ISSSSaki_Baz_C)\
**Replies:** 4\
**Last updated:** [April 23, 2008, 6:25pm UTC](https://www.ruby-forum.com/t/is-possible-to-extend-attr-accessor-attribue-method/135579 "2008-04-23T18:25:47Z")

</div>

Hi, I’d like to use an “attr\_accessor” but when its attribute is modified it should be executed more code than just an assignament. I handle it in this way (not cool): class MyClass1 \< Father attr\_reader :my\_param d…

---

## [Net::FTP problem with localhost](https://www.ruby-forum.com/t/net-ftp-problem-with-localhost/135600)

<div class="topic-metadata">

**Author:** [@threeeyedfish](https://www.ruby-forum.com/u/threeeyedfish)\
**Replies:** 2\
**Last updated:** [April 23, 2008, 5:49pm UTC](https://www.ruby-forum.com/t/net-ftp-problem-with-localhost/135600 "2008-04-23T17:49:02Z")

</div>

Good day all! I’ve started an FTP server on localhost:8021. Other clients (I’ve tried wget) connect successfully. Net:FTP.open(‘localhost:8021’) raises an exception: SocketError: getaddrinfo: nodename nor servname pr…

---

## [Grouping results by similar names](https://www.ruby-forum.com/t/grouping-results-by-similar-names/135464)

<div class="topic-metadata">

**Author:** [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Replies:** 1\
**Last updated:** [April 23, 2008, 5:16pm UTC](https://www.ruby-forum.com/t/grouping-results-by-similar-names/135464 "2008-04-23T17:16:01Z")

</div>

I’ve got a question that’s more to do with good old fashioned language-agnostic computer science as it is to do with ruby (however, i’m using ruby on rails so it’s being asked on this forum). I have several groups of …

---

## [ERB::Util#url\_encode bug fix](https://www.ruby-forum.com/t/erb-util-url-encode-bug-fix/135608)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 3\
**Last updated:** [April 23, 2008, 4:56pm UTC](https://www.ruby-forum.com/t/erb-util-url-encode-bug-fix/135608 "2008-04-23T16:56:19Z")

</div>

e$B$k$S$-$A$G$9!#e(B ERB::Util#url\_encodee$B$,F|K\\8lJ8;zNs$G@5$7$$7k2L$K$J$i$J$$%P%0$r=$@5$7$^$7$?!#e(B Index: lib/erb.rb — lib/erb.rb (revision 16174) +++ lib/erb.rb (working copy) @@ -799,7 +799,8 @@ # Programm…

---

## [Need help with wsdl2ruby](https://www.ruby-forum.com/t/need-help-with-wsdl2ruby/135612)

<div class="topic-metadata">

**Author:** [@tbochan](https://www.ruby-forum.com/u/tbochan)\
**Replies:** 0\
**Last updated:** [April 23, 2008, 4:31pm UTC](https://www.ruby-forum.com/t/need-help-with-wsdl2ruby/135612 "2008-04-23T16:31:23Z")

</div>

Hi, I have created ruby scripts using wsdl2ruby.rb (v1.5.8) from the Betfair service. ruby \\ruby\\bin\\wsdl2ruby.rb --type client --wsdl https://api.betfair.com/global/v3/BFGlobalService.wsdl When I try to run the gen…

---

## [Negative nums](https://www.ruby-forum.com/t/negative-nums/135478)

<div class="topic-metadata">

**Author:** [@twaters](https://www.ruby-forum.com/u/twaters)\
**Replies:** 2\
**Last updated:** [April 23, 2008, 3:35pm UTC](https://www.ruby-forum.com/t/negative-nums/135478 "2008-04-23T15:35:36Z")

</div>

Morning all, I sent an email on this yesterday and needed to give you guys some example code. Below is some code I have for grabbing the numbers I need from lines in a text file that we receive via FTP. My big con…

---

## [JRuby 1.1.1 Released](https://www.ruby-forum.com/t/jruby-1-1-1-released/135538)

<div class="topic-metadata">

**Author:** [@Thomas\_E](https://www.ruby-forum.com/u/Thomas_E)\
**Replies:** 3\
**Last updated:** [April 23, 2008, 3:32pm UTC](https://www.ruby-forum.com/t/jruby-1-1-1-released/135538 "2008-04-23T15:32:36Z")

</div>

The JRuby community is pleased to announce the release of JRuby 1.1.1! Homepage: http://www.jruby.org/ Download: http://dist.codehaus.org/jruby/ JRuby 1.1.1 is the first point release of JRuby 1.1. The fixes in this …

---

## [Module::class\_eval](https://www.ruby-forum.com/t/module-class-eval/135602)

<div class="topic-metadata">

**Author:** [@Wayne\_K](https://www.ruby-forum.com/u/Wayne_K)\
**Replies:** 2\
**Last updated:** [April 23, 2008, 3:23pm UTC](https://www.ruby-forum.com/t/module-class-eval/135602 "2008-04-23T15:23:28Z")

</div>

What’s the story with ModuleOps.Evaluate(CodeContext, RubyModule, MutableString) ? I could get the previous version to work by uncommenting the code at the bottom to call scriptCode.Run but in the new version, the si…

---

## [PickAxe - Understanding \[\] on SongList](https://www.ruby-forum.com/t/pickaxe-understanding-on-songlist/135597)

<div class="topic-metadata">

**Author:** [@mohnish82](https://www.ruby-forum.com/u/mohnish82)\
**Replies:** 4\
**Last updated:** [April 23, 2008, 2:55pm UTC](https://www.ruby-forum.com/t/pickaxe-understanding-on-songlist/135597 "2008-04-23T14:55:26Z")

</div>

Hi, I am a newbie and am following Programming Ruby 2nd edition. On page 44, there’s this piece of code, class SongList def initialize @songs = Array.new end def @songs\[index\] end end Now, the following code …

---

## [How to enable Tk.Tile for ruby?](https://www.ruby-forum.com/t/how-to-enable-tk-tile-for-ruby/133760)

<div class="topic-metadata">

**Author:** [@nop](https://www.ruby-forum.com/u/nop)\
**Replies:** 7\
**Last updated:** [April 23, 2008, 2:25pm UTC](https://www.ruby-forum.com/t/how-to-enable-tk-tile-for-ruby/133760 "2008-04-23T14:25:58Z")

</div>

Hello gents, I’ve got a standard ruby instalation (1.8.6) and ActiveState Tcl/Tk 8.4 and 8.5 on Windows XP. What I need is to enable Tile widgets. How to access them from ruby? It seems like the ruby doesn’t know anyt…

---

## [Triangle Area (#160)](https://www.ruby-forum.com/t/triangle-area-160/135244)

<div class="topic-metadata">

**Author:** [@mansfiem](https://www.ruby-forum.com/u/mansfiem)\
**Replies:** 21\
**Last updated:** [April 23, 2008, 2:15pm UTC](https://www.ruby-forum.com/t/triangle-area-160/135244 "2008-04-23T14:15:10Z")

</div>

Apologies for the latest… Some busy stuff this week in “real life.” In light of that, I’ve kept this quiz simple: you only need implement one function. I do provide brief descriptions of a few possible techniques, but…

---

## [Building Ruby 1.9 on Windows](https://www.ruby-forum.com/t/building-ruby-1-9-on-windows/135589)

<div class="topic-metadata">

**Author:** [@nop](https://www.ruby-forum.com/u/nop)\
**Replies:** 2\
**Last updated:** [April 23, 2008, 2:04pm UTC](https://www.ruby-forum.com/t/building-ruby-1-9-on-windows/135589 "2008-04-23T14:04:11Z")

</div>

Hello gents, I’ve just built ruby 1.9 for win32 including Tk 8.5. Everything passed ok. But running a simple script 'require “tk” ’ produces a strange error: D:\\Work\\ruby\>ruby test.rb :0:in \`require’: no such file t…

---

## [Can't build after updating r94](https://www.ruby-forum.com/t/cant-build-after-updating-r94/135560)

<div class="topic-metadata">

**Author:** [@headius](https://www.ruby-forum.com/u/headius)\
**Replies:** 5\
**Last updated:** [April 23, 2008, 12:25pm UTC](https://www.ruby-forum.com/t/cant-build-after-updating-r94/135560 "2008-04-23T12:25:28Z")

</div>

I know absolutely nothing about the build process, mono, or how this stuff is wired together, but I can’t get it to build today. ~/NetBeansProjects/ironruby âž” rake --trace compile mono=1 (in /Users/headius/NetBeansP…

---

## [Extract date from filenames using regex](https://www.ruby-forum.com/t/extract-date-from-filenames-using-regex/135557)

<div class="topic-metadata">

**Author:** [@owc](https://www.ruby-forum.com/u/owc)\
**Replies:** 12\
**Last updated:** [April 23, 2008, 12:08pm UTC](https://www.ruby-forum.com/t/extract-date-from-filenames-using-regex/135557 "2008-04-23T12:08:21Z")

</div>

I have my code which looks like this: delete= 5 + 2 #escape counting in weekends i.e Sat,Sun folders = $del\_path puts delete\_date = DateTime.now - delete regexp = Regexp.compile(/(\\d{4}\\d{2}\\d{2})/) fileDa…

---

## [Extending Hast class with custom = methods](https://www.ruby-forum.com/t/extending-hast-class-with-custom-methods/135549)

<div class="topic-metadata">

**Author:** [@ISSSSaki\_Baz\_C](https://www.ruby-forum.com/u/ISSSSaki_Baz_C)\
**Replies:** 11\
**Last updated:** [April 23, 2008, 12:06pm UTC](https://www.ruby-forum.com/t/extending-hast-class-with-custom-methods/135549 "2008-04-23T12:06:53Z")

</div>

Hi, I’d like to extend Hash class \[\] and \[\]= methods in order to find a key with case insensitive. This is: The actual Hash \[\] behaviour: {“a”=\>1,“b”=\>2}\[“a”\] =\> 1 {“a”=\>1,“b”=\>2}\[“A”\] =\> nil The beaviour I loo…

---

## [Huge array allocation causes exit(1) in 64 bit environment](https://www.ruby-forum.com/t/huge-array-allocation-causes-exit-1-in-64-bit-environment/135482)

<div class="topic-metadata">

**Author:** [@Yusuke\_ENDOH](https://www.ruby-forum.com/u/Yusuke_ENDOH)\
**Replies:** 1\
**Last updated:** [April 23, 2008, 11:46am UTC](https://www.ruby-forum.com/t/huge-array-allocation-causes-exit-1-in-64-bit-environment/135482 "2008-04-23T11:46:02Z")

</div>

e$B1sF#$H?=$7$^$9!#e(B 64 bit e$B4D6-$GBg$-$J%a%b%j$r3NJ\]$7$h$&$H$9$k$H!"%(%i!\<I=\<($b$J$/e(B exit(1) e$B$9$k$h$&$G$9!#e(B $ ./ruby -e ‘\[1\] \* (2\*\*32); p :foo’ $ echo $? 1 e$B$$$^$$$A2?$,5/$-$F$$$k$N$+$o$+$C$F$J$$$N$…

---

## [How to assign value from controller](https://www.ruby-forum.com/t/how-to-assign-value-from-controller/135585)

<div class="topic-metadata">

**Author:** [@hemantaray](https://www.ruby-forum.com/u/hemantaray)\
**Replies:** 0\
**Last updated:** [April 23, 2008, 11:37am UTC](https://www.ruby-forum.com/t/how-to-assign-value-from-controller/135585 "2008-04-23T11:37:40Z")

</div>

I want to assign a particular value to a table column or attribute from controller how can I do it plz help with a simple code

---

## [Character substitution using tr()](https://www.ruby-forum.com/t/character-substitution-using-tr/135457)

<div class="topic-metadata">

**Author:** [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Replies:** 4\
**Last updated:** [April 23, 2008, 10:48am UTC](https://www.ruby-forum.com/t/character-substitution-using-tr/135457 "2008-04-23T10:48:34Z")

</div>

I’m using a method that i found at the acts as ferret site: http://projects.jkraemer.net/acts\_as\_ferret/#UTF-8support which is intended to strip accents out of strings, turning for example “La BohÃ¨me” into “La Boheme…

---

## [RedCloth trims](https://www.ruby-forum.com/t/redcloth-trims/135577)

<div class="topic-metadata">

**Author:** [@bewhite](https://www.ruby-forum.com/u/bewhite)\
**Replies:** 0\
**Last updated:** [April 23, 2008, 10:31am UTC](https://www.ruby-forum.com/t/redcloth-trims/135577 "2008-04-23T10:31:17Z")

</div>

Hello! Double spaces and double line breakes are usually disabled in the RedCloth. Is it possible to disable to somehow? I have googled on the official website but unfortunately have not found anything useful. Small …

---

## [How to format json string](https://www.ruby-forum.com/t/how-to-format-json-string/135574)

<div class="topic-metadata">

**Author:** [@smellcode](https://www.ruby-forum.com/u/smellcode)\
**Replies:** 0\
**Last updated:** [April 23, 2008, 9:14am UTC](https://www.ruby-forum.com/t/how-to-format-json-string/135574 "2008-04-23T09:14:01Z")

</div>

i hava a json string in one line i mean no \\r \\n now i want to format it quickly and beautiful who know how to do it?

---

## [Zlib::GzipWriter - same code - different OS - different result](https://www.ruby-forum.com/t/zlib-gzipwriter-same-code-different-os-different-result/135559)

<div class="topic-metadata">

**Author:** [@denmat](https://www.ruby-forum.com/u/denmat)\
**Replies:** 2\
**Last updated:** [April 23, 2008, 8:52am UTC](https://www.ruby-forum.com/t/zlib-gzipwriter-same-code-different-os-different-result/135559 "2008-04-23T08:52:06Z")

</div>

Hi List, I have ruby-1.8.6.114-1.fc7 and archive-tar-minitar (0.5.2). If I run this script on windowsXP (ruby1.8.6.26 archive-tar-minitar (0.5.2)) it completes without a problem def tar\_and\_gzip(destination, paths) …

---

## [Having Trouble with ADTs](https://www.ruby-forum.com/t/having-trouble-with-adts/135563)

<div class="topic-metadata">

**Author:** [@trent\_d](https://www.ruby-forum.com/u/trent_d)\
**Replies:** 2\
**Last updated:** [April 23, 2008, 8:15am UTC](https://www.ruby-forum.com/t/having-trouble-with-adts/135563 "2008-04-23T08:15:59Z")

</div>

I’m looking for a list of Abstract Data Types and primitive data types used in ruby. I’ve searched google but google doesn’t come up with much on ruby. Thanks for the help.

---

## [1.8 sprintf %b generates broken strings with GC.stress](https://www.ruby-forum.com/t/1-8-sprintf-b-generates-broken-strings-with-gc-stress/135417)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 1\
**Last updated:** [April 23, 2008, 6:50am UTC](https://www.ruby-forum.com/t/1-8-sprintf-b-generates-broken-strings-with-gc-stress/135417 "2008-04-23T06:50:12Z")

</div>

GC.stress e$B$,F~$C$?$N$G;W$$N)$C$F$U$H;n$7$F$\_$k$H!"e(B1.8 e$B$Ne(B sprintf e$B$Ne(B %b e$B$Oe(B “\\000\\242\\272\\3535+\\000\\000P{d\\000\\000\\000\\000\\000ffffffffffff,\\n\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\00…

---

## [Dramatis actor library prerelease](https://www.ruby-forum.com/t/dramatis-actor-library-prerelease/135561)

<div class="topic-metadata">

**Author:** [@thegoatboy](https://www.ruby-forum.com/u/thegoatboy)\
**Replies:** 0\
**Last updated:** [April 23, 2008, 6:28am UTC](https://www.ruby-forum.com/t/dramatis-actor-library-prerelease/135561 "2008-04-23T06:28:30Z")

</div>

A prerelease of dramatis has gone up on http:://dramatis.mischance.net. dramatis is an actor library for dynamic languages. It allows developers to write concurrent programs using the actor model rather than having to …

---

## ["Native" Zlib Implementation Patch](https://www.ruby-forum.com/t/native-zlib-implementation-patch/135505)

<div class="topic-metadata">

**Author:** [@dreamwave](https://www.ruby-forum.com/u/dreamwave)\
**Replies:** 3\
**Last updated:** [April 23, 2008, 5:25am UTC](https://www.ruby-forum.com/t/native-zlib-implementation-patch/135505 "2008-04-23T05:25:53Z")

</div>

A patch implementing Zlib decompression (with GZip decompression support) as a built in library has been submitted to RubyForge: http://rubyforge.org/tracker/index.php?func=detail&aid=19711&group\_id=4359&atid=16800 . …

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

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