# Ruby

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

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

---

## [Runtime disparity - Same program in Perl and Ruby](https://www.ruby-forum.com/t/runtime-disparity-same-program-in-perl-and-ruby/106857)

<div class="topic-metadata">

**Author:** [@Kaldrenon](https://www.ruby-forum.com/u/Kaldrenon)\
**Replies:** 5\
**Last updated:** [June 16, 2007, 3:20pm UTC](https://www.ruby-forum.com/t/runtime-disparity-same-program-in-perl-and-ruby/106857 "2007-06-16T15:20:38Z")

</div>

Hi all (this is going to comp.lang.ruby and comp.lang.perl.misc), The other day I wrote a basic program in Perl, and the following day I rewrote it in Ruby. I’m curious about the differences in runtime of the two vers…

---

## [Instead of re.sub](https://www.ruby-forum.com/t/instead-of-re-sub/107004)

<div class="topic-metadata">

**Author:** [@cihan](https://www.ruby-forum.com/u/cihan)\
**Replies:** 1\
**Last updated:** [June 16, 2007, 1:24pm UTC](https://www.ruby-forum.com/t/instead-of-re-sub/107004 "2007-06-16T13:24:27Z")

</div>

hi I want to remove all \\n parts of a .txt file but I can’t find the command. If I use .sub the code makes the only first replacement but I need it to check all of the file. In python language they use re but in ruby…

---

## [Grade my test?](https://www.ruby-forum.com/t/grade-my-test/106995)

<div class="topic-metadata">

**Author:** [@jabowen](https://www.ruby-forum.com/u/jabowen)\
**Replies:** 2\
**Last updated:** [June 16, 2007, 12:11pm UTC](https://www.ruby-forum.com/t/grade-my-test/106995 "2007-06-16T12:11:20Z")

</div>

I have directory of data files along with a few other types of files. The data file names start at 0000 and run to 3999. I have a program that creates an array for the data files without the non data files. This pr…

---

## [Including range error](https://www.ruby-forum.com/t/including-range-error/107003)

<div class="topic-metadata">

**Author:** [@Josselin](https://www.ruby-forum.com/u/Josselin)\
**Replies:** 1\
**Last updated:** [June 16, 2007, 11:49am UTC](https://www.ruby-forum.com/t/including-range-error/107003 "2007-06-16T11:49:18Z")

</div>

I wrote the following command myRanges = \[(0…2), (2…5), (5…10), (10…15), (15…25)\] myRanges.each\_pair {|index, aRange| index if aRange.include?(1)} I would like to get 0 as a result since 1 is falling into the first …

---

## [Nube soap::mapping::object question](https://www.ruby-forum.com/t/nube-soap-object-question/106954)

<div class="topic-metadata">

**Author:** [@bradrover](https://www.ruby-forum.com/u/bradrover)\
**Replies:** 1\
**Last updated:** [June 16, 2007, 11:33am UTC](https://www.ruby-forum.com/t/nube-soap-object-question/106954 "2007-06-16T11:33:17Z")

</div>

I’ve been banging my head against the wall on this problem. I have a soap::mapping::object result from a web service call, and all is well except there are some XML elements in the response that are empty. When I outp…

---

## [Replacing OpenSSL](https://www.ruby-forum.com/t/replacing-openssl/107001)

<div class="topic-metadata">

**Author:** [@fxn](https://www.ruby-forum.com/u/fxn)\
**Replies:** 0\
**Last updated:** [June 16, 2007, 11:05am UTC](https://www.ruby-forum.com/t/replacing-openssl/107001 "2007-06-16T11:05:14Z")

</div>

I would like to change OpenSSL for a given 1.8.4 running on a Windows machine to have a patch\[\*\] applied. Compilation of the library with mingw succeeds: perl Configure mingw shared make but just moving around DLLs …

---

## [UPDATED: Building 1.8.6-p36 with Sun Studio 12 compiler](https://www.ruby-forum.com/t/updated-building-1-8-6-p36-with-sun-studio-12-compiler/106867)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [June 16, 2007, 11:00am UTC](https://www.ruby-forum.com/t/updated-building-1-8-6-p36-with-sun-studio-12-compiler/106867 "2007-06-16T11:00:14Z")

</div>

All - I have resolved most of the problems encountered during “make check”; it seems the test runs do not honor LD\_LIBRARY\_PATH, so I had to symlink the libraries for openssl, gdbm and ncurses to /lib, and then my re…

---

## [Could anybody help me on this? (require 'libglade2')](https://www.ruby-forum.com/t/could-anybody-help-me-on-this-require-libglade2/106999)

<div class="topic-metadata">

**Author:** [@jwing](https://www.ruby-forum.com/u/jwing)\
**Replies:** 0\
**Last updated:** [June 16, 2007, 10:13am UTC](https://www.ruby-forum.com/t/could-anybody-help-me-on-this-require-libglade2/106999 "2007-06-16T10:13:07Z")

</div>

Hi all, I just installed ruby-gnome2-all-0.16.0 on my cygwin box with building from source code. ( It tells me that the ruby-glade installed sucessfully.) When I try to run my a.rb, it reports errors. Could anybody h…

---

## [Ferret](https://www.ruby-forum.com/t/ferret/106991)

<div class="topic-metadata">

**Author:** [@Hal\_F](https://www.ruby-forum.com/u/Hal_F)\
**Replies:** 1\
**Last updated:** [June 16, 2007, 7:32am UTC](https://www.ruby-forum.com/t/ferret/106991 "2007-06-16T07:32:55Z")

</div>

I’ve just started learning Ferret today… it looks very cool. Can anyone explain how MatchAllQuery works? Thanks, Hal F.

---

## [Using extend for initialization settings?](https://www.ruby-forum.com/t/using-extend-for-initialization-settings/106951)

<div class="topic-metadata">

**Author:** [@Trans](https://www.ruby-forum.com/u/Trans)\
**Replies:** 15\
**Last updated:** [June 16, 2007, 6:40am UTC](https://www.ruby-forum.com/t/using-extend-for-initialization-settings/106951 "2007-06-16T06:40:52Z")

</div>

It’s not uncommon to see initialize method take a hash or a setting proc and apply that to accessors. Eg. def initialize( settings ) settings.each{|k,v| send("{#k}=",v) end or def initialize( &settings ) settings.…

---

## [Reverted gc.c modification](https://www.ruby-forum.com/t/reverted-gc-c-modification/106983)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 1\
**Last updated:** [June 16, 2007, 5:43am UTC](https://www.ruby-forum.com/t/reverted-gc-c-modification/106983 "2007-06-16T05:43:48Z")

</div>

e$B$U$H!"0JA09T$C$?0J2\<$NJQ99$,e(B Merge YARV e$B$N$H$-$K$J$/$J$C$F$$e(B e$B$k$3$H$K5$$,$D$-$^$7$?!#e(B YARV e$B$G$OITMW$J$N$G$7$g$&$+e(B? Mon Jul 10 19:22:19 2006 Tanaka A. removed\_email\_address@domain.invalid …

---

## [^C on system()](https://www.ruby-forum.com/t/c-on-system/106993)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 0\
**Last updated:** [June 16, 2007, 5:23am UTC](https://www.ruby-forum.com/t/c-on-system/106993 "2007-06-16T05:23:47Z")

</div>

e$B0J2\<$N$h$&$J%W%m%0%i%$r\<B9T$9$k$H!"e(B^C e$B$G%W%m%0%i%$r=\*N;$9e(B e$B$k$N$,:$Fq$G$9!#e(B % ./ruby -ve ’ loop { p system(“sleep 1”) }’ ruby 1.9.0 (2007-06-15 patchlevel 0) \[i686-linux\] ^Cfalse ^Cfalse ^Cfalse …

---

## [Extracting numbers from a string](https://www.ruby-forum.com/t/extracting-numbers-from-a-string/106589)

<div class="topic-metadata">

**Author:** [@grill](https://www.ruby-forum.com/u/grill)\
**Replies:** 7\
**Last updated:** [June 16, 2007, 5:23am UTC](https://www.ruby-forum.com/t/extracting-numbers-from-a-string/106589 "2007-06-16T05:23:09Z")

</div>

I have filenames from various digital cameras: DSC\_1234.jpg, CRW1234.jpg, etc. What I really want is the numeric portion of that filename. How would I extract just that portion? I expect it to involve the regex /\\d…

---

## [Get Parameter names from methods](https://www.ruby-forum.com/t/get-parameter-names-from-methods/106980)

<div class="topic-metadata">

**Author:** [@sams](https://www.ruby-forum.com/u/sams)\
**Replies:** 1\
**Last updated:** [June 16, 2007, 5:00am UTC](https://www.ruby-forum.com/t/get-parameter-names-from-methods/106980 "2007-06-16T05:00:45Z")

</div>

Oft asked for, here you go: def binding\_class end parameter\_name.empty? || parameter\_name == ‘nil’ end.map { |s| s.freeze } end end parameter\_names end end end There’s holes in this. It’s not a full Ruby pa…

---

## [Accessing the count/iteration # within an "each"?](https://www.ruby-forum.com/t/accessing-the-count-iteration-within-an-each/106974)

<div class="topic-metadata">

**Author:** [@greg](https://www.ruby-forum.com/u/greg)\
**Replies:** 3\
**Last updated:** [June 16, 2007, 3:26am UTC](https://www.ruby-forum.com/t/accessing-the-count-iteration-within-an-each/106974 "2007-06-16T03:26:36Z")

</div>

Hi, Is there a way to access the count / iteration# within an “each” loop? i.e. how many times through the loop one is? testhash.each { |d| puts } Tks Greg

---

## [Hpricot 0.6 -- the swift, delightful HTML parser](https://www.ruby-forum.com/t/hpricot-0-6-the-swift-delightful-html-parser/106982)

<div class="topic-metadata">

**Author:** [@S\_why](https://www.ruby-forum.com/u/S_why)\
**Replies:** 0\
**Last updated:** [June 16, 2007, 2:02am UTC](https://www.ruby-forum.com/t/hpricot-0-6-the-swift-delightful-html-parser/106982 "2007-06-16T02:02:31Z")

</div>

Hpricot 0.6 is up on Rubyforge. Or get it from the development gem server: gem install hpricot --source http://code.whytheluckystiff.net Hpricot is a flexible HTML parser written in C. Nestled in a nice Ruby wrappe…

---

## [Alias\_method for static method](https://www.ruby-forum.com/t/alias-method-for-static-method/106975)

<div class="topic-metadata">

**Author:** [@Borja\_MartSSS\_n](https://www.ruby-forum.com/u/Borja_MartSSS_n)\
**Replies:** 2\
**Last updated:** [June 16, 2007, 12:01am UTC](https://www.ruby-forum.com/t/alias-method-for-static-method/106975 "2007-06-16T00:01:17Z")

</div>

Hi, I was wondering if it is possible to create aliases for class methods, as alias\_method seems to work only for instance methods. Thanks in advance

---

## ["gem update --system" ignores where I installed rubygems](https://www.ruby-forum.com/t/gem-update-system-ignores-where-i-installed-rubygems/106417)

<div class="topic-metadata">

**Author:** [@levander](https://www.ruby-forum.com/u/levander)\
**Replies:** 4\
**Last updated:** [June 15, 2007, 10:01pm UTC](https://www.ruby-forum.com/t/gem-update-system-ignores-where-i-installed-rubygems/106417 "2007-06-15T22:01:05Z")

</div>

On my Ubuntu Feisty box a few months ago, I installed rubygems 0.9.0 in /opt/rubygems by: export GEM\_HOME=/opt/rubygems/lib/ruby/gems/1.8 export RUBYLIB=/opt/rubygems/lib/ruby:/opt/rubygems/lib/site\_ruby/1.8 sudo rub…

---

## [Ruby in cmd](https://www.ruby-forum.com/t/ruby-in-cmd/106960)

<div class="topic-metadata">

**Author:** [@maung](https://www.ruby-forum.com/u/maung)\
**Replies:** 4\
**Last updated:** [June 15, 2007, 8:22pm UTC](https://www.ruby-forum.com/t/ruby-in-cmd/106960 "2007-06-15T20:22:50Z")

</div>

I am new to Ruby and am trying to run a piece of code from Programming Ruby in cmd. When i run in cmd \>ruby Song.rb, I don’t get any output. But I can get the result I expected when I run in irb. Can anyone help me on…

---

## [Walking through Tate and Hibbs, running into things that don](https://www.ruby-forum.com/t/walking-through-tate-and-hibbs-running-into-things-that-don/106905)

<div class="topic-metadata">

**Author:** [@Xeno\_C](https://www.ruby-forum.com/u/Xeno_C)\
**Replies:** 3\
**Last updated:** [June 15, 2007, 8:13pm UTC](https://www.ruby-forum.com/t/walking-through-tate-and-hibbs-running-into-things-that-don/106905 "2007-06-15T20:13:49Z")

</div>

First of all, there seems to be this claim on page 7 that the contents of script/server is: … OPTIONS = { :port =\> 3000, :ip =\> “0.0.0.0”, :environment =\> “development”, :server\_root =\> "File.expand\_path(F…

---

## [(no subject)](https://www.ruby-forum.com/t/no-subject/106959)

<div class="topic-metadata">

**Author:** [@Horea\_R](https://www.ruby-forum.com/u/Horea_R)\
**Replies:** 0\
**Last updated:** [June 15, 2007, 7:33pm UTC](https://www.ruby-forum.com/t/no-subject/106959 "2007-06-15T19:33:45Z")

</div>

unsubscribe

---

## [Ruby Nube](https://www.ruby-forum.com/t/ruby-nube/106933)

<div class="topic-metadata">

**Author:** [@musty](https://www.ruby-forum.com/u/musty)\
**Replies:** 5\
**Last updated:** [June 15, 2007, 7:17pm UTC](https://www.ruby-forum.com/t/ruby-nube/106933 "2007-06-15T19:17:43Z")

</div>

Hello, The concept of Dynamically Typed Languages has peaked my interest. However, I have spent sometime trying to find what problem they exactly solve. Can anyone tell me: What problems do dynamically typed langua…

---

## [Help](https://www.ruby-forum.com/t/help/106856)

<div class="topic-metadata">

**Author:** [@Mark\_Henderson](https://www.ruby-forum.com/u/Mark_Henderson)\
**Replies:** 2\
**Last updated:** [June 15, 2007, 6:57pm UTC](https://www.ruby-forum.com/t/help/106856 "2007-06-15T18:57:33Z")

</div>

help Mark Henderson SiteSolver Web Designs FAX (508) 519-8555

---

## [Anybody help me](https://www.ruby-forum.com/t/anybody-help-me/106930)

<div class="topic-metadata">

**Author:** [@mahen1981](https://www.ruby-forum.com/u/mahen1981)\
**Replies:** 2\
**Last updated:** [June 15, 2007, 6:03pm UTC](https://www.ruby-forum.com/t/anybody-help-me/106930 "2007-06-15T18:03:26Z")

</div>

hi i want to open outlook thro my HTML using ruby code(onclick of submit button). I have HTML as follow I also want to attach file stored on hard drivr automatically to it. It’ argent plz. help me

---

## [Mystery deepens](https://www.ruby-forum.com/t/mystery-deepens/106956)

<div class="topic-metadata">

**Author:** [@grehom](https://www.ruby-forum.com/u/grehom)\
**Replies:** 0\
**Last updated:** [June 15, 2007, 6:01pm UTC](https://www.ruby-forum.com/t/mystery-deepens/106956 "2007-06-15T18:01:26Z")

</div>

To further confound me I tried the ruby rails turtorial and to my surprise the demo worked and access to my database worked much as I would have hoped.

---

## [Str.scan](https://www.ruby-forum.com/t/str-scan/106907)

<div class="topic-metadata">

**Author:** [@banry](https://www.ruby-forum.com/u/banry)\
**Replies:** 5\
**Last updated:** [June 15, 2007, 5:46pm UTC](https://www.ruby-forum.com/t/str-scan/106907 "2007-06-15T17:46:25Z")

</div>

I have a page of html, the usual thing. It has an ordered list. So it has item item item item Well, I am going through this my usual way, which is just brute force string manipulation. It’…

---

## [Lose the first character](https://www.ruby-forum.com/t/lose-the-first-character/106886)

<div class="topic-metadata">

**Author:** [@banry](https://www.ruby-forum.com/u/banry)\
**Replies:** 8\
**Last updated:** [June 15, 2007, 5:29pm UTC](https://www.ruby-forum.com/t/lose-the-first-character/106886 "2007-06-15T17:29:22Z")

</div>

r = r.reverse.chop.reverse # remove the first character That works, but I bet there’s a nicer method. What do people use? I thought there would be a pohc method (chop, in reverse). Thanks. (pickaxe is up in the othe…

---

## [Info regarding Zlib::GzipReader](https://www.ruby-forum.com/t/info-regarding-zlib-gzipreader/106952)

<div class="topic-metadata">

**Author:** [@J-H\_Johansen](https://www.ruby-forum.com/u/J-H_Johansen)\
**Replies:** 0\
**Last updated:** [June 15, 2007, 5:15pm UTC](https://www.ruby-forum.com/t/info-regarding-zlib-gzipreader/106952 "2007-06-15T17:15:16Z")

</div>

Hi, I’m trying to parse through a gzip’ed proxy access log with Zlib::GzipReader and I’m having some difficulties. f = File.open(file, “r”) gz = Zlib::GzipReader.new(f) gz.readlines.each do |block| puts block end …

---

## [Create text files](https://www.ruby-forum.com/t/create-text-files/106909)

<div class="topic-metadata">

**Author:** [@tomtoday](https://www.ruby-forum.com/u/tomtoday)\
**Replies:** 2\
**Last updated:** [June 15, 2007, 4:20pm UTC](https://www.ruby-forum.com/t/create-text-files/106909 "2007-06-15T16:20:05Z")

</div>

Hi, I do have a text file as shown below. I’d now like to use Ruby to create separate text files for the content between “======”. To do so I have: Open, read from a text file, and pass to block f1 File.open(‘test.tx…

---

## [Rar gem!](https://www.ruby-forum.com/t/rar-gem/106926)

<div class="topic-metadata">

**Author:** [@bashar](https://www.ruby-forum.com/u/bashar)\
**Replies:** 2\
**Last updated:** [June 15, 2007, 3:37pm UTC](https://www.ruby-forum.com/t/rar-gem/106926 "2007-06-15T15:37:00Z")

</div>

Hi guys, I’m building an application to compress and uncompress files and this application will support zip, tar, and rar files I found zip and tar gems but I couldn’t find (till now) a rar gem.

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

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