# Ruby

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

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

---

## [Method call within a class](https://www.ruby-forum.com/t/method-call-within-a-class/186696)

<div class="topic-metadata">

**Author:** [@alex-osu3](https://www.ruby-forum.com/u/alex-osu3)\
**Replies:** 5\
**Last updated:** [April 12, 2010, 2:34am UTC](https://www.ruby-forum.com/t/method-call-within-a-class/186696 "2010-04-12T02:34:45Z")

</div>

Hi all, Maybe I miss something. But I am confused about method call within a class. What is the format for that? I just copy some code segments from the forum as follows: module Enumerable def each\_with\_index i = 0 …

---

## [How to capture output of linux command](https://www.ruby-forum.com/t/how-to-capture-output-of-linux-command/186600)

<div class="topic-metadata">

**Author:** [@ther](https://www.ruby-forum.com/u/ther)\
**Replies:** 7\
**Last updated:** [April 12, 2010, 2:16am UTC](https://www.ruby-forum.com/t/how-to-capture-output-of-linux-command/186600 "2010-04-12T02:16:27Z")

</div>

You can run linux command: a = ls /home and receive output in variable a. But I would like /home to be variable. So I would invoke command like this: a = "ls #{dir}" This of course doesn’t work, but I hope you get …

---

## [Finding an icon for a file in Linux](https://www.ruby-forum.com/t/finding-an-icon-for-a-file-in-linux/186702)

<div class="topic-metadata">

**Author:** [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Replies:** 2\
**Last updated:** [April 12, 2010, 1:20am UTC](https://www.ruby-forum.com/t/finding-an-icon-for-a-file-in-linux/186702 "2010-04-12T01:20:03Z")

</div>

Hi, I am writing a file manager and am looking for the best way to get the icon for a file type. I am assuming it uses mimetypes, but I haven’t found a good solution yet. If anyone could point me in the right directi…

---

## [\[ANN\] Arcadia ruby ide 0.8.1](https://www.ruby-forum.com/t/ann-arcadia-ruby-ide-0-8-1/186667)

<div class="topic-metadata">

**Author:** [@guerra](https://www.ruby-forum.com/u/guerra)\
**Replies:** 7\
**Last updated:** [April 11, 2010, 11:37pm UTC](https://www.ruby-forum.com/t/ann-arcadia-ruby-ide-0-8-1/186667 "2010-04-11T23:37:26Z")

</div>

Arcadia is a Light Integrated Development Environment (IDE) for Ruby language written in Ruby using the classic tcl/tk GUI toolkit. Some of Arcadia ruby ide project features include: Editor with source browsing, syn…

---

## [Harvested 0.3.0](https://www.ruby-forum.com/t/harvested-0-3-0/186704)

<div class="topic-metadata">

**Author:** [@zmoazeni](https://www.ruby-forum.com/u/zmoazeni)\
**Replies:** 0\
**Last updated:** [April 11, 2010, 9:31pm UTC](https://www.ruby-forum.com/t/harvested-0-3-0/186704 "2010-04-11T21:31:13Z")

</div>

Harvested is a new ruby wrapper around the Harvest Time Tracking API (http://www.getharvest.com/) Some features include: Managing Clients, Projects, Users, Contacts, Expenses, Tasks, and Assignments. Includes both a…

---

## [Getting ExceptionInInitializerError with JxBrowser](https://www.ruby-forum.com/t/getting-exceptionininitializererror-with-jxbrowser/186700)

<div class="topic-metadata">

**Author:** [@Brian\_Knorr](https://www.ruby-forum.com/u/Brian_Knorr)\
**Replies:** 0\
**Last updated:** [April 11, 2010, 8:34pm UTC](https://www.ruby-forum.com/t/getting-exceptionininitializererror-with-jxbrowser/186700 "2010-04-11T20:34:26Z")

</div>

We are trying to use JRuby 1.4 with JxBrowser 2.2, a commercial Java tool that drives Mozilla, Safari and IE, but when we try to create an instance of the browser we get the error below. This works just fine in a re…

---

## [Help finish the Nokogiri Java port](https://www.ruby-forum.com/t/help-finish-the-nokogiri-java-port/186699)

<div class="topic-metadata">

**Author:** [@headius](https://www.ruby-forum.com/u/headius)\
**Replies:** 0\
**Last updated:** [April 11, 2010, 8:33pm UTC](https://www.ruby-forum.com/t/help-finish-the-nokogiri-java-port/186699 "2010-04-11T20:33:50Z")

</div>

I posted a quick blog entry about the Nokogiri Java port here: We’re really close to having it 100% passing, which would mean anyone using JRuby could install and use nokogiri without native library support (and wit…

---

## [Hash name increment on iteration?](https://www.ruby-forum.com/t/hash-name-increment-on-iteration/186508)

<div class="topic-metadata">

**Author:** [@shaz](https://www.ruby-forum.com/u/shaz)\
**Replies:** 8\
**Last updated:** [April 11, 2010, 5:32pm UTC](https://www.ruby-forum.com/t/hash-name-increment-on-iteration/186508 "2010-04-11T17:32:38Z")

</div>

Is it possible to add to the name of a hash while running through an iteration? What I’m trying to achieve: SomeArray.each do |i, name, content| info\[i+1\] = { “name” =\> name, “content” =\> content } end So that I can…

---

## [\[Bug #3107\] AIX$B$G(B--with-opt-dir](https://www.ruby-forum.com/t/bug-3107-aix-b-g-b-with-opt-dir/186449)

<div class="topic-metadata">

**Author:** [@Yutaka\_K](https://www.ruby-forum.com/u/Yutaka_K)\
**Replies:** 1\
**Last updated:** [April 11, 2010, 4:38pm UTC](https://www.ruby-forum.com/t/bug-3107-aix-b-g-b-with-opt-dir/186449 "2010-04-11T16:38:31Z")

</div>

Bug #3107: AIXe$B$Ge(B–with-opt-dir http://redmine.ruby-lang.org/issues/show/3107 e$B5/I\<\<Te(B: Yutaka K. e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal e$BC4Ev\<Te(B: Yutaka K., e$B%+%F%4%je(B: build, Target version: …

---

## [Facets 2.8.3 released](https://www.ruby-forum.com/t/facets-2-8-3-released/186670)

<div class="topic-metadata">

**Author:** [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Replies:** 1\
**Last updated:** [April 11, 2010, 2:47pm UTC](https://www.ruby-forum.com/t/facets-2-8-3-released/186670 "2010-04-11T14:47:54Z")

</div>

Just released Facets 2.8.3. Release notes are below. This release should be the last in the 2.8.x series. The next release, in fact, will be 3.0 as Facets will be making the transition of a modular design instead of a…

---

## [How to analyse web with nokogiri?](https://www.ruby-forum.com/t/how-to-analyse-web-with-nokogiri/186651)

<div class="topic-metadata">

**Author:** [@luofeiyu](https://www.ruby-forum.com/u/luofeiyu)\
**Replies:** 3\
**Last updated:** [April 11, 2010, 1:30pm UTC](https://www.ruby-forum.com/t/how-to-analyse-web-with-nokogiri/186651 "2010-04-11T13:30:03Z")

</div>

how to analyse web with nokogiri? there is my html web: date 2009-12-31 2009-09-30 asset 580 680 cash 1,693 1,777 finance 201 2497 note 500 700 can i get array,such as a with nokogiri? a\[0\]=date,asset,cas…

---

## [Question about pickaxe code example](https://www.ruby-forum.com/t/question-about-pickaxe-code-example/186672)

<div class="topic-metadata">

**Author:** [@chuck\_taylor11243](https://www.ruby-forum.com/u/chuck_taylor11243)\
**Replies:** 1\
**Last updated:** [April 11, 2010, 11:17am UTC](https://www.ruby-forum.com/t/question-about-pickaxe-code-example/186672 "2010-04-11T11:17:57Z")

</div>

in chapter 12 of pickaxe in the tutthreads\_10.rb example there is a line threads.each(&:join) that appears to be doing what you would expect from the line threads.each {|t| t.join} I’m wondering if anyone could point…

---

## [How to write array value into csv file?](https://www.ruby-forum.com/t/how-to-write-array-value-into-csv-file/186676)

<div class="topic-metadata">

**Author:** [@luofeiyu](https://www.ruby-forum.com/u/luofeiyu)\
**Replies:** 2\
**Last updated:** [April 11, 2010, 11:14am UTC](https://www.ruby-forum.com/t/how-to-write-array-value-into-csv-file/186676 "2010-04-11T11:14:57Z")

</div>

how to write array value into csv file? there is array a: a\[0\]=date;asset;cash;finance;note; a\[1\]=2009-12-31;580;1,693;201;500; a\[2\]=2009-09-30; 680;1,777;2497;700; i want to get array a into csv files as t…

---

## [Lemmatization in Ruby](https://www.ruby-forum.com/t/lemmatization-in-ruby/186678)

<div class="topic-metadata">

**Author:** [@shreyas12](https://www.ruby-forum.com/u/shreyas12)\
**Replies:** 0\
**Last updated:** [April 11, 2010, 8:09am UTC](https://www.ruby-forum.com/t/lemmatization-in-ruby/186678 "2010-04-11T08:09:32Z")

</div>

I have tried using a stemmer but the words it produces are just not upto the mark. It could be great if you could let me know any lemmatizer script there exists for ruby or a lemmatizer gem or an SQL query that bundle…

---

## [\[Bug #3127\] Encoding#replicate(non\_string)](https://www.ruby-forum.com/t/bug-3127-encoding-replicate-non-string/186677)

<div class="topic-metadata">

**Author:** [@Kazuhiro\_NISHIYAMA](https://www.ruby-forum.com/u/Kazuhiro_NISHIYAMA)\
**Replies:** 1\
**Last updated:** [April 11, 2010, 5:17am UTC](https://www.ruby-forum.com/t/bug-3127-encoding-replicate-non-string/186677 "2010-04-11T05:17:49Z")

</div>

Bug #3127: Encoding#replicate(non\_string) http://redmine.ruby-lang.org/issues/show/3127 e$B5/I\<\<Te(B: Kazuhiro NISHIYAMA e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal e$B%+%F%4%je(B: core, Target version: 1.9.2 ruby …

---

## [Regarding trolls, spammers, noise-makers, and such](https://www.ruby-forum.com/t/regarding-trolls-spammers-noise-makers-and-such/186664)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 2\
**Last updated:** [April 11, 2010, 3:04am UTC](https://www.ruby-forum.com/t/regarding-trolls-spammers-noise-makers-and-such/186664 "2010-04-11T03:04:08Z")

</div>

A plea: First, one person’s troll/spammer/idiot is another’s savant, but mostly people have a similar appreciation for when someone is just being a dick. Second, efforts to flat-out ban or block people from ruby-talk…

---

## [End of sentience has ? y/n, if n please use one "string?"=o.k](https://www.ruby-forum.com/t/end-of-sentience-has-y-n-if-n-please-use-one-string-o-k/185786)

<div class="topic-metadata">

**Author:** [@jamison\_edmonds](https://www.ruby-forum.com/u/jamison_edmonds)\
**Replies:** 3\
**Last updated:** [April 11, 2010, 2:32am UTC](https://www.ruby-forum.com/t/end-of-sentience-has-y-n-if-n-please-use-one-string-o-k/185786 "2010-04-11T02:32:11Z")

</div>

Hello all Still new to programing.Â I’m making a magic 8 ball clone, for fun and to learn by, console based for now. :)Â I need a few good examples on how to detect if input has a question mark at the end (more tha…

---

## [XML to CSV](https://www.ruby-forum.com/t/xml-to-csv/186553)

<div class="topic-metadata">

**Author:** [@sclarke](https://www.ruby-forum.com/u/sclarke)\
**Replies:** 1\
**Last updated:** [April 11, 2010, 2:29am UTC](https://www.ruby-forum.com/t/xml-to-csv/186553 "2010-04-11T02:29:15Z")

</div>

I am struggling to see how I would go about extracting data from an XML file like so: \<?xml version="1.0" encoding="UTF-8" ?\> 00000 100000000 THIS IS A NEW RECORD 00000 …

---

## [Lib/uri/common.rb:720:16: Unrecognized directive 'nodoc'](https://www.ruby-forum.com/t/lib-uri-common-rb16-unrecognized-directive-nodoc/186653)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 1\
**Last updated:** [April 11, 2010, 2:05am UTC](https://www.ruby-forum.com/t/lib-uri-common-rb16-unrecognized-directive-nodoc/186653 "2010-04-11T02:05:15Z")

</div>

rdoc e$B$G!"0J2\<$N$h$&$J%a%C%;!\<%8$,=P$F$$$^$9!#e(B 74% \[380/510\] lib/uri/common.rb lib/uri/common.rb:720:16: Unrecognized directive ‘nodoc’ lib/uri/common.rb:723:16: Unrecognized directive ‘nodoc’ lib/uri/common.r…

---

## [Detect if 2 ranges share elements](https://www.ruby-forum.com/t/detect-if-2-ranges-share-elements/186669)

<div class="topic-metadata">

**Author:** [@derek](https://www.ruby-forum.com/u/derek)\
**Replies:** 6\
**Last updated:** [April 11, 2010, 2:03am UTC](https://www.ruby-forum.com/t/detect-if-2-ranges-share-elements/186669 "2010-04-11T02:03:38Z")

</div>

Probably a simple problem for most of you out there: What is the best way to make sure two ranges don’t share any elements? For example: \[1…10\] and \[9…15\] =\> false (they share common elements) \[1…10\] and \[11…20\] =\> …

---

## [URI.decode\_www\_form("?a=b")](https://www.ruby-forum.com/t/uri-decode-www-form-a-b/186596)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 1\
**Last updated:** [April 11, 2010, 12:12am UTC](https://www.ruby-forum.com/t/uri-decode-www-form-a-b/186596 "2010-04-11T00:12:15Z")

</div>

URI.decode\_www\_form e$B$O!“0z?t$N@hF,$K$”$ke(B ? e$B$rL5;k$7$^$9!#e(B % ./ruby -ruri -ve ‘p URI.decode\_www\_form("?a=b")’ ruby 1.9.2dev (2010-04-08 trunk 27262) \[i686-linux\] \[\[“a”, “b”\]\] % ./ruby -ruri -ve ‘p URI.deco…

---

## [Global variable in ruby](https://www.ruby-forum.com/t/global-variable-in-ruby/186633)

<div class="topic-metadata">

**Author:** [@amishera](https://www.ruby-forum.com/u/amishera)\
**Replies:** 4\
**Last updated:** [April 10, 2010, 8:06pm UTC](https://www.ruby-forum.com/t/global-variable-in-ruby/186633 "2010-04-10T20:06:03Z")

</div>

Trying to use some global variable $buffer = Array.new 4 5 def save\_log(data, file\_name) 6 puts ‘save log called ‘+file\_name 7 open(file\_name, ‘w’) { |f| f.write(data) } 8 end 9 10 def get\_citatio…

---

## [Question about parsing URL in Ruby](https://www.ruby-forum.com/t/question-about-parsing-url-in-ruby/186642)

<div class="topic-metadata">

**Author:** [@refermaker](https://www.ruby-forum.com/u/refermaker)\
**Replies:** 2\
**Last updated:** [April 10, 2010, 7:10pm UTC](https://www.ruby-forum.com/t/question-about-parsing-url-in-ruby/186642 "2010-04-10T19:10:27Z")

</div>

Hello. By means of Ruby it is possible to make the following: Parser comes on page where there are links to matches of Barcelona command http://www.acb.com/partclub.php?cod\_equipo=BAR Further Parser comes on hyperlin…

---

## [Saving and Restoring a GTK:TreeModel](https://www.ruby-forum.com/t/saving-and-restoring-a-gtk-treemodel/186655)

<div class="topic-metadata">

**Author:** [@Andreas\_Drop](https://www.ruby-forum.com/u/Andreas_Drop)\
**Replies:** 0\
**Last updated:** [April 10, 2010, 6:27pm UTC](https://www.ruby-forum.com/t/saving-and-restoring-a-gtk-treemodel/186655 "2010-04-10T18:27:26Z")

</div>

\-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, Here is a small snippet of my code that saves and restores a Gtk::Treemodel to/from a file. Just because i searched a while, before i decided, i had to do it all by …

---

## [Need a short nontrivial example program](https://www.ruby-forum.com/t/need-a-short-nontrivial-example-program/186620)

<div class="topic-metadata">

**Author:** [@jcain](https://www.ruby-forum.com/u/jcain)\
**Replies:** 7\
**Last updated:** [April 10, 2010, 4:55pm UTC](https://www.ruby-forum.com/t/need-a-short-nontrivial-example-program/186620 "2010-04-10T16:55:32Z")

</div>

I’m a member of the ACM at my university (Wichita State), and we are allowed to participate in the College of Engineering’s open house. We decided to do an arduino project b/c it seemed like the kind of thing that wo…

---

## [Return string within seperators only](https://www.ruby-forum.com/t/return-string-within-seperators-only/186623)

<div class="topic-metadata">

**Author:** [@xtremebain](https://www.ruby-forum.com/u/xtremebain)\
**Replies:** 2\
**Last updated:** [April 10, 2010, 1:45pm UTC](https://www.ruby-forum.com/t/return-string-within-seperators-only/186623 "2010-04-10T13:45:51Z")

</div>

trying to do something like this some text some more text /what I want/ some more text some more text returns “what I want” how would I write this to get just what is between the first and second forward slashes? …

---

## [How to use ri in my computer?](https://www.ruby-forum.com/t/how-to-use-ri-in-my-computer/186531)

<div class="topic-metadata">

**Author:** [@luofeiyu](https://www.ruby-forum.com/u/luofeiyu)\
**Replies:** 6\
**Last updated:** [April 10, 2010, 4:35am UTC](https://www.ruby-forum.com/t/how-to-use-ri-in-my-computer/186531 "2010-04-10T04:35:17Z")

</div>

pt@pt-laptop:~$ ri Integer#times /usr/local/ruby/lib/ruby/1.9.1/rdoc/ri/driver.rb:384:in initialize': Permission denied - /home/pt/.ri/cache/.doc\_dirs (Errno::EACCES) from /usr/local/ruby/lib/ruby/1.9.1/rdoc/ri/driver.r…

---

## [OWASP:ESapi](https://www.ruby-forum.com/t/owasp-esapi/186631)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [April 10, 2010, 3:15am UTC](https://www.ruby-forum.com/t/owasp-esapi/186631 "2010-04-10T03:15:26Z")

</div>

Other than a Ruby version of the above: Is there a way to enable this in Ruby 1.8 series? Is there a bridge to JRuby which could be used? Or is a straight jump to JRuby required for any Java use with Ruby? Is the i…

---

## [Read and write stock prices to file using arrays](https://www.ruby-forum.com/t/read-and-write-stock-prices-to-file-using-arrays/186572)

<div class="topic-metadata">

**Author:** [@dracos](https://www.ruby-forum.com/u/dracos)\
**Replies:** 6\
**Last updated:** [April 10, 2010, 12:25am UTC](https://www.ruby-forum.com/t/read-and-write-stock-prices-to-file-using-arrays/186572 "2010-04-10T00:25:00Z")

</div>

I’m trying to write a script that will take stock ticker symbols from a file, pull the company name and current price and write it back to the file while ignoring comments and blank lines so as to leave the rest of th…

---

## [Direct embedding: calling java methods on object passed indirectly to ruby](https://www.ruby-forum.com/t/direct-embedding-calling-java-methods-on-object-passed-indirectly-to-ruby/186023)

<div class="topic-metadata">

**Author:** [@Gergely\_N](https://www.ruby-forum.com/u/Gergely_N)\
**Replies:** 8\
**Last updated:** [April 9, 2010, 11:39pm UTC](https://www.ruby-forum.com/t/direct-embedding-calling-java-methods-on-object-passed-indirectly-to-ruby/186023 "2010-04-09T23:39:21Z")

</div>

Dear Gurus, I have a little java-ruby integration issue that you might be able to answer straight away: am using the old direct embedding API (http://kenai.com/projects/jruby/pages/DirectJRubyEmbedding) with Jruby …

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

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