# Ruby

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

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

---

## [Using array.select with grep](https://www.ruby-forum.com/t/using-array-select-with-grep/144720)

<div class="topic-metadata">

**Author:** [@milo](https://www.ruby-forum.com/u/milo)\
**Replies:** 15\
**Last updated:** [August 1, 2008, 9:27pm UTC](https://www.ruby-forum.com/t/using-array-select-with-grep/144720 "2008-08-01T21:27:07Z")

</div>

Using irb I set up the following arrays: arr1 =\> \[“one”, “two”, “three”\] arr2 =\> \[“two”, “three”, “four”\] I would expect to be able to collect the elements of arr1 that are also in arr2 using select and grep,…

---

## [Problem with "starts\_with?"](https://www.ruby-forum.com/t/problem-with-starts-with/144678)

<div class="topic-metadata">

**Author:** [@skaverat](https://www.ruby-forum.com/u/skaverat)\
**Replies:** 5\
**Last updated:** [August 1, 2008, 9:19pm UTC](https://www.ruby-forum.com/t/problem-with-starts-with/144678 "2008-08-01T21:19:29Z")

</div>

How can I get this code to work in my classes? http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/String/StartsEndsWith.html I’d like to have all my custom methods located in one file, which I can just in…

---

## [My simple downloader doesn't work](https://www.ruby-forum.com/t/my-simple-downloader-doesnt-work/144538)

<div class="topic-metadata">

**Author:** [@wujciol](https://www.ruby-forum.com/u/wujciol)\
**Replies:** 9\
**Last updated:** [August 1, 2008, 7:53pm UTC](https://www.ruby-forum.com/t/my-simple-downloader-doesnt-work/144538 "2008-08-01T19:53:02Z")

</div>

Hello, I’m learning Ruby for some time. Today I started to write simple code which will download specified files from specified servers but it doesn’t work. It always showing me error 500 when code is going to downlo…

---

## [\[0xff5e\].pack("U").encode("EUC-JP", "UTF-8")](https://www.ruby-forum.com/t/0xff5e-pack-u-encode-euc-jp-utf-8/144739)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 0\
**Last updated:** [August 1, 2008, 5:11pm UTC](https://www.ruby-forum.com/t/0xff5e-pack-u-encode-euc-jp-utf-8/144739 "2008-08-01T17:11:39Z")

</div>

U+FF5E e$B$re(B EUC-JP e$B$KJQ49$G$-$J$$$N$O$=$&$$$&$b$N$G$7$g$&$+!#e(B % ./ruby -ve ‘p \[0xff5e\].pack(“U”).encode(“EUC-JP”, “UTF-8”)’ ruby 1.9.0 (2008-08-01 revision 18312) \[i686-linux\] -e:1:in encode': invalid byte s…

---

## ["\\xEF\\xBD\\x9E".encode("EUC-JP", "UTF-8")](https://www.ruby-forum.com/t/xef-xbd-x9e-encode-euc-jp-utf-8/144738)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 0\
**Last updated:** [August 1, 2008, 4:49pm UTC](https://www.ruby-forum.com/t/xef-xbd-x9e-encode-euc-jp-utf-8/144738 "2008-08-01T16:49:24Z")

</div>

“\\xEF\\xBD\\x9E”.encode(“EUC-JP”, “UTF-8”) e$B$,e(B invalid byte sequence e$B$K$J$j$^$9!#e(B % ./ruby -ve ‘"\\xEF\\xBD\\x9E".encode(“EUC-JP”, “UTF-8”)’ ruby 1.9.0 (2008-08-01 revision 18312) \[i686-linux\] -e:1:in encode': …

---

## [\[Bug:1.9\] Rinda has a race condition](https://www.ruby-forum.com/t/bug-1-9-rinda-has-a-race-condition/144001)

<div class="topic-metadata">

**Author:** [@Yusuke\_ENDOH](https://www.ruby-forum.com/u/Yusuke_ENDOH)\
**Replies:** 5\
**Last updated:** [August 1, 2008, 4:17pm UTC](https://www.ruby-forum.com/t/bug-1-9-rinda-has-a-race-condition/144001 "2008-08-01T16:17:10Z")

</div>

e$B1sF#$G$9!#e(B e$B8=:\_e(B make test-all e$B$Ge(B Rinda e$B$N%F%9%H$OL58z2=$5$l$F$$$^$9!#e(B Failure: test\_message(Rinda::TupleSpaceTest) \[/home/mame/work/ruby19/ruby/test/rinda/test\_rinda.rb:497\]: YARV doesn’t s…

---

## [File manipulation](https://www.ruby-forum.com/t/file-manipulation/144649)

<div class="topic-metadata">

**Author:** [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Replies:** 9\
**Last updated:** [August 1, 2008, 4:00pm UTC](https://www.ruby-forum.com/t/file-manipulation/144649 "2008-08-01T16:00:48Z")

</div>

So, I am currently working on a MUD (Online multiplayer text based game, like an MMO). The MUD’s scripting language is LPC. I am trying to create a ruby script, that reads another ruby file, and changes all instances …

---

## [\[ANN\] Radiant 0.6.9 "Etch" - Bugfix Release](https://www.ruby-forum.com/t/ann-radiant-0-6-9-etch-bugfix-release/144729)

<div class="topic-metadata">

**Author:** [@smc7000](https://www.ruby-forum.com/u/smc7000)\
**Replies:** 0\
**Last updated:** [August 1, 2008, 3:22pm UTC](https://www.ruby-forum.com/t/ann-radiant-0-6-9-etch-bugfix-release/144729 "2008-08-01T15:22:34Z")

</div>

Looks like it’s time for another release of Radiant: http://radiantcms.org/download/ Radiant 0.6.9 “Etch” fixes bugs present in the 0.6.8 release. Namely: The inherit attribute on \<r:unless\_content\> now correctly def…

---

## [\[0xff0c\].pack("U").encode("Windows-31J", "UTF-8")](https://www.ruby-forum.com/t/0xff0c-pack-u-encode-windows-31j-utf-8/144726)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 0\
**Last updated:** [August 1, 2008, 3:18pm UTC](https://www.ruby-forum.com/t/0xff0c-pack-u-encode-windows-31j-utf-8/144726 "2008-08-01T15:18:29Z")

</div>

e$B0J2\<$N$h$&$K!“e(BU+FF0C e$B$,e(B Windows-31J e$B$KJQ49$G$-$^$;$s$,!”$3$le(B e$B$O$=$&$$$&$b$N$G$7$g$&$+!#e(B % ./ruby -ve ‘p \[0xff0c\].pack(“U”).encode(“Windows-31J”, “UTF-8”)’ ruby 1.9.0 (2008-08-01 revision 18308…

---

## [Encoding.c should use ruby\_strdup](https://www.ruby-forum.com/t/encoding-c-should-use-ruby-strdup/144723)

<div class="topic-metadata">

**Author:** [@Yusuke\_ENDOH](https://www.ruby-forum.com/u/Yusuke_ENDOH)\
**Replies:** 0\
**Last updated:** [August 1, 2008, 2:48pm UTC](https://www.ruby-forum.com/t/encoding-c-should-use-ruby-strdup/144723 "2008-08-01T14:48:34Z")

</div>

e$B1sF#$G$9!#e(B encoding.c e$B$NCf$G@8$Ne(B strdup e$B$r;H$C$F$$$FJV$jCM$N8!::$r$7$F$$$J$$e(B e$B$?$a!"e(Bfailmalloc e$B$G$$$8$a$k$HMn$A$^$9!#e(B $ FAILMALLOC\_SPACE=0x10 \\ LD\_PRELOAD=/home/mame/local/lib/libfailma…

---

## [JuneBug or Instiki or?](https://www.ruby-forum.com/t/junebug-or-instiki-or/144680)

<div class="topic-metadata">

**Author:** [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Replies:** 3\
**Last updated:** [August 1, 2008, 2:31pm UTC](https://www.ruby-forum.com/t/junebug-or-instiki-or/144680 "2008-08-01T14:31:00Z")

</div>

Where’s the Ruby WikiWiki at? T.

---

## [Refactor.rb (decoration plus AOP)](https://www.ruby-forum.com/t/refactor-rb-decoration-plus-aop/144683)

<div class="topic-metadata">

**Author:** [@danielb](https://www.ruby-forum.com/u/danielb)\
**Replies:** 1\
**Last updated:** [August 1, 2008, 1:38pm UTC](https://www.ruby-forum.com/t/refactor-rb-decoration-plus-aop/144683 "2008-08-01T13:38:17Z")

</div>

Hi all, Courtesy of Yuki S., I stumbled across this: Looks pretty cool to me. Decoration plus AOP! Ara, have you already done something like this? Just thought I’d mention it. Regards, Dan

---

## [String function to delete characters](https://www.ruby-forum.com/t/string-function-to-delete-characters/144714)

<div class="topic-metadata">

**Author:** [@prasad](https://www.ruby-forum.com/u/prasad)\
**Replies:** 2\
**Last updated:** [August 1, 2008, 1:35pm UTC](https://www.ruby-forum.com/t/string-function-to-delete-characters/144714 "2008-08-01T13:35:36Z")

</div>

Hi all, Do we have a string function in RUBY to delete 1st 3 characters or last 3 character or 3 characters in middle from the string. Ex: user = aaaPrasadxxxPrasadxxx from above string “user” I want to delet…

---

## [Read text file](https://www.ruby-forum.com/t/read-text-file/144709)

<div class="topic-metadata">

**Author:** [@ganana\_srishti](https://www.ruby-forum.com/u/ganana_srishti)\
**Replies:** 3\
**Last updated:** [August 1, 2008, 12:39pm UTC](https://www.ruby-forum.com/t/read-text-file/144709 "2008-08-01T12:39:06Z")

</div>

Hi, I have one text file for example 9115 2008-06-20 07:26:35 91415 2008-06-20 07:26:32 9315 2008-06-20 07:26:33 2115 2008-06-20 07:26:05 15 2008-06-20 07:26:34 115 2008-06-20 07:26:35 i need to read only f…

---

## ["\\xEF\\xB8\\x80".encode("EUC-JP", "UTF-8") dumps core](https://www.ruby-forum.com/t/xef-xb8-x80-encode-euc-jp-utf-8-dumps-core/144710)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 0\
**Last updated:** [August 1, 2008, 12:22pm UTC](https://www.ruby-forum.com/t/xef-xb8-x80-encode-euc-jp-utf-8-dumps-core/144710 "2008-08-01T12:22:44Z")

</div>

e$B0J2\<$N$h$&$K$9$k$He(B SEGV e$B$7$^$9!#e(B % ./ruby -e ‘"\\xEF\\xB8\\x80".encode(“EUC-JP”, “UTF-8”)’ -e:1: \[BUG\] Segmentation fault ruby 1.9.0 (2008-08-01 revision 18300) \[i686-linux\] – control frame ---------- c:000…

---

## [PDF::Writer centered text in the middle of the page](https://www.ruby-forum.com/t/pdf-writer-centered-text-in-the-middle-of-the-page/144706)

<div class="topic-metadata">

**Author:** [@gunbol](https://www.ruby-forum.com/u/gunbol)\
**Replies:** 0\
**Last updated:** [August 1, 2008, 12:02pm UTC](https://www.ruby-forum.com/t/pdf-writer-centered-text-in-the-middle-of-the-page/144706 "2008-08-01T12:02:38Z")

</div>

Hello, I am trying to generate a PDF File with a centered text in the middle of the page. I have tryed to use the add\_text and add\_text\_wrapped methods, but the text either not fitting in the page, or the text is tru…

---

## [Super with block](https://www.ruby-forum.com/t/super-with-block/144596)

<div class="topic-metadata">

**Author:** [@lzell](https://www.ruby-forum.com/u/lzell)\
**Replies:** 16\
**Last updated:** [August 1, 2008, 11:36am UTC](https://www.ruby-forum.com/t/super-with-block/144596 "2008-08-01T11:36:24Z")

</div>

Hi all, I’m looking for a bit of help. I can’t seem to get the block to “pass through” to the parent class. I figured without an ‘&’ in the parameter list there would be no conversion to proc but maybe that is not t…

---

## [What's difference between class\_eval and module\_eval?](https://www.ruby-forum.com/t/whats-difference-between-class-eval-and-module-eval/144696)

<div class="topic-metadata">

**Author:** [@Kyung\_won\_C](https://www.ruby-forum.com/u/Kyung_won_C)\
**Replies:** 1\
**Last updated:** [August 1, 2008, 11:10am UTC](https://www.ruby-forum.com/t/whats-difference-between-class-eval-and-module-eval/144696 "2008-08-01T11:10:02Z")

</div>

– test.rb – module M def self.test puts “M.test is called” end end M.test M.instance\_eval { test } M.class\_eval { test } M.module\_eval { test } — result — M.test is called M.test is called M.test is called …

---

## [\[Ruby 1.9 - Bug #383\] (Open) magic comment allows leading expressions](https://www.ruby-forum.com/t/ruby-1-9-bug-383-open-magic-comment-allows-leading-expressions/144701)

<div class="topic-metadata">

**Author:** [@Yuki\_S](https://www.ruby-forum.com/u/Yuki_S)\
**Replies:** 0\
**Last updated:** [August 1, 2008, 10:46am UTC](https://www.ruby-forum.com/t/ruby-1-9-bug-383-open-magic-comment-allows-leading-expressions/144701 "2008-08-01T10:46:02Z")

</div>

e$B%A%1%C%He(B #383 e$B$,Js9p$5$l$^$7$?!#e(B (by Yuki S.) Bug #383: magic comment allows leading expressions http://redmine.ruby-lang.org/issues/show/383 e$B5/I\<\<Te(B: Yuki S. e$B%9%F!\<%?%9e(B: Open e$BM%@hEYe(B: N…

---

## [Gc doesn't collect?](https://www.ruby-forum.com/t/gc-doesnt-collect/144569)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 12\
**Last updated:** [August 1, 2008, 10:36am UTC](https://www.ruby-forum.com/t/gc-doesnt-collect/144569 "2008-08-01T10:36:38Z")

</div>

Any ideas why: 1.times { a = ‘a’\*1000}; 30.times { GC.start }; print ObjectSpace.each\_object{|o| print o} prints out ‘aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa…’ despite the fact that the a’s should have been collected? Tha…

---

## [\[ANN\] Rassmalog 12.0.0](https://www.ruby-forum.com/t/ann-rassmalog-12-0-0/144694)

<div class="topic-metadata">

**Author:** [@snk](https://www.ruby-forum.com/u/snk)\
**Replies:** 0\
**Last updated:** [August 1, 2008, 9:34am UTC](https://www.ruby-forum.com/t/ann-rassmalog-12-0-0/144694 "2008-08-01T09:34:21Z")

</div>

Rassmalog is a static blog engine based on YAML, eRuby, and Rake. It transforms blog entries written in Textile or other formatting systems into valid XHTML files that you can view on your computer or upload to your …

---

## [How to get special directories?](https://www.ruby-forum.com/t/how-to-get-special-directories/144623)

<div class="topic-metadata">

**Author:** [@requiem](https://www.ruby-forum.com/u/requiem)\
**Replies:** 17\
**Last updated:** [August 1, 2008, 9:12am UTC](https://www.ruby-forum.com/t/how-to-get-special-directories/144623 "2008-08-01T09:12:17Z")

</div>

hi all, how can i get ruby to get me some special directories, such as the home-folder on linux or “documents and settings” on windows? is there already some functionality available to do this or will i have to use p…

---

## [Http://makmoneyy.googlepages.com](https://www.ruby-forum.com/t/http-makmoneyy-googlepages-com/144691)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [August 1, 2008, 9:05am UTC](https://www.ruby-forum.com/t/http-makmoneyy-googlepages-com/144691 "2008-08-01T09:05:49Z")

</div>

http://makmoneyy.googlepages.com …..~.~././… …(@.@)… …======oOOo=(\_)=oOOo=========. …|…Se você é como eu, que…| …|…fica super feliz ao perceber…| …|…e ver o quanto sua mãe trata…| …|…bem o seu namorado e o quanto……

---

## [Link\_to\_remote not working for remote ip calls](https://www.ruby-forum.com/t/link-to-remote-not-working-for-remote-ip-calls/144676)

<div class="topic-metadata">

**Author:** [@bishal](https://www.ruby-forum.com/u/bishal)\
**Replies:** 1\
**Last updated:** [August 1, 2008, 3:24am UTC](https://www.ruby-forum.com/t/link-to-remote-not-working-for-remote-ip-calls/144676 "2008-08-01T03:24:20Z")

</div>

Why is link\_to\_remote not working when i actually make a call to different application from the one i am currently in. I am in ip1 and i want to make remote calls to ip2 from ip1 but i am unable to do it, but when i t…

---

## ["\\u20AC".encode("euc-jp", :undef=\>:replace)](https://www.ruby-forum.com/t/u20ac-encode-euc-jp-undef-replace/144675)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 0\
**Last updated:** [August 1, 2008, 2:59am UTC](https://www.ruby-forum.com/t/u20ac-encode-euc-jp-undef-replace/144675 "2008-08-01T02:59:47Z")

</div>

e$B0J2\<$N$h$&$Ke(B UTF-8 e$B$Je(B EURO SIGN (20AC) e$B$re(B EUC-JP e$B$KJQ49$9$ke(B e$B$H$-$Ke(B :undef=\>:replace e$B$r$D$1$k$H!"e(B? e$B$,$U$?$D=P$F$-$^$9!#e(B e$BF~NO$Oe(B EURO SIGN e$B$Ne(B 1e$BJ8;z$G$9$+$i!"=PNO$…

---

## [Input redirection in ruby](https://www.ruby-forum.com/t/input-redirection-in-ruby/144619)

<div class="topic-metadata">

**Author:** [@Michal\_S](https://www.ruby-forum.com/u/Michal_S)\
**Replies:** 4\
**Last updated:** [August 1, 2008, 1:12am UTC](https://www.ruby-forum.com/t/input-redirection-in-ruby/144619 "2008-08-01T01:12:13Z")

</div>

Hello I could not find any way to redirect input and output of programs in ruby. You can capture the fds but not redirect AFAICT. So unless there is something I have overlooked I add the the ruby wishlist: let pope…

---

## [Follow-Up on AOL JRuby Presentation](https://www.ruby-forum.com/t/follow-up-on-aol-jruby-presentation/144561)

<div class="topic-metadata">

**Author:** [@gennosuke](https://www.ruby-forum.com/u/gennosuke)\
**Replies:** 2\
**Last updated:** [August 1, 2008, 12:59am UTC](https://www.ruby-forum.com/t/follow-up-on-aol-jruby-presentation/144561 "2008-08-01T00:59:57Z")

</div>

Just wanted to drop a quick note to the list thanking everybody who gave me ideas for the JRuby presentation I gave at AOL recently. It went very well, and it was impressive to see how many people had no idea what JRu…

---

## [Patch to find\_executable](https://www.ruby-forum.com/t/patch-to-find-executable/142617)

<div class="topic-metadata">

**Author:** [@Sanghyeon\_S](https://www.ruby-forum.com/u/Sanghyeon_S)\
**Replies:** 1\
**Last updated:** [August 1, 2008, 12:16am UTC](https://www.ruby-forum.com/t/patch-to-find-executable/142617 "2008-08-01T00:16:05Z")

</div>

IronRuby’s Rakefile and context.rb calls UserEnvironment.find\_executable ‘ruby.exe’, which is hopelessly wrong. (No ‘ruby.exe’ on Linux, etc.) I wrote a patch to correct this. http://sparcs.kaist.ac.kr/~tinuviel/dow…

---

## [Needing help with which to\_s gets called](https://www.ruby-forum.com/t/needing-help-with-which-to-s-gets-called/144661)

<div class="topic-metadata">

**Author:** [@princenamor](https://www.ruby-forum.com/u/princenamor)\
**Replies:** 7\
**Last updated:** [July 31, 2008, 11:18pm UTC](https://www.ruby-forum.com/t/needing-help-with-which-to-s-gets-called/144661 "2008-07-31T23:18:31Z")

</div>

I’m a beginner learning Ruby and I’ve hit something which I can’t find an explanation for in my text books. If I run the following code: class Able \< Array def initialize(contents) @contents = Array.new(contents) en…

---

## [Can we print parse tree of a ruby program?](https://www.ruby-forum.com/t/can-we-print-parse-tree-of-a-ruby-program/144653)

<div class="topic-metadata">

**Author:** [@Amitraj\_singh\_C](https://www.ruby-forum.com/u/Amitraj_singh_C)\
**Replies:** 1\
**Last updated:** [July 31, 2008, 9:13pm UTC](https://www.ruby-forum.com/t/can-we-print-parse-tree-of-a-ruby-program/144653 "2008-07-31T21:13:54Z")

</div>

If yes then how?

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

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