# Ruby

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

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

---

## [XML2RB - Executing XML](https://www.ruby-forum.com/t/xml2rb-executing-xml/99356)

<div class="topic-metadata">

**Author:** [@erikveen](https://www.ruby-forum.com/u/erikveen)\
**Replies:** 10\
**Last updated:** [July 22, 2006, 9:47pm UTC](https://www.ruby-forum.com/t/xml2rb-executing-xml/99356 "2006-07-22T21:47:21Z")

</div>

ENGLISH VERSION http://www.erikveen.dds.nl/xml2rb/index.html XML VERSION This week, I had to track down a bug in a set of ANT scripts. It took me hours. I simply couldn’t build a mental pictur…

---

## [Im a newb so please help!](https://www.ruby-forum.com/t/im-a-newb-so-please-help/99437)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 4\
**Last updated:** [July 22, 2006, 7:43pm UTC](https://www.ruby-forum.com/t/im-a-newb-so-please-help/99437 "2006-07-22T19:43:29Z")

</div>

Okay so i just got a book call ‘Learn to Program’ by Chris P… He suggests using Ruby Interpreter to run any programs i make. So the first program he explains to make is a number one. I use SciTE text editor and i wrot…

---

## [Class declaration syntax error](https://www.ruby-forum.com/t/class-declaration-syntax-error/99433)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 3\
**Last updated:** [July 22, 2006, 6:59pm UTC](https://www.ruby-forum.com/t/class-declaration-syntax-error/99433 "2006-07-22T18:59:01Z")

</div>

Class SymbolObject def initialize(symb) @symbol=symb @name=@exchange=@news=@summary=@sector=@industry=@category="" end end I am not sure what is wrong. i get a syntax error.

---

## [Re: Showing part of an array](https://www.ruby-forum.com/t/re-showing-part-of-an-array/99432)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [July 22, 2006, 6:39pm UTC](https://www.ruby-forum.com/t/re-showing-part-of-an-array/99432 "2006-07-22T18:39:13Z")

</div>

Rosina, I’ll explain this line: colors\[0…2\].collect{ |color| color.name }.join(’, ') for an Array colors , say colors=\[‘red’,‘green’,‘yellow’\], you can choose the first three entries by colors\[0…2\], then you map th…

---

## [H- Undefined Method?](https://www.ruby-forum.com/t/h-undefined-method/99423)

<div class="topic-metadata">

**Author:** [@ben-v](https://www.ruby-forum.com/u/ben-v)\
**Replies:** 5\
**Last updated:** [July 22, 2006, 6:17pm UTC](https://www.ruby-forum.com/t/h-undefined-method/99423 "2006-07-22T18:17:00Z")

</div>

I know you can use the method h() to HTMLEdit varible, but ruby doesn’t seem to think it exists when I did this: @a\_user.firstname = h(params\[:firstname\]) It gave me this error: undefined method \`h’ for #JoinControll…

---

## [Newbie Question: delete all non alphanumeric characters](https://www.ruby-forum.com/t/newbie-question-delete-all-non-alphanumeric-characters/99334)

<div class="topic-metadata">

**Author:** [@theallnighter](https://www.ruby-forum.com/u/theallnighter)\
**Replies:** 16\
**Last updated:** [July 22, 2006, 6:16pm UTC](https://www.ruby-forum.com/t/newbie-question-delete-all-non-alphanumeric-characters/99334 "2006-07-22T18:16:50Z")

</div>

Hi all, how can i delete all non alphanumeric characters in a string ? thanks

---

## [Re: Showing part of an array](https://www.ruby-forum.com/t/re-showing-part-of-an-array/99427)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [July 22, 2006, 6:05pm UTC](https://www.ruby-forum.com/t/re-showing-part-of-an-array/99427 "2006-07-22T18:05:31Z")

</div>

You can use this function: class Array def show\_part if self.length\>2 p self\[0…2\].join(’, ‘)+’, …’ else p self.join(’, ') end end end … anbd apply it like this : colors = \[“black”,“white”,“red”,“yellow”,“…

---

## [Predefined variables and constants question](https://www.ruby-forum.com/t/predefined-variables-and-constants-question/99420)

<div class="topic-metadata">

**Author:** [@simonh](https://www.ruby-forum.com/u/simonh)\
**Replies:** 2\
**Last updated:** [July 22, 2006, 4:46pm UTC](https://www.ruby-forum.com/t/predefined-variables-and-constants-question/99420 "2006-07-22T16:46:16Z")

</div>

hi all. pages 333 to 337 in pickaxe2 list a whole load of global variables/constants, execution environment variables, standard objects etc. Is it just me or does this not seem to break with the usually beautifully t…

---

## [Assigning blame?](https://www.ruby-forum.com/t/assigning-blame/99416)

<div class="topic-metadata">

**Author:** [@apocalympse](https://www.ruby-forum.com/u/apocalympse)\
**Replies:** 3\
**Last updated:** [July 22, 2006, 3:35pm UTC](https://www.ruby-forum.com/t/assigning-blame/99416 "2006-07-22T15:35:28Z")

</div>

'allo Say I have two classes: class Bloke attr\_reader :name def sellSoul(aDemon) aDemon.buySoul(self) end end class Demon def buySoul(aBloke) # if aBloke called the method, OK. Else, tell them where to go. put…

---

## [Question about a regular expression](https://www.ruby-forum.com/t/question-about-a-regular-expression/99417)

<div class="topic-metadata">

**Author:** [@diegoami](https://www.ruby-forum.com/u/diegoami)\
**Replies:** 2\
**Last updated:** [July 22, 2006, 3:26pm UTC](https://www.ruby-forum.com/t/question-about-a-regular-expression/99417 "2006-07-22T15:26:09Z")

</div>

Hi fellow ruby-ers I don’t understand this regular expression /\\S+ \</ It is from the ruby quiz “Secret Santas” http://www.rubyquiz.com/quiz2.html What does it exactly mean ? The “\<” confuses me Greetings & Thanks

---

## [Recursion in scripts -- global variables required?](https://www.ruby-forum.com/t/recursion-in-scripts-global-variables-required/99183)

<div class="topic-metadata">

**Author:** [@xmg-eric](https://www.ruby-forum.com/u/xmg-eric)\
**Replies:** 9\
**Last updated:** [July 22, 2006, 3:10pm UTC](https://www.ruby-forum.com/t/recursion-in-scripts-global-variables-required/99183 "2006-07-22T15:10:44Z")

</div>

Is it me, or is it pretty much impossible to write a recursive script in ruby unless you use global variables? I have a simple countdown timer. I set up the number of seconds to sleep, sleep for a while, and then be…

---

## [Re: irb and readline](https://www.ruby-forum.com/t/re-irb-and-readline/99283)

<div class="topic-metadata">

**Author:** [@Torben\_WSSSSlm](https://www.ruby-forum.com/u/Torben_WSSSSlm)\
**Replies:** 3\
**Last updated:** [July 22, 2006, 6:29am UTC](https://www.ruby-forum.com/t/re-irb-and-readline/99283 "2006-07-22T06:29:59Z")

</div>

removed\_email\_address@domain.invalid wrote: Got it. So, is there anyway to shut off history from the windows console? That would probably solve the large-line-bug while still allowing tab completion. I was able …

---

## [Doubts about an example in Poignant Guide](https://www.ruby-forum.com/t/doubts-about-an-example-in-poignant-guide/99322)

<div class="topic-metadata">

**Author:** [@damaris](https://www.ruby-forum.com/u/damaris)\
**Replies:** 2\
**Last updated:** [July 22, 2006, 5:49am UTC](https://www.ruby-forum.com/t/doubts-about-an-example-in-poignant-guide/99322 "2006-07-22T05:49:59Z")

</div>

Hi, I’m reading “Why’s guide to ruby” and I have two doubts about the example of Endertromb, mindreaders, etc. Firstly, He creates the class “MindReader” where he uses “EnderTromb::scan\_for\_sentence”. However, there …

---

## [Re: Mac OSX Ruby Configuration Question](https://www.ruby-forum.com/t/re-mac-osx-ruby-configuration-question/99106)

<div class="topic-metadata">

**Author:** [@daveh](https://www.ruby-forum.com/u/daveh)\
**Replies:** 7\
**Last updated:** [July 22, 2006, 2:21am UTC](https://www.ruby-forum.com/t/re-mac-osx-ruby-configuration-question/99106 "2006-07-22T02:21:21Z")

</div>

On Jul 18, 2006, at 8:33, Ryan R. wrote: Two days ago, I once again had a Ruby program fail because it’s running the wrong Ruby, and I eventually had to give up on this one. My text editing program lets me run text t…

---

## [Rational 1.12](https://www.ruby-forum.com/t/rational-1-12/98678)

<div class="topic-metadata">

**Author:** [@Tadayoshi\_F](https://www.ruby-forum.com/u/Tadayoshi_F)\
**Replies:** 12\
**Last updated:** [July 22, 2006, 2:15am UTC](https://www.ruby-forum.com/t/rational-1-12/98678 "2006-07-22T02:15:20Z")

</div>

e$B$U$J$P$G$9!#e(B e$B86$5$s$Ne(B rational 1.12 e$B$G!"$D$.$N$h$&$K%(%i!\<$K$J$j$^$9!#e(B $ ruby -v -r rational -e ‘p “13.0/4”.to\_r’ ruby 1.8.4 (2005-12-24) \[i386-freebsd5.4\] -e:1:in \`to\_r’: Error of Implementation (r…

---

## [Re: Ruby and XFDF](https://www.ruby-forum.com/t/re-ruby-and-xfdf/99376)

<div class="topic-metadata">

**Author:** [@Frank\_Davis](https://www.ruby-forum.com/u/Frank_Davis)\
**Replies:** 0\
**Last updated:** [July 22, 2006, 1:53am UTC](https://www.ruby-forum.com/t/re-ruby-and-xfdf/99376 "2006-07-22T01:53:52Z")

</div>

This is just a guess, but the first place I’d look would be what command-line arguments Acrobat Reader supports under Linux. There’s a good chance you can pass the name of an xfdf to acrobat this way, so you could jus…

---

## [Ri busted for some core classes](https://www.ruby-forum.com/t/ri-busted-for-some-core-classes/99354)

<div class="topic-metadata">

**Author:** [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Replies:** 4\
**Last updated:** [July 22, 2006, 1:47am UTC](https://www.ruby-forum.com/t/ri-busted-for-some-core-classes/99354 "2006-07-22T01:47:27Z")

</div>

After upgrading to 1.8.4 using one-click, ri isn’t working for some items: C:\\Documents and Settings\\gavin.kistner\>ri Array C:/ruby/lib/ruby/1.8/rdoc/ri/ri\_descriptions.rb:99:in concat': can't convert nil into Array (…

---

## [Beyond threads? Better concurrency methods?](https://www.ruby-forum.com/t/beyond-threads-better-concurrency-methods/99012)

<div class="topic-metadata">

**Author:** [@anmus](https://www.ruby-forum.com/u/anmus)\
**Replies:** 31\
**Last updated:** [July 22, 2006, 12:57am UTC](https://www.ruby-forum.com/t/beyond-threads-better-concurrency-methods/99012 "2006-07-22T00:57:09Z")

</div>

Hi All, The recent IEEE Computer society magazine ‘Computer’ May 2006 has a thought-provoking article on threading and concurrency (p. 33). The author has three points: Threading is an error prone method of paralle…

---

## [Where to get required/recommended dll's on win32](https://www.ruby-forum.com/t/where-to-get-required-recommended-dlls-on-win32/99335)

<div class="topic-metadata">

**Author:** [@simonh](https://www.ruby-forum.com/u/simonh)\
**Replies:** 5\
**Last updated:** [July 21, 2006, 11:32pm UTC](https://www.ruby-forum.com/t/where-to-get-required-recommended-dlls-on-win32/99335 "2006-07-21T23:32:25Z")

</div>

Hi. I’m wanting to try out ruby 1.8.5 preview2 on microsoft windows. Does anyone know of a list of needed/recommended dll’s and other odds and sods needed? I thought of copying the dll’s from the ‘one click installer’…

---

## [Splitting a string separated by CRLF into array](https://www.ruby-forum.com/t/splitting-a-string-separated-by-crlf-into-array/99349)

<div class="topic-metadata">

**Author:** [@dplante](https://www.ruby-forum.com/u/dplante)\
**Replies:** 4\
**Last updated:** [July 21, 2006, 11:16pm UTC](https://www.ruby-forum.com/t/splitting-a-string-separated-by-crlf-into-array/99349 "2006-07-21T23:16:33Z")

</div>

How can I get the array \[“hello”, “world”, “123”\] from the string “hello\\r\\nworld\\r\\n123” Thanks! Dominique

---

## [Contine after exception](https://www.ruby-forum.com/t/contine-after-exception/99350)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [July 21, 2006, 10:37pm UTC](https://www.ruby-forum.com/t/contine-after-exception/99350 "2006-07-21T22:37:45Z")

</div>

How do i continue a loop after a exception? It actually captures the exception . How do i get the exception handler to start executing from 4 to call the printstuff function? def printStuff(inpu) ## just print stuff …

---

## [Re: Ruby and XFDF](https://www.ruby-forum.com/t/re-ruby-and-xfdf/99328)

<div class="topic-metadata">

**Author:** [@Frank\_Davis](https://www.ruby-forum.com/u/Frank_Davis)\
**Replies:** 1\
**Last updated:** [July 21, 2006, 10:20pm UTC](https://www.ruby-forum.com/t/re-ruby-and-xfdf/99328 "2006-07-21T22:20:31Z")

</div>

I’m doing the same thing in a C# application. The technique I use should work fine in Ruby also. The XFDF files are pure XML, so I use an XML builder to generate the XFDF file. Under Windows, I can also take advantage…

---

## [YAML object to oracle blob](https://www.ruby-forum.com/t/yaml-object-to-oracle-blob/99326)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [July 21, 2006, 8:42pm UTC](https://www.ruby-forum.com/t/yaml-object-to-oracle-blob/99326 "2006-07-21T20:42:35Z")

</div>

We would like to save a YAML object in an oracle blob and then read it back . HAs anyone doe something similar ? Thanks Bryan Webb

---

## [Looking a a RESTfull Ruby application example](https://www.ruby-forum.com/t/looking-a-a-restfull-ruby-application-example/99276)

<div class="topic-metadata">

**Author:** [@Zouplaz](https://www.ruby-forum.com/u/Zouplaz)\
**Replies:** 1\
**Last updated:** [July 21, 2006, 8:22pm UTC](https://www.ruby-forum.com/t/looking-a-a-restfull-ruby-application-example/99276 "2006-07-21T20:22:12Z")

</div>

Hello, I’ve read several articles about going RESTfull but I’m still having problems do understand clearly what’s going on. So, now I need a small (but complete) source code example of how a RESTfull is built. Does s…

---

## [Cache Decorator](https://www.ruby-forum.com/t/cache-decorator/99298)

<div class="topic-metadata">

**Author:** [@Jake\_McArthur](https://www.ruby-forum.com/u/Jake_McArthur)\
**Replies:** 3\
**Last updated:** [July 21, 2006, 7:50pm UTC](https://www.ruby-forum.com/t/cache-decorator/99298 "2006-07-21T19:50:36Z")

</div>

This isn’t really anything that hasn’t been done before, but I have yet to see some public Ruby code that provides a nice, easy way to cache the results of methods with this much flexibility and convenience. Simply wr…

---

## [Replacing ' with \\' using gsub](https://www.ruby-forum.com/t/replacing-with-using-gsub/99325)

<div class="topic-metadata">

**Author:** [@soila](https://www.ruby-forum.com/u/soila)\
**Replies:** 6\
**Last updated:** [July 21, 2006, 7:40pm UTC](https://www.ruby-forum.com/t/replacing-with-using-gsub/99325 "2006-07-21T19:40:39Z")

</div>

I tried to replace “’” characters with “’” strings using gsub. What happened instead was something completely different. Am I missing something here? (in irb) irb(main):001:0\> s = “a’b’” =\> “a’b’” Unexpected result …

---

## [What's wrong with this code?](https://www.ruby-forum.com/t/whats-wrong-with-this-code/99297)

<div class="topic-metadata">

**Author:** [@hreyaatnh](https://www.ruby-forum.com/u/hreyaatnh)\
**Replies:** 1\
**Last updated:** [July 21, 2006, 7:40pm UTC](https://www.ruby-forum.com/t/whats-wrong-with-this-code/99297 "2006-07-21T19:40:28Z")

</div>

I’m trying to interface with the flickr API to pull my photos into my site. I don’t want to use the “flickr.rb” gem, I’d like to do it the other way so I can learn (plus I had trouble loading the gem on my server). …

---

## [Class\_extension and module\_extension](https://www.ruby-forum.com/t/class-extension-and-module-extension/99303)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [July 21, 2006, 7:00pm UTC](https://www.ruby-forum.com/t/class-extension-and-module-extension/99303 "2006-07-21T19:00:49Z")

</div>

Just a quick comment about class\_extension. In using I’ve come across cases where I want the extension to propogate through further inclusions and cases where I do not. So I think we new two versions, one for each. Pe…

---

## [Re: Rdoc with hyperlinks](https://www.ruby-forum.com/t/re-rdoc-with-hyperlinks/98921)

<div class="topic-metadata">

**Author:** [@daveh](https://www.ruby-forum.com/u/daveh)\
**Replies:** 8\
**Last updated:** [July 21, 2006, 6:54pm UTC](https://www.ruby-forum.com/t/re-rdoc-with-hyperlinks/98921 "2006-07-21T18:54:29Z")

</div>

On Jul 18, 2006, at 8:05, removed\_email\_address@domain.invalid wrote: Ken B. wrote: In general, you should not rely on knowledge of the source code to understand how a library works, because the library writer reserve…

---

## [Definition of methods: self](https://www.ruby-forum.com/t/definition-of-methods-self/102965)

<div class="topic-metadata">

**Author:** [@damaris](https://www.ruby-forum.com/u/damaris)\
**Replies:** 7\
**Last updated:** [July 21, 2006, 6:42pm UTC](https://www.ruby-forum.com/t/definition-of-methods-self/102965 "2006-07-21T18:42:32Z")

</div>

In Why’s poignant guide to Ruby some examples appear where he defines a class “class LotteryTicket”, and then he defines a method “def self.new\_random”, or “def LotteryDraw.buy(…)”; that is, before the name of the met…

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

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