# Ruby

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

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

---

## ["require" with many files](https://www.ruby-forum.com/t/require-with-many-files/136142)

<div class="topic-metadata">

**Author:** [@ISSSSaki\_Baz\_C](https://www.ruby-forum.com/u/ISSSSaki_Baz_C)\
**Replies:** 6\
**Last updated:** [May 3, 2008, 5:37pm UTC](https://www.ruby-forum.com/t/require-with-many-files/136142 "2008-05-03T17:37:26Z")

</div>

Hi, is there any preferred way to load/require all the fiels in a directory? For example, my main file does: require “header.rb” and file “header.rb” must load all the related files contained in “headers/” directory…

---

## [N00b string replace](https://www.ruby-forum.com/t/n00b-string-replace/136288)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 2\
**Last updated:** [May 3, 2008, 5:36pm UTC](https://www.ruby-forum.com/t/n00b-string-replace/136288 "2008-05-03T17:36:15Z")

</div>

Hi I’m triying to substitute any ocurrences of ’ in a string by ’ Here’s a bit of testing I made in irb which wtf’s me: irb(main):002:0\> st = “un ’ monton ’ de ’ apostrofes '” =\> “un ’ monton ’ de ’ apostrofes '” irb…

---

## [1 & 1.0](https://www.ruby-forum.com/t/1-1-0/136557)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 0\
**Last updated:** [May 3, 2008, 5:35pm UTC](https://www.ruby-forum.com/t/1-1-0/136557 "2008-05-03T17:35:40Z")

</div>

e$B0J2\<$N$h$&$K@0?t$HIbF0\>.?tE@$N%S%C%HO@M}1i;;$,2DG=$J$N$O0U?^e(B e$B$5$l$?$3$H$J$s$G$7$g$&$+e(B? % ./ruby -ve ‘p 1 & 1.0’ ruby 1.9.0 (2008-05-02 revision 16277) \[i686-linux\] 1 e$B:81&$r5U$K$9$k$H%(%i!\<$K$J$j$^$9!#…

---

## [Exception inconsistency of Fixnum#quo and Bignum#quo](https://www.ruby-forum.com/t/exception-inconsistency-of-fixnum-quo-and-bignum-quo/136552)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 0\
**Last updated:** [May 3, 2008, 4:12pm UTC](https://www.ruby-forum.com/t/exception-inconsistency-of-fixnum-quo-and-bignum-quo/136552 "2008-05-03T16:12:45Z")

</div>

Fixnum#quo e$B$He(B Bignum#quo e$B$Ke(B nil e$B$rEO$7$?;~!"H/@8$9$kNc30$,0\[e(B e$B$J$j$^$9!#e(B % ./ruby -ve ‘p 0x3fffffff.quo(nil)’ ruby 1.9.0 (2008-05-02 revision 16277) \[i686-linux\] -e:1:in /': nil can't be coerc…

---

## [Jruby 1.1.1 and oracle thin client](https://www.ruby-forum.com/t/jruby-1-1-1-and-oracle-thin-client/136208)

<div class="topic-metadata">

**Author:** [@nfe](https://www.ruby-forum.com/u/nfe)\
**Replies:** 1\
**Last updated:** [May 3, 2008, 3:45pm UTC](https://www.ruby-forum.com/t/jruby-1-1-1-and-oracle-thin-client/136208 "2008-05-03T15:45:14Z")

</div>

Hi, I have done the following: installed JRuby 1.1.1 (added the JAVA\_HOME variable to the PATH) installed the Oracle 8 Thin client files (and added the appropriate location to the PATH system variable) installed the …

---

## [How to access to an Array element without doing "find" each time](https://www.ruby-forum.com/t/how-to-access-to-an-array-element-without-doing-find-each-time/136519)

<div class="topic-metadata">

**Author:** [@ISSSSaki\_Baz\_C](https://www.ruby-forum.com/u/ISSSSaki_Baz_C)\
**Replies:** 5\
**Last updated:** [May 3, 2008, 2:59pm UTC](https://www.ruby-forum.com/t/how-to-access-to-an-array-element-without-doing-find-each-time/136519 "2008-05-03T14:59:30Z")

</div>

Hi, I’ve an Array containing complex objects of Header class: class Header #attributes: - @name - @original\_value - @parsed\_value … end class Message #attributes: - @first\_line - @headers = \[header\_1, header\_2…

---

## [Accessing Windows actions(Shutdow.Restart)](https://www.ruby-forum.com/t/accessing-windows-actions-shutdow-restart/135324)

<div class="topic-metadata">

**Author:** [@jazzezravi](https://www.ruby-forum.com/u/jazzezravi)\
**Replies:** 13\
**Last updated:** [May 3, 2008, 2:18pm UTC](https://www.ruby-forum.com/t/accessing-windows-actions-shutdow-restart/135324 "2008-05-03T14:18:33Z")

</div>

Hi All, I want to access the windows functionalities such as Shut down, Restart, Log off etc… Please guide to me… Because i tried win32OLE, Watir and few gems… But still there is no improvement to access those thing…

---

## [Regarding MS Office properties](https://www.ruby-forum.com/t/regarding-ms-office-properties/136547)

<div class="topic-metadata">

**Author:** [@pranjal\_jain](https://www.ruby-forum.com/u/pranjal_jain)\
**Replies:** 0\
**Last updated:** [May 3, 2008, 1:18pm UTC](https://www.ruby-forum.com/t/regarding-ms-office-properties/136547 "2008-05-03T13:18:13Z")

</div>

Hi all If we want to open the outlook & write in it , we use the command outlook = WIN32OLE.new(‘Outlook.Application’). message = outlook.CreateItem(0) message.Subject = ‘Double-Header Today’ message.Body = ‘This is…

---

## [Uniq with subclass of Array](https://www.ruby-forum.com/t/uniq-with-subclass-of-array/136545)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 0\
**Last updated:** [May 3, 2008, 12:53pm UTC](https://www.ruby-forum.com/t/uniq-with-subclass-of-array/136545 "2008-05-03T12:53:50Z")

</div>

e$B0J2\<$N$h$&$K!"e(BArray e$B$N%5%V%/%i%9$Ke(B uniq e$B$r8F$S=P$9$H!"e(BArray e$B$N%$%s%9%?%s%9$,JV$C$F$-$^$9!#e(B % ./ruby -ve ‘class A \< Array; end; p A\[1,2\].uniq.class’ ruby 1.9.0 (2008-05-02 revision 16277) \[i686…

---

## [Is there some way to execute a block within an arbitrary lexical scope?](https://www.ruby-forum.com/t/is-there-some-way-to-execute-a-block-within-an-arbitrary-lexical-scope/136413)

<div class="topic-metadata">

**Author:** [@rubytuesday](https://www.ruby-forum.com/u/rubytuesday)\
**Replies:** 9\
**Last updated:** [May 3, 2008, 11:01am UTC](https://www.ruby-forum.com/t/is-there-some-way-to-execute-a-block-within-an-arbitrary-lexical-scope/136413 "2008-05-03T11:01:11Z")

</div>

Is there some way to execute a block within a certain lexical scope? Let’s say the scope I want is inside B: module A class B # … wanna get in here end end And I wanted something like: method\_returning\_B\_in\_lexic…

---

## [Workings of the freaky freaky sandbox](https://www.ruby-forum.com/t/workings-of-the-freaky-freaky-sandbox/136542)

<div class="topic-metadata">

**Author:** [@Nick\_Grandy](https://www.ruby-forum.com/u/Nick_Grandy)\
**Replies:** 0\
**Last updated:** [May 3, 2008, 10:40am UTC](https://www.ruby-forum.com/t/workings-of-the-freaky-freaky-sandbox/136542 "2008-05-03T10:40:04Z")

</div>

hi all, a couple questions directed towards a greater understanding of the workings of the freaky freaky sandbox (http://code.whytheluckystiff.net/sandbox/), which i hope might be addressed by \_why or others familiar…

---

## [Puts recursive array](https://www.ruby-forum.com/t/puts-recursive-array/136540)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 0\
**Last updated:** [May 3, 2008, 10:24am UTC](https://www.ruby-forum.com/t/puts-recursive-array/136540 "2008-05-03T10:24:14Z")

</div>

x = \[0,1,2,3,4,5\]; x \<\< x e$B$H$7$F:n$C$?:F5"E\*$JG\[Ns$re(B puts e$B$9e(B e$B$k$He(B \[…\] e$B$,$$$/$D$b=P$F$-$^$9!#e(B % ./ruby -ve ‘x = \[0,1,2,3,4,5\]; x \<\< x; puts x’ ruby 1.9.0 (2008-05-02 revision 16276) \[i686-linux\] …

---

## [HTTPClient download binary file](https://www.ruby-forum.com/t/httpclient-download-binary-file/136511)

<div class="topic-metadata">

**Author:** [@deadinplastic](https://www.ruby-forum.com/u/deadinplastic)\
**Replies:** 2\
**Last updated:** [May 3, 2008, 3:19am UTC](https://www.ruby-forum.com/t/httpclient-download-binary-file/136511 "2008-05-03T03:19:56Z")

</div>

Hi, I’m writing a simple program which downloads a resource from the internet. When I save a file to disk, it always ends up a few bytes larger than it should be and is thus recognized as a damaged file. The code I’m…

---

## [Extracting a value from an array](https://www.ruby-forum.com/t/extracting-a-value-from-an-array/136461)

<div class="topic-metadata">

**Author:** [@alby](https://www.ruby-forum.com/u/alby)\
**Replies:** 17\
**Last updated:** [May 3, 2008, 3:06am UTC](https://www.ruby-forum.com/t/extracting-a-value-from-an-array/136461 "2008-05-03T03:06:06Z")

</div>

I have the following array: headers = \[ { :name =\> ‘user-agent’, :value =\> ‘blah blah’ }, { :name =\>‘content-type’, :value =\> ‘text/html’ }, { :name =\> ‘pragma’, :value =\> ‘no-cache’ }, { :name =\>‘content-length’, :…

---

## [Issue running watir on 64 bit winxp](https://www.ruby-forum.com/t/issue-running-watir-on-64-bit-winxp/134739)

<div class="topic-metadata">

**Author:** [@jdrietz](https://www.ruby-forum.com/u/jdrietz)\
**Replies:** 3\
**Last updated:** [May 3, 2008, 12:40am UTC](https://www.ruby-forum.com/t/issue-running-watir-on-64-bit-winxp/134739 "2008-05-03T00:40:58Z")

</div>

I am having an issue running watir test scripts on 64 bit winxp that were previously working on 32 bit winxp (both envs 32 bit using IE7). Whenever the test script is run, it returns this error: ruby Test.rb (eval):…

---

## [How to search words starting with a particular char?](https://www.ruby-forum.com/t/how-to-search-words-starting-with-a-particular-char/136498)

<div class="topic-metadata">

**Author:** [@toki](https://www.ruby-forum.com/u/toki)\
**Replies:** 2\
**Last updated:** [May 2, 2008, 11:54pm UTC](https://www.ruby-forum.com/t/how-to-search-words-starting-with-a-particular-char/136498 "2008-05-02T23:54:06Z")

</div>

Hi to all! I need to search how many words are starting with a specific character in a text file, no problem to read the file, but after that I split it in words, how can I search all occurencies that’s matching my c…

---

## [Strip method](https://www.ruby-forum.com/t/strip-method/136440)

<div class="topic-metadata">

**Author:** [@masiarek](https://www.ruby-forum.com/u/masiarek)\
**Replies:** 5\
**Last updated:** [May 2, 2008, 9:23pm UTC](https://www.ruby-forum.com/t/strip-method/136440 "2008-05-02T21:23:46Z")

</div>

s = \<\<EOS a1\\t b1 a2\\tb2 EOS s.each{|e| a = e.strip.split("\\t") p a\[1\] } output: " b1" “b2” expected output: “b1” “b2” What is wrong?

---

## [FW: Code Review: ExplicitRuby](https://www.ruby-forum.com/t/fw-code-review-explicitruby/196664)

<div class="topic-metadata">

**Author:** [@John\_LSSIRONRUBY](https://www.ruby-forum.com/u/John_LSSIRONRUBY)\
**Replies:** 0\
**Last updated:** [May 2, 2008, 8:42pm UTC](https://www.ruby-forum.com/t/fw-code-review-explicitruby/196664 "2008-05-02T20:42:02Z")

</div>

Martin isn’t on the mailing list … Thanks, -John

---

## [Many attributes, same behavior](https://www.ruby-forum.com/t/many-attributes-same-behavior/136503)

<div class="topic-metadata">

**Author:** [@pozza](https://www.ruby-forum.com/u/pozza)\
**Replies:** 1\
**Last updated:** [May 2, 2008, 8:40pm UTC](https://www.ruby-forum.com/t/many-attributes-same-behavior/136503 "2008-05-02T20:40:50Z")

</div>

I have a growing list of readable attributes that all essentially do the same thing – read the requested value from a file. Likewise, the writable attributes write the associated value to the file. For the readable at…

---

## [Code Review: bugfixes9](https://www.ruby-forum.com/t/code-review-bugfixes9/136506)

<div class="topic-metadata">

**Author:** [@John\_LSSIRONRUBY](https://www.ruby-forum.com/u/John_LSSIRONRUBY)\
**Replies:** 0\
**Last updated:** [May 2, 2008, 8:40pm UTC](https://www.ruby-forum.com/t/code-review-bugfixes9/136506 "2008-05-02T20:40:49Z")

</div>

tfpt review /shelveset:bugfixes9;REDMOND\\jflam Ruby only bug fixes: Passes all local tests. #19804: Inheriting from Numeric added a default ctor #19806: Wrong number or type of arguments for Regexp added overload…

---

## [FW: Code Review: ConstraintsRuby](https://www.ruby-forum.com/t/fw-code-review-constraintsruby/136504)

<div class="topic-metadata">

**Author:** [@John\_LSSIRONRUBY](https://www.ruby-forum.com/u/John_LSSIRONRUBY)\
**Replies:** 0\
**Last updated:** [May 2, 2008, 8:27pm UTC](https://www.ruby-forum.com/t/fw-code-review-constraintsruby/136504 "2008-05-02T20:27:10Z")

</div>

Martin isn’t on the mailing list … Thanks, -John

---

## [Please explain nuances of ||=](https://www.ruby-forum.com/t/please-explain-nuances-of/136398)

<div class="topic-metadata">

**Author:** [@rubyfreak](https://www.ruby-forum.com/u/rubyfreak)\
**Replies:** 27\
**Last updated:** [May 2, 2008, 8:06pm UTC](https://www.ruby-forum.com/t/please-explain-nuances-of/136398 "2008-05-02T20:06:27Z")

</div>

I am reading some of the ruby files in rails and I an seeing the ||= method used a lot. knowing ruby the way I do, I realize that she has lots of magical surprises and I really want to get to know this girl! Consider…

---

## [Dbm::version](https://www.ruby-forum.com/t/dbm-version/136441)

<div class="topic-metadata">

**Author:** [@okkez](https://www.ruby-forum.com/u/okkez)\
**Replies:** 2\
**Last updated:** [May 2, 2008, 5:52pm UTC](https://www.ruby-forum.com/t/dbm-version/136441 "2008-05-02T17:52:08Z")

</div>

okkez e$B$G$9!#e(B DBM::VERSION e$B$H$$$&Dj?t$NDj5A$,$\*$+$7$$$h$&$J5$$,$7$^$9!#e(B 1.8.7 e$B$G$be(B 1.9.0 e$B$HF1$8$h$&$K$9$k$N$,NI$$$H;W$&$N$G$9$,$$$+$,$G$7$g$&$+!)e(B e$B$b$&\<jCY$l$G$7$g$&$+!)e(B 1.8.0-1.8.7 e$B$G$…

---

## [Uninitialized \_tag.retval value is used](https://www.ruby-forum.com/t/uninitialized-tag-retval-value-is-used/136489)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 0\
**Last updated:** [May 2, 2008, 5:16pm UTC](https://www.ruby-forum.com/t/uninitialized-tag-retval-value-is-used/136489 "2008-05-02T17:16:04Z")

</div>

e$B5$$,$D$$$?$N$G$9$,!"e(B\_tag.retval e$B$r=i4|2=$7$J$$$G;H$&$3$H$,$"e(B e$B$k$h$&$G$9!#e(B e$B0J2\<$N$h$&$Ke(B TH\_PUSH\_TAG(th); e$B$ND\>8e$G!"$^$@e(B \_tag e$B$,=i4|2=$5e(B e$B$l$F$$i$:!"$I$s$JCM$G$b$$+$7$/$J$$\>uBV$G!"…

---

## [Searching for latin/umlaut characters in string](https://www.ruby-forum.com/t/searching-for-latin-umlaut-characters-in-string/136420)

<div class="topic-metadata">

**Author:** [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Replies:** 8\
**Last updated:** [May 2, 2008, 4:49pm UTC](https://www.ruby-forum.com/t/searching-for-latin-umlaut-characters-in-string/136420 "2008-05-02T16:49:36Z")

</div>

Hi, Ive read up a bit about uicode strings and the issues with rails after i tried to save some data which contained an umlaut character. I got the following error below when searching for a name that contained the …

---

## [| versus || Any reason for this issue?](https://www.ruby-forum.com/t/versus-any-reason-for-this-issue/136485)

<div class="topic-metadata">

**Author:** [@ISSSSaki\_Baz\_C](https://www.ruby-forum.com/u/ISSSSaki_Baz_C)\
**Replies:** 5\
**Last updated:** [May 2, 2008, 4:21pm UTC](https://www.ruby-forum.com/t/versus-any-reason-for-this-issue/136485 "2008-05-02T16:21:11Z")

</div>

Hi, why in the second case the non declared “my\_var” variable is processed but not in the first case? irb\> nil || 2 || my\_var =\> 2 irb\> nil | 2 | my\_var NameError: undefined local variable or method \`my\_var’ Of cou…

---

## [\[ANN\] Rassmalog 11.0.0](https://www.ruby-forum.com/t/ann-rassmalog-11-0-0/136455)

<div class="topic-metadata">

**Author:** [@snk](https://www.ruby-forum.com/u/snk)\
**Replies:** 1\
**Last updated:** [May 2, 2008, 4:08pm UTC](https://www.ruby-forum.com/t/ann-rassmalog-11-0-0/136455 "2008-05-02T16:08:28Z")

</div>

Rassmalog 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 …

---

## [Beginner Question on Ruby](https://www.ruby-forum.com/t/beginner-question-on-ruby/136474)

<div class="topic-metadata">

**Author:** [@arunvoip](https://www.ruby-forum.com/u/arunvoip)\
**Replies:** 4\
**Last updated:** [May 2, 2008, 2:28pm UTC](https://www.ruby-forum.com/t/beginner-question-on-ruby/136474 "2008-05-02T14:28:39Z")

</div>

Hi all, I am beginning to learn ruby and cant seem to reason this behaviour. I expect since empty or nill is the array, arr\*n shouldnt change it. Why is this behaviour so? Code: num\_arr = Array.new puts “Num Alpha:…

---

## [Adapter: JDBC Oracle](https://www.ruby-forum.com/t/adapter-jdbc-oracle/197079)

<div class="topic-metadata">

**Author:** [@lgas](https://www.ruby-forum.com/u/lgas)\
**Replies:** 0\
**Last updated:** [May 2, 2008, 1:34pm UTC](https://www.ruby-forum.com/t/adapter-jdbc-oracle/197079 "2008-05-02T13:34:11Z")

</div>

Hi, Iâ€™m trying to migrate the AR script on to Oracle database. Im using jdbc adapter. There are number of functions defined in jdbc\_oracle.rb, but when I call them (eg: rename\_column(â€¦)) in my AR script, it says …

---

## [DSL - class-level methods that affect instances](https://www.ruby-forum.com/t/dsl-class-level-methods-that-affect-instances/136432)

<div class="topic-metadata">

**Author:** [@dewie](https://www.ruby-forum.com/u/dewie)\
**Replies:** 8\
**Last updated:** [May 2, 2008, 12:25pm UTC](https://www.ruby-forum.com/t/dsl-class-level-methods-that-affect-instances/136432 "2008-05-02T12:25:39Z")

</div>

I’m having a problem of design. I’ve tried a few configurations of class collaboration and responsibility, but they all end up feeling messy. I’m looking at these (either or, my original attempt was with a module, but…

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

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