# Ruby

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

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

---

## [Discrepancy in operation of File.exist](https://www.ruby-forum.com/t/discrepancy-in-operation-of-file-exist/134805)

<div class="topic-metadata">

**Author:** [@rjberry](https://www.ruby-forum.com/u/rjberry)\
**Replies:** 0\
**Last updated:** [April 15, 2008, 10:16am UTC](https://www.ruby-forum.com/t/discrepancy-in-operation-of-file-exist/134805 "2008-04-15T10:16:18Z")

</div>

Consider simple file.rb: puts File.exist?("C:/work/napa.net/gui/bin/script") There exists directory C:/work/napa.net/gui/bin/script With C-ruby: \[11:11:29 ~/irb\_test\] ruby file.rb true With IronRuby: \[11:11:35 ~/i…

---

## [Discrepancy in operation of File.exist?](https://www.ruby-forum.com/t/discrepancy-in-operation-of-file-exist/134803)

<div class="topic-metadata">

**Author:** [@rjberry](https://www.ruby-forum.com/u/rjberry)\
**Replies:** 0\
**Last updated:** [April 15, 2008, 10:15am UTC](https://www.ruby-forum.com/t/discrepancy-in-operation-of-file-exist/134803 "2008-04-15T10:15:07Z")

</div>

Consider simple file.rb: puts File.exist?("C:/work/napa.net/gui/bin/script") There exists directory C:/work/napa.net/gui/bin/script

---

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

<div class="topic-metadata">

**Author:** [@mike-moscow](https://www.ruby-forum.com/u/mike-moscow)\
**Replies:** 0\
**Last updated:** [April 15, 2008, 10:04am UTC](https://www.ruby-forum.com/t/mms2r-2-0-3-released/134802 "2008-04-15T10:04:33Z")

</div>

mms2r version 2.0.3 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…

---

## [My Longsword is broken](https://www.ruby-forum.com/t/my-longsword-is-broken/134748)

<div class="topic-metadata">

**Author:** [@gastrogreen](https://www.ruby-forum.com/u/gastrogreen)\
**Replies:** 7\
**Last updated:** [April 15, 2008, 8:26am UTC](https://www.ruby-forum.com/t/my-longsword-is-broken/134748 "2008-04-15T08:26:48Z")

</div>

Hello all, Just started my first Ruby prog and hit a snag almost instantly. I simply wish to have my selected weapon do it’s prescribed damage as I intend (in this case, it’s 1-8 damage). Complete noob here so any hel…

---

## [Mysql gem on Mac OSX 10.4](https://www.ruby-forum.com/t/mysql-gem-on-mac-osx-10-4/134664)

<div class="topic-metadata">

**Author:** [@lukasmosser](https://www.ruby-forum.com/u/lukasmosser)\
**Replies:** 1\
**Last updated:** [April 15, 2008, 7:19am UTC](https://www.ruby-forum.com/t/mysql-gem-on-mac-osx-10-4/134664 "2008-04-15T07:19:10Z")

</div>

Ok so I just installed ruby and rails and everything everything would work also got a test server working. I already have mysql installed on my Mac (it’s a macbook pro) now when I either try to configure my ruby (I do…

---

## [Found errors in The Ruby Programming Language book?](https://www.ruby-forum.com/t/found-errors-in-the-ruby-programming-language-book/134117)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [April 15, 2008, 6:40am UTC](https://www.ruby-forum.com/t/found-errors-in-the-ruby-programming-language-book/134117 "2008-04-15T06:40:47Z")

</div>

O’Reilly is going to be reprinting The Ruby P.ming Language next week, and are allowing me to fix errors in the book this week. If you’ve found typos, errors, omissions, etc., in the book, please let me know about the…

---

## [This Week in Ruby (April 14, 2008)](https://www.ruby-forum.com/t/this-week-in-ruby-april-14-2008/134707)

<div class="topic-metadata">

**Author:** [@visitor1981](https://www.ruby-forum.com/u/visitor1981)\
**Replies:** 1\
**Last updated:** [April 15, 2008, 6:06am UTC](https://www.ruby-forum.com/t/this-week-in-ruby-april-14-2008/134707 "2008-04-15T06:06:54Z")

</div>

Hi all, here you can find the new edition of “This Week in Ruby”: Cheers, Antonio

---

## [Surprise in sub](https://www.ruby-forum.com/t/surprise-in-sub/134525)

<div class="topic-metadata">

**Author:** [@matt\_neuburg](https://www.ruby-forum.com/u/matt_neuburg)\
**Replies:** 8\
**Last updated:** [April 15, 2008, 5:10am UTC](https://www.ruby-forum.com/t/surprise-in-sub/134525 "2008-04-15T05:10:48Z")

</div>

irb(main):001:0\> s = “\\\\” =\> “\\\\” irb(main):002:0\> s.length =\> 2 irb(main):003:0\> s = “howdy”.sub(“howdy”, s) =\> “\\” irb(main):004:0\> s.length =\> 1 So merely using a string as the second param of sub (the replace…

---

## [How to execute a method every few seconds](https://www.ruby-forum.com/t/how-to-execute-a-method-every-few-seconds/134706)

<div class="topic-metadata">

**Author:** [@zoephoenix](https://www.ruby-forum.com/u/zoephoenix)\
**Replies:** 4\
**Last updated:** [April 15, 2008, 4:35am UTC](https://www.ruby-forum.com/t/how-to-execute-a-method-every-few-seconds/134706 "2008-04-15T04:35:44Z")

</div>

I’m playing around with making a small test game with what little Ruby code I’ve learned so far and I feel like I’m doing good for only having been learning the past couple of weeks or so. I’ve mostly been figuring t…

---

## [Basics to test Unit](https://www.ruby-forum.com/t/basics-to-test-unit/134656)

<div class="topic-metadata">

**Author:** [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Replies:** 2\
**Last updated:** [April 15, 2008, 2:41am UTC](https://www.ruby-forum.com/t/basics-to-test-unit/134656 "2008-04-15T02:41:06Z")

</div>

=begin Can the Test unit be used to test methods or variables in other files? I’ve come across this reference, (http://clarkware.com/cgi/blosxom/2005/03/18), which seems to test snipets of code within the test itsel…

---

## [Image\_tag mouseover](https://www.ruby-forum.com/t/image-tag-mouseover/134619)

<div class="topic-metadata">

**Author:** [@monica](https://www.ruby-forum.com/u/monica)\
**Replies:** 3\
**Last updated:** [April 15, 2008, 12:38am UTC](https://www.ruby-forum.com/t/image-tag-mouseover/134619 "2008-04-15T00:38:15Z")

</div>

Hi there, Does anyone know if there is a bug on ‘mouseover’ for ‘image\_tag’? If I do that: \<%= image\_tag(“inicio.png”, :mouseover =\> “/images/inicio2.png”) %\> I get this html: Has anyone got that working, or know …

---

## [Dynamically referring to a Class](https://www.ruby-forum.com/t/dynamically-referring-to-a-class/134727)

<div class="topic-metadata">

**Author:** [@gaudimila](https://www.ruby-forum.com/u/gaudimila)\
**Replies:** 9\
**Last updated:** [April 15, 2008, 12:26am UTC](https://www.ruby-forum.com/t/dynamically-referring-to-a-class/134727 "2008-04-15T00:26:32Z")

</div>

I have several classes in my application, e.g. Person, Employer, Office. And obviously I have some Class methods for each, e.g. Person.find. At one point in my application I will be referencing the Class name dynamica…

---

## [Storing arrays in db + model architecture](https://www.ruby-forum.com/t/storing-arrays-in-db-model-architecture/134772)

<div class="topic-metadata">

**Author:** [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Replies:** 1\
**Last updated:** [April 14, 2008, 11:25pm UTC](https://www.ruby-forum.com/t/storing-arrays-in-db-model-architecture/134772 "2008-04-14T23:25:25Z")

</div>

Hi, My users can select items and define a quantity attribute for those. Those items can be selected with checkboxes. And the quantity is a field text. Collecting all in one form; the checkbox selections, and other d…

---

## [Hardware detection](https://www.ruby-forum.com/t/hardware-detection/134770)

<div class="topic-metadata">

**Author:** [@fox](https://www.ruby-forum.com/u/fox)\
**Replies:** 1\
**Last updated:** [April 14, 2008, 11:21pm UTC](https://www.ruby-forum.com/t/hardware-detection/134770 "2008-04-14T23:21:26Z")

</div>

hi all, does the stock ruby (1.8) library have any classes that i can use to detect the current systems’ cpu type, and number of cpu’s etc? i’m hoping for something portable across linux, mac, bsd etc, but cant find …

---

## [Problems overriding Date#inspect in a file required in a test](https://www.ruby-forum.com/t/problems-overriding-date-inspect-in-a-file-required-in-a-test/134773)

<div class="topic-metadata">

**Author:** [@mman](https://www.ruby-forum.com/u/mman)\
**Replies:** 0\
**Last updated:** [April 14, 2008, 11:17pm UTC](https://www.ruby-forum.com/t/problems-overriding-date-inspect-in-a-file-required-in-a-test/134773 "2008-04-14T23:17:55Z")

</div>

With reference to the previous thread http://groups.google.com/group/comp.lang.ruby/browse\_thread/thread/0402853c3617e243# (“change usage of pp in Test::Unit assertions”), I’m finding something that I consider very od…

---

## [Postscript to PDF with pdf-tools, pdf-writer, or other](https://www.ruby-forum.com/t/postscript-to-pdf-with-pdf-tools-pdf-writer-or-other/134766)

<div class="topic-metadata">

**Author:** [@sean\_n](https://www.ruby-forum.com/u/sean_n)\
**Replies:** 1\
**Last updated:** [April 14, 2008, 11:16pm UTC](https://www.ruby-forum.com/t/postscript-to-pdf-with-pdf-tools-pdf-writer-or-other/134766 "2008-04-14T23:16:43Z")

</div>

Does anyone have a way to convert Postscript to PDF using pdf-tools, pdf-writer, or other method? Any suggestions?

---

## [Deleting first lines of Array](https://www.ruby-forum.com/t/deleting-first-lines-of-array/134681)

<div class="topic-metadata">

**Author:** [@javent](https://www.ruby-forum.com/u/javent)\
**Replies:** 6\
**Last updated:** [April 14, 2008, 10:56pm UTC](https://www.ruby-forum.com/t/deleting-first-lines-of-array/134681 "2008-04-14T22:56:27Z")

</div>

Hi, I’m new to Ruby, and so I was trying some stuff I was used to do with ease in perl. Something like capturing and storing the output of a commandline app in an array and manipulate that array afterwards. After sea…

---

## [Mutable member variables -- surprising behavior](https://www.ruby-forum.com/t/mutable-member-variables-surprising-behavior/134752)

<div class="topic-metadata">

**Author:** [@adambeazley](https://www.ruby-forum.com/u/adambeazley)\
**Replies:** 5\
**Last updated:** [April 14, 2008, 8:03pm UTC](https://www.ruby-forum.com/t/mutable-member-variables-surprising-behavior/134752 "2008-04-14T20:03:44Z")

</div>

I noticed some surprising behavior in one of my Ruby programs, and am wondering what the rationale is. Basically, given read-only access to a member variable (using attr\_reader) of class Array, I can modify that Arra…

---

## [Rake : conditional logic based on namespaces?](https://www.ruby-forum.com/t/rake-conditional-logic-based-on-namespaces/134738)

<div class="topic-metadata">

**Author:** [@dishkuvek](https://www.ruby-forum.com/u/dishkuvek)\
**Replies:** 0\
**Last updated:** [April 14, 2008, 5:03pm UTC](https://www.ruby-forum.com/t/rake-conditional-logic-based-on-namespaces/134738 "2008-04-14T17:03:34Z")

</div>

Hi all I’ve got a Rakefile with 2 groups of commands (split into namespaces). One namespace (‘rake show:foo’) prints a string, the other ‘backticks’ it (“rake run:foo”’). The same functionality is duplicated in each …

---

## [Stupid question about the Stick gem](https://www.ruby-forum.com/t/stupid-question-about-the-stick-gem/134730)

<div class="topic-metadata">

**Author:** [@Michael\_TSRichter](https://www.ruby-forum.com/u/Michael_TSRichter)\
**Replies:** 3\
**Last updated:** [April 14, 2008, 4:23pm UTC](https://www.ruby-forum.com/t/stupid-question-about-the-stick-gem/134730 "2008-04-14T16:23:12Z")

</div>

So, I installed the stick gem and gave it a run through its paces. I stumbled at the first hurdle. From the documentation found at “http://stick.rubyforge.org/rdoc/index.html” I get the following snippet of code (th…

---

## [Windows Automatization](https://www.ruby-forum.com/t/windows-automatization/134732)

<div class="topic-metadata">

**Author:** [@arevert](https://www.ruby-forum.com/u/arevert)\
**Replies:** 1\
**Last updated:** [April 14, 2008, 3:58pm UTC](https://www.ruby-forum.com/t/windows-automatization/134732 "2008-04-14T15:58:19Z")

</div>

Hi everybody, i need to automatizate Eclipse IDE on Windows plataform. So there is any library to do this with ruby? Thanks!

---

## [Workshop on Self-sustaining Systems (S3) 2008](https://www.ruby-forum.com/t/workshop-on-self-sustaining-systems-s3-2008/134724)

<div class="topic-metadata">

**Author:** [@Gregor\_Schmidt](https://www.ruby-forum.com/u/Gregor_Schmidt)\
**Replies:** 0\
**Last updated:** [April 14, 2008, 1:45pm UTC](https://www.ruby-forum.com/t/workshop-on-self-sustaining-systems-s3-2008/134724 "2008-04-14T13:45:51Z")

</div>

Hello, I’m simply forwarding this to the list. I am sure some readers are interested in it. Best, Gregor Schmidt Call for Participation \*\*\* Workshop on Self-sustaining Systems (S3) 2008 \*\*\* May 15-16, 2008 Hasso…

---

## [Rubyscript2exe windows executables, on Linux](https://www.ruby-forum.com/t/rubyscript2exe-windows-executables-on-linux/134631)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 7\
**Last updated:** [April 14, 2008, 1:44pm UTC](https://www.ruby-forum.com/t/rubyscript2exe-windows-executables-on-linux/134631 "2008-04-14T13:44:41Z")

</div>

I’ve downloaded rubyscript2exe, and: $ ruby rubyscript2exe.rb HelloWorld.rb will create a file called HelloWorld\_linux which runs on linux. The problem is that I’m trying to make a single .exe for windows users. I r…

---

## [Problem in array](https://www.ruby-forum.com/t/problem-in-array/134713)

<div class="topic-metadata">

**Author:** [@pranjal\_jain](https://www.ruby-forum.com/u/pranjal_jain)\
**Replies:** 2\
**Last updated:** [April 14, 2008, 1:34pm UTC](https://www.ruby-forum.com/t/problem-in-array/134713 "2008-04-14T13:34:09Z")

</div>

HI all I am facing a small problem in array. I am placing the values of the select list in an array. Now I want to check if any of the values in the array is greater then the “0.0” . I had used the following comman…

---

## [Complex#scalar? returns false](https://www.ruby-forum.com/t/complex-scalar-returns-false/134373)

<div class="topic-metadata">

**Author:** [@Kenta\_M](https://www.ruby-forum.com/u/Kenta_M)\
**Replies:** 6\
**Last updated:** [April 14, 2008, 11:37am UTC](https://www.ruby-forum.com/t/complex-scalar-returns-false/134373 "2008-04-14T11:37:29Z")

</div>

e$B$\`$i$?$G$9!%e(B Complex#scalar? e$B$,e(B false e$B$rJV$9$h$&$G$9!%%I%-%e%a%s%H$r8+$k$He(B http://doc.loveruby.net/refm/api/view/method/Numeric/i/scalar=3f e$B\<+?H$,e(B Complex e$B$+$=$N%5%V%/%i%9$N%$%s%9%?%s%9$G$…

---

## [Ruby/tk and loop delay](https://www.ruby-forum.com/t/ruby-tk-and-loop-delay/134684)

<div class="topic-metadata">

**Author:** [@Ed\_Redman](https://www.ruby-forum.com/u/Ed_Redman)\
**Replies:** 6\
**Last updated:** [April 14, 2008, 8:01am UTC](https://www.ruby-forum.com/t/ruby-tk-and-loop-delay/134684 "2008-04-14T08:01:58Z")

</div>

I am writing a card game in ruby/tk. I have a Tk\_button(shuffle) that shuffles the cards and places them on a canvas.The shuffle works fine but I would like to have a slight delay between between each card being displ…

---

## [SEGV by regexp and thread](https://www.ruby-forum.com/t/segv-by-regexp-and-thread/133670)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 3\
**Last updated:** [April 14, 2008, 4:08am UTC](https://www.ruby-forum.com/t/segv-by-regexp-and-thread/133670 "2008-04-14T04:08:53Z")

</div>

e$B0J2\<$N$h$&$K$9$k$He(B SEGV e$B$7$^$9!#e(B % cat z.rb def m(s) /\\Azzzzzz(\\S)(\\S)(\\S)(\\S\*)\\z/ =~ s \[$1.class, $2.class, $3.class, $4.class\] end s1 = “z” \* 10000 s1.force\_encoding(“EUC-JP”) s2 = “a” Thread.new {…

---

## [Executing class methods](https://www.ruby-forum.com/t/executing-class-methods/134382)

<div class="topic-metadata">

**Author:** [@owc](https://www.ruby-forum.com/u/owc)\
**Replies:** 4\
**Last updated:** [April 14, 2008, 3:49am UTC](https://www.ruby-forum.com/t/executing-class-methods/134382 "2008-04-14T03:49:18Z")

</div>

class MainLogic def archive sd\_a=$del\_path.zip($del\_selection) puts sd\_a sd\_a.each do |sd| $del\_path, $del\_selection = sd del = File.join $del\_path, $del\_selection puts “Files to be deleted: #{del}” #Dir.chdir($d…

---

## [ANN: English 0.2.0](https://www.ruby-forum.com/t/ann-english-0-2-0/128351)

<div class="topic-metadata">

**Author:** [@Trans](https://www.ruby-forum.com/u/Trans)\
**Replies:** 2\
**Last updated:** [April 14, 2008, 3:06am UTC](https://www.ruby-forum.com/t/ann-english-0-2-0/128351 "2008-04-14T03:06:56Z")

</div>

= English http://english.rubyforge.org English is a spin-off of Facets, collecting together all the English language libraries together under a single unified project. The English project intends to provided a genera…

---

## [Hash#slice](https://www.ruby-forum.com/t/hash-slice/134611)

<div class="topic-metadata">

**Author:** [@ara\_howard](https://www.ruby-forum.com/u/ara_howard)\
**Replies:** 9\
**Last updated:** [April 14, 2008, 2:23am UTC](https://www.ruby-forum.com/t/hash-slice/134611 "2008-04-14T02:23:08Z")

</div>

is this consistent with other peoples stdlib hacks? class Hash def slice \*keys, &block if block each do |key, val| boolean = block.call(key, val) keys \<\< key if boolean end end hash = self keys.inject({}){|retu…

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

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