# Ruby

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

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

---

## [Strange Integer() behavior](https://www.ruby-forum.com/t/strange-integer-behavior/57799)

<div class="topic-metadata">

**Author:** [@patrickjoyce](https://www.ruby-forum.com/u/patrickjoyce)\
**Replies:** 6\
**Last updated:** [April 14, 2006, 3:54pm UTC](https://www.ruby-forum.com/t/strange-integer-behavior/57799 "2006-04-14T15:54:43Z")

</div>

I am learning Ruby and have encountered an error on a call to ‘Integer(“039”)’ in gems/ruby-web-1.1.1/lib/web/htmlparser/sgml-parser.rb while working on a little screen scraper project. Could someone please explain w…

---

## [Win32ole and wmi](https://www.ruby-forum.com/t/win32ole-and-wmi/57815)

<div class="topic-metadata">

**Author:** [@brad7a0](https://www.ruby-forum.com/u/brad7a0)\
**Replies:** 0\
**Last updated:** [April 14, 2006, 2:36pm UTC](https://www.ruby-forum.com/t/win32ole-and-wmi/57815 "2006-04-14T14:36:30Z")

</div>

In Python, this will list all of the instances of Win32\_BIOS: import wmi c = wmi.WMI() for item in c.Win32\_BIOS(): print item In Ruby, I can’t do this. The closest I’ve come is this: require ‘win32ole’ bios = WIN3…

---

## [Rubyesque way to do multiple \<=\>](https://www.ruby-forum.com/t/rubyesque-way-to-do-multiple/57769)

<div class="topic-metadata">

**Author:** [@victor123789](https://www.ruby-forum.com/u/victor123789)\
**Replies:** 10\
**Last updated:** [April 14, 2006, 2:13pm UTC](https://www.ruby-forum.com/t/rubyesque-way-to-do-multiple/57769 "2006-04-14T14:13:02Z")

</div>

Hello All. I have class with some fields class Human attr\_accessor :sex, :age, :second\_name, :first\_name end now I want to sort objects of this class. I’ve defined operator \<=\> class Human def \<=\>(other) \[sex, ag…

---

## [Ruby 1.8.4 - irb -\> require "irb/completion" fails](https://www.ruby-forum.com/t/ruby-1-8-4-irb-require-irb-completion-fails/57628)

<div class="topic-metadata">

**Author:** [@Frederic\_CHALONS](https://www.ruby-forum.com/u/Frederic_CHALONS)\
**Replies:** 2\
**Last updated:** [April 14, 2006, 1:36pm UTC](https://www.ruby-forum.com/t/ruby-1-8-4-irb-require-irb-completion-fails/57628 "2006-04-14T13:36:09Z")

</div>

Hi, I am running ruby 1.8.4 under Solaris10/Sparc using the archive from http://www.sunfreeware.com. Using irb, I try to load the very convenient “irb/completion” library but it fails. -bash-3.00$ ruby --version r…

---

## [Adding headers to a TMail object](https://www.ruby-forum.com/t/adding-headers-to-a-tmail-object/57801)

<div class="topic-metadata">

**Author:** [@mslagell](https://www.ruby-forum.com/u/mslagell)\
**Replies:** 1\
**Last updated:** [April 14, 2006, 1:11pm UTC](https://www.ruby-forum.com/t/adding-headers-to-a-tmail-object/57801 "2006-04-14T13:11:33Z")

</div>

I get a header that is set on a TMail object using my\_mail\[“my-header”\] but I can’t seem to figure out from the docs how to add headers. Can anyone show me an example of how to set the header “my-header” to “my-value…

---

## [Array#-](https://www.ruby-forum.com/t/array/93903)

<div class="topic-metadata">

**Author:** [@jogloran](https://www.ruby-forum.com/u/jogloran)\
**Replies:** 4\
**Last updated:** [April 14, 2006, 4:37am UTC](https://www.ruby-forum.com/t/array/93903 "2006-04-14T04:37:40Z")

</div>

I need items to be compared based on their values, and not by object equality, so I provide #== for the array elements. The problem is that I’ve been trying to use Array#- as a set difference-like operation, and it d…

---

## [Metar Weather Grabber](https://www.ruby-forum.com/t/metar-weather-grabber/57778)

<div class="topic-metadata">

**Author:** [@supasta](https://www.ruby-forum.com/u/supasta)\
**Replies:** 2\
**Last updated:** [April 14, 2006, 4:14am UTC](https://www.ruby-forum.com/t/metar-weather-grabber/57778 "2006-04-14T04:14:10Z")

</div>

I don’t want to pay money to get weather feeds from a bunch of different countries. So I took my hand at writing my own. It is for an ajax service that grabs the XML. If you use this, expand on it. If you expand on…

---

## [Managing memory consumption](https://www.ruby-forum.com/t/managing-memory-consumption/57770)

<div class="topic-metadata">

**Author:** [@lynxinator](https://www.ruby-forum.com/u/lynxinator)\
**Replies:** 2\
**Last updated:** [April 14, 2006, 12:00am UTC](https://www.ruby-forum.com/t/managing-memory-consumption/57770 "2006-04-14T00:00:15Z")

</div>

Hi all, I’ve got a framework \[1\] that transfers files either locally or over XML::RPC. In either case, memory consumption is significantly higher than I would think it should be, but in the case of XML::RPC it’s so …

---

## [First script seems slow - What's a better way to write this?](https://www.ruby-forum.com/t/first-script-seems-slow-whats-a-better-way-to-write-this/57629)

<div class="topic-metadata">

**Author:** [@Charlotte](https://www.ruby-forum.com/u/Charlotte)\
**Replies:** 18\
**Last updated:** [April 13, 2006, 11:23pm UTC](https://www.ruby-forum.com/t/first-script-seems-slow-whats-a-better-way-to-write-this/57629 "2006-04-13T23:23:36Z")

</div>

I’ve inherited a tcl script from previous co-op students, and it’s a little messy so I wanted to clean it up. I wanted to learn Ruby anyway, so I made a ruby script to search my .tcl file and output a list of all the…

---

## [Question mark in attr\_\*](https://www.ruby-forum.com/t/question-mark-in-attr/57726)

<div class="topic-metadata">

**Author:** [@halfgaar](https://www.ruby-forum.com/u/halfgaar)\
**Replies:** 11\
**Last updated:** [April 13, 2006, 10:03pm UTC](https://www.ruby-forum.com/t/question-mark-in-attr/57726 "2006-04-13T22:03:41Z")

</div>

Hi, Methods which return booleans end with a question mark, by convention. But how about boolean attributes (attr\_\[reader, accessor, writer\])? Saying “attr\_reader :variable?” won’t work. I find it rather strange when…

---

## [Blog posts about Ruby internals](https://www.ruby-forum.com/t/blog-posts-about-ruby-internals/93915)

<div class="topic-metadata">

**Author:** [@pat\_eyler](https://www.ruby-forum.com/u/pat_eyler)\
**Replies:** 1\
**Last updated:** [April 13, 2006, 9:42pm UTC](https://www.ruby-forum.com/t/blog-posts-about-ruby-internals/93915 "2006-04-13T21:42:17Z")

</div>

Sean and I have been digging around with ParseTree and friends for our work on checkr. He’s started to write a series of posts about assignment in Ruby (from an AST/ParseTree perspective). If you’re interested in th…

---

## [IO stream help](https://www.ruby-forum.com/t/io-stream-help/93894)

<div class="topic-metadata">

**Author:** [@spdemac](https://www.ruby-forum.com/u/spdemac)\
**Replies:** 8\
**Last updated:** [April 13, 2006, 9:20pm UTC](https://www.ruby-forum.com/t/io-stream-help/93894 "2006-04-13T21:20:39Z")

</div>

I am struggling with handling stdin and stdout in Ruby. A java application I have responds works as a helper for an external application by doing the following: in = new BufferedReader(new InputStreamReader(System.in)…

---

## [Re: Question mark in attr\_\*](https://www.ruby-forum.com/t/re-question-mark-in-attr/93912)

<div class="topic-metadata">

**Author:** [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Replies:** 0\
**Last updated:** [April 13, 2006, 8:04pm UTC](https://www.ruby-forum.com/t/re-question-mark-in-attr/93912 "2006-04-13T20:04:14Z")

</div>

Methods which return booleans end with a question mark, by Then you can add a battr\_reader to any class… pth FYI, I brought this issue up at http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/5796, where …

---

## [Shame on me poorr newbie " unexpected kend"](https://www.ruby-forum.com/t/shame-on-me-poorr-newbie-unexpected-kend/57645)

<div class="topic-metadata">

**Author:** [@alexmic](https://www.ruby-forum.com/u/alexmic)\
**Replies:** 7\
**Last updated:** [April 13, 2006, 7:44pm UTC](https://www.ruby-forum.com/t/shame-on-me-poorr-newbie-unexpected-kend/57645 "2006-04-13T19:44:26Z")

</div>

Hi, I am trying to learn ruby through a udev utility coding. I usually manage to debug on my own but in this case i dont understand what is wrong… def finddevice() puts “We are now trying to find the device” found=…

---

## [Re: Equivalent of Java static code block in Ruby?](https://www.ruby-forum.com/t/re-equivalent-of-java-static-code-block-in-ruby/93896)

<div class="topic-metadata">

**Author:** [@KroegerS\_Simon\_Sext](https://www.ruby-forum.com/u/KroegerS_Simon_Sext)\
**Replies:** 9\
**Last updated:** [April 13, 2006, 7:27pm UTC](https://www.ruby-forum.com/t/re-equivalent-of-java-static-code-block-in-ruby/93896 "2006-04-13T19:27:10Z")

</div>

end Martin True, the statement above was related to the part you deleted in your answer. cheers Simon

---

## [Re: File basenames using File.basename . .](https://www.ruby-forum.com/t/re-file-basenames-using-file-basename/57738)

<div class="topic-metadata">

**Author:** [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Replies:** 1\
**Last updated:** [April 13, 2006, 7:21pm UTC](https://www.ruby-forum.com/t/re-file-basenames-using-file-basename/57738 "2006-04-13T19:21:11Z")

</div>

\-----Original Message----- From: removed\_email\_address@domain.invalid \[mailto:removed\_email\_address@domain.invalid\] On Behalf Of Peter B. Sent: Thursday, April 13, 2006 5:57 AM To: ruby-talk ML Subject: Re: File ba…

---

## [Do i have to use DRbUndumped?](https://www.ruby-forum.com/t/do-i-have-to-use-drbundumped/57396)

<div class="topic-metadata">

**Author:** [@holy\_sinner](https://www.ruby-forum.com/u/holy_sinner)\
**Replies:** 6\
**Last updated:** [April 13, 2006, 7:20pm UTC](https://www.ruby-forum.com/t/do-i-have-to-use-drbundumped/57396 "2006-04-13T19:20:26Z")

</div>

i am currently using Ruby 1.8.4 and DRb 2.0.4, and i am stuck with some marshalling problem related to tuplespace. this is my hello world code using tuplespace #HelloWorld.rb require “rinda/ring” class HelloWorld i…

---

## [Re: map\_if, collect\_if?](https://www.ruby-forum.com/t/re-map-if-collect-if/57728)

<div class="topic-metadata">

**Author:** [@KroegerS\_Simon\_Sext](https://www.ruby-forum.com/u/KroegerS_Simon_Sext)\
**Replies:** 4\
**Last updated:** [April 13, 2006, 7:08pm UTC](https://www.ruby-forum.com/t/re-map-if-collect-if/57728 "2006-04-13T19:08:49Z")

</div>

module Enumerable def map\_if( &block ) find\_all(&block).map(&block) end end \[…\] I will file away the find\_all {}.map {} idiom for future use \[…\] I would change that to: map(&block).select{|e|e} there can b…

---

## [Linux/Ruby Internship in Houston](https://www.ruby-forum.com/t/linux-ruby-internship-in-houston/57752)

<div class="topic-metadata">

**Author:** [@kevben](https://www.ruby-forum.com/u/kevben)\
**Replies:** 0\
**Last updated:** [April 13, 2006, 6:21pm UTC](https://www.ruby-forum.com/t/linux-ruby-internship-in-houston/57752 "2006-04-13T18:21:54Z")

</div>

Linux Journal (http://www.linuxjournal.com) is hiring in the Houston area for a short term software engineering internship! We’re currently implementing a new system to manage our subscription base and could use a h…

---

## [HTTP Client](https://www.ruby-forum.com/t/http-client/93897)

<div class="topic-metadata">

**Author:** [@pete](https://www.ruby-forum.com/u/pete)\
**Replies:** 1\
**Last updated:** [April 13, 2006, 5:50pm UTC](https://www.ruby-forum.com/t/http-client/93897 "2006-04-13T17:50:20Z")

</div>

Hi, One of the projects I’m working on that I’m currently porting from Java needs to be able to access websites which support cookies and other fun features. In Java I used the Apache HTTP Client library and it worke…

---

## [Range#size](https://www.ruby-forum.com/t/range-size/93898)

<div class="topic-metadata">

**Author:** [@Meinrad\_R](https://www.ruby-forum.com/u/Meinrad_R)\
**Replies:** 7\
**Last updated:** [April 13, 2006, 5:31pm UTC](https://www.ruby-forum.com/t/range-size/93898 "2006-04-13T17:31:45Z")

</div>

dear list, does anyone object to adding the method :size to class Range? class Range def size max-min+1 end end i think it’s useful. maybe others too. i’d like to see it added to the core. here is the test for R…

---

## [Re: Shame on me poorr newbie " unexpected kend"](https://www.ruby-forum.com/t/re-shame-on-me-poorr-newbie-unexpected-kend/93906)

<div class="topic-metadata">

**Author:** [@KroegerS\_Simon\_Sext](https://www.ruby-forum.com/u/KroegerS_Simon_Sext)\
**Replies:** 1\
**Last updated:** [April 13, 2006, 5:31pm UTC](https://www.ruby-forum.com/t/re-shame-on-me-poorr-newbie-unexpected-kend/93906 "2006-04-13T17:31:39Z")

</div>

loop do end else store += 1 end end end and you can simplify this even more: def ask(msg) loop do print "#{msg} \[y/n\]: " response = gets().strip return true if response == ‘y’ return false if response =…

---

## [$B54\<V%Q%U%)!\<%^%s%9(B](https://www.ruby-forum.com/t/b54-v-q-u-s-9-b/57694)

<div class="topic-metadata">

**Author:** [@Yukihiro\_M](https://www.ruby-forum.com/u/Yukihiro_M)\
**Replies:** 2\
**Last updated:** [April 13, 2006, 5:28pm UTC](https://www.ruby-forum.com/t/b54-v-q-u-s-9-b/57694 "2006-04-13T17:28:35Z")

</div>

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B \[ruby-talk:188721\]e$B$G!“0J2\<$N%W%m%0%i%\`e(B(e$BFC$Ke(Bquxe$B$H8F$P$l$k%Q%?!\<e(B e$B%s$K$\*$$$Fe(B)1.9(e$B54\<Ve(B)e$B$,e(B1.8e$B$h$jCY$$$H$$$&;XE&$,$”$j$^$7$?!#e(B e$B$\*CN$i$;$^$G!#e(B …

---

## [Re: Range#size](https://www.ruby-forum.com/t/re-range-size/93904)

<div class="topic-metadata">

**Author:** [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Replies:** 0\
**Last updated:** [April 13, 2006, 4:42pm UTC](https://www.ruby-forum.com/t/re-range-size/93904 "2006-04-13T16:42:26Z")

</div>

5 ? :wink: Crap! Time to change my luggage combination! Dan

---

## [Re: Range#size](https://www.ruby-forum.com/t/re-range-size/93902)

<div class="topic-metadata">

**Author:** [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Replies:** 1\
**Last updated:** [April 13, 2006, 4:42pm UTC](https://www.ruby-forum.com/t/re-range-size/93902 "2006-04-13T16:42:21Z")

</div>

def test\_range\_size assert\_equal 1, (1…1).size assert\_equal 2, (1…2).size assert\_equal 3, (1…3).size assert\_equal 0, (1…1).size assert\_equal 1, (1…2).size end what do you think? – henon What’s the size of 1.2……

---

## [TCPsocket send, puts and write](https://www.ruby-forum.com/t/tcpsocket-send-puts-and-write/57700)

<div class="topic-metadata">

**Author:** [@brad7a0](https://www.ruby-forum.com/u/brad7a0)\
**Replies:** 4\
**Last updated:** [April 13, 2006, 4:36pm UTC](https://www.ruby-forum.com/t/tcpsocket-send-puts-and-write/57700 "2006-04-13T16:36:11Z")

</div>

What are the differences (if any) between these methods of sending data: t = TCPsocket.new(host, port) t.write(a\_string) t.close t = TCPsocket.new(host, port) t.puts(a\_string) t.close t = TCPsocket.new(host, port) …

---

## [Random 0.2.1](https://www.ruby-forum.com/t/random-0-2-1/93901)

<div class="topic-metadata">

**Author:** [@capnregex](https://www.ruby-forum.com/u/capnregex)\
**Replies:** 1\
**Last updated:** [April 13, 2006, 3:56pm UTC](https://www.ruby-forum.com/t/random-0-2-1/93901 "2006-04-13T15:56:05Z")

</div>

Hi, A first public release of Random is now available. See README below for details and get it from: http://rubyforge.org/projects/random/ It has only been tested on linux so far and is only available as a gem. If s…

---

## [Re: Range#size](https://www.ruby-forum.com/t/re-range-size/93899)

<div class="topic-metadata">

**Author:** [@KroegerS\_Simon\_Sext](https://www.ruby-forum.com/u/KroegerS_Simon_Sext)\
**Replies:** 0\
**Last updated:** [April 13, 2006, 3:46pm UTC](https://www.ruby-forum.com/t/re-range-size/93899 "2006-04-13T15:46:53Z")

</div>

does anyone object to adding the method :size to class Range? def size; max - min + 1 end end =\> nil (“AA”…“BB”).size NoMethodError: undefined method -' for "BB":String from (irb):2:insize’ from (irb):4 from …

---

## [Downloading Array of PDF Files Extracting MetaData](https://www.ruby-forum.com/t/downloading-array-of-pdf-files-extracting-metadata/57732)

<div class="topic-metadata">

**Author:** [@dandiebolt](https://www.ruby-forum.com/u/dandiebolt)\
**Replies:** 0\
**Last updated:** [April 13, 2006, 3:37pm UTC](https://www.ruby-forum.com/t/downloading-array-of-pdf-files-extracting-metadata/57732 "2006-04-13T15:37:38Z")

</div>

Let me simplify the description of a task I have to perform. I have an array of urls that all point to pdf files. I need to iterate through the array and download each pdf file and extract some simple metadata such as…

---

## [Ruby Hacking Lunch](https://www.ruby-forum.com/t/ruby-hacking-lunch/57729)

<div class="topic-metadata">

**Author:** [@pat\_eyler](https://www.ruby-forum.com/u/pat_eyler)\
**Replies:** 0\
**Last updated:** [April 13, 2006, 3:19pm UTC](https://www.ruby-forum.com/t/ruby-hacking-lunch/57729 "2006-04-13T15:19:02Z")

</div>

Today, 13 April, from 1200-1300 (MST), at the Salt Lake City Library. We’ll also be hanging out on #urug for those of you wanting to hack remotely. I’ll be working on checkr, if anyone else wants to grab a different…

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

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