# Ruby

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

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

---

## [What does the 'it' do?](https://www.ruby-forum.com/t/what-does-the-it-do/149688)

<div class="topic-metadata">

**Author:** [@timr](https://www.ruby-forum.com/u/timr)\
**Replies:** 3\
**Last updated:** [September 28, 2008, 2:08pm UTC](https://www.ruby-forum.com/t/what-does-the-it-do/149688 "2008-09-28T14:08:08Z")

</div>

I came across the following code (see below). As President Clinton famously said, “It depends on what the definition of ‘it’ is.” I am hoping someone can explain how ‘it’ is being used. I have come across this ‘it…str…

---

## [Backtrace supported?](https://www.ruby-forum.com/t/backtrace-supported/149693)

<div class="topic-metadata">

**Author:** [@benhiller](https://www.ruby-forum.com/u/benhiller)\
**Replies:** 0\
**Last updated:** [September 28, 2008, 1:19pm UTC](https://www.ruby-forum.com/t/backtrace-supported/149693 "2008-09-28T13:19:29Z")

</div>

Hello, I was just wondering if backtrace was supported yet with Exceptions. In my code, I had this: rescue Exception =\> e However, the backtrace is always nil. puts e puts e.backtrace.nil? Is this a known issue? …

---

## [Parsing a time span](https://www.ruby-forum.com/t/parsing-a-time-span/149684)

<div class="topic-metadata">

**Author:** [@snowbird122](https://www.ruby-forum.com/u/snowbird122)\
**Replies:** 4\
**Last updated:** [September 28, 2008, 8:27am UTC](https://www.ruby-forum.com/t/parsing-a-time-span/149684 "2008-09-28T08:27:55Z")

</div>

Hello- I’m trying to find the best way to turn a string like “3 days” or “72 hours” into some sort of time span representation. My first question is what is the best way to store a duration like this? In seconds? Seco…

---

## [ANTLR Target for Ruby](https://www.ruby-forum.com/t/antlr-target-for-ruby/148743)

<div class="topic-metadata">

**Author:** [@arcadio](https://www.ruby-forum.com/u/arcadio)\
**Replies:** 28\
**Last updated:** [September 28, 2008, 5:25am UTC](https://www.ruby-forum.com/t/antlr-target-for-ruby/148743 "2008-09-28T05:25:34Z")

</div>

Hi everyone, I’ve asked the following question in the ANTLR mailing list, with no luck. Since it’s quite Ruby-centric, perhaps someone here knows the answer, given the popularity of ANTLR. I’m in the process of migra…

---

## [Trying to use gsub using variables](https://www.ruby-forum.com/t/trying-to-use-gsub-using-variables/149640)

<div class="topic-metadata">

**Author:** [@jackster](https://www.ruby-forum.com/u/jackster)\
**Replies:** 9\
**Last updated:** [September 28, 2008, 3:04am UTC](https://www.ruby-forum.com/t/trying-to-use-gsub-using-variables/149640 "2008-09-28T03:04:21Z")

</div>

I need to be able to match and substitute text in a string and I’m trying to use gsub with no luck…probably because it’s looking for an regular expression. Does anyone know how I can achieve this same thing using anot…

---

## [Help, Ruby 1.8.6-p287 broke my "use" library and I don't know why](https://www.ruby-forum.com/t/help-ruby-1-8-6-p287-broke-my-use-library-and-i-dont-know-why/149669)

<div class="topic-metadata">

**Author:** [@danielb](https://www.ruby-forum.com/u/danielb)\
**Replies:** 5\
**Last updated:** [September 28, 2008, 2:48am UTC](https://www.ruby-forum.com/t/help-ruby-1-8-6-p287-broke-my-use-library-and-i-dont-know-why/149669 "2008-09-28T02:48:47Z")

</div>

Hi everyone, I need help! I’ve got a library called “use” that let’s you mixin methods from modules in a fine-grained fashion. Unfortunately, something broke it between Ruby 1.8.6-p111 and Ruby 1.8.6-p287. It may ha…

---

## [Parsing xml (xmpp) with ruby](https://www.ruby-forum.com/t/parsing-xml-xmpp-with-ruby/149671)

<div class="topic-metadata">

**Author:** [@ericw](https://www.ruby-forum.com/u/ericw)\
**Replies:** 3\
**Last updated:** [September 28, 2008, 1:12am UTC](https://www.ruby-forum.com/t/parsing-xml-xmpp-with-ruby/149671 "2008-09-28T01:12:16Z")

</div>

Hello World, I am writing an XMPP (Jabber) server in Ruby. XMPP uses XML for its protocol. This means I have to do a good deal of XML parsing, in Ruby. Right now I am using REXML to parse the individual stanzas as the…

---

## [Darkfish-rdoc 1.1.5](https://www.ruby-forum.com/t/darkfish-rdoc-1-1-5/149561)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 12\
**Last updated:** [September 27, 2008, 11:52pm UTC](https://www.ruby-forum.com/t/darkfish-rdoc-1-1-5/149561 "2008-09-27T23:52:06Z")

</div>

Version 1.1.5 of Darkfish-Rdoc has been released. Darkfish is a complete frameless replacement for the default HTML generator for Rdoc, the API documentation-extraction system for Ruby. It looks like this: http://de…

---

## [Proper way to RDoc markup?](https://www.ruby-forum.com/t/proper-way-to-rdoc-markup/129260)

<div class="topic-metadata">

**Author:** [@Serg\_K](https://www.ruby-forum.com/u/Serg_K)\
**Replies:** 11\
**Last updated:** [September 27, 2008, 8:30pm UTC](https://www.ruby-forum.com/t/proper-way-to-rdoc-markup/129260 "2008-09-27T20:30:09Z")

</div>

Hi, I can’t figure this out. Is there a way to inline markup an accessor for Rdoc? That is: def x attr\_accessor :x # this is an X comment attr\_reader :y # this is a Y comment end I want the inline comments…

---

## [Fine-grained rdoc control with hoe](https://www.ruby-forum.com/t/fine-grained-rdoc-control-with-hoe/140625)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [September 27, 2008, 8:05pm UTC](https://www.ruby-forum.com/t/fine-grained-rdoc-control-with-hoe/140625 "2008-09-27T20:05:36Z")

</div>

Is there any way to specify the options to be passed to rdoc for hoe’s documentation targets (either in the Rakefile or in environment variables)? I looked for this, but I could not find it. I have wanted this for s…

---

## [Where to learn rdoc?](https://www.ruby-forum.com/t/where-to-learn-rdoc/147751)

<div class="topic-metadata">

**Author:** [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Replies:** 3\
**Last updated:** [September 27, 2008, 6:58pm UTC](https://www.ruby-forum.com/t/where-to-learn-rdoc/147751 "2008-09-27T18:58:27Z")

</div>

I know this is a noob question but I decided ot start documenting all of my libraries. I can’t find a tutorial or anything on how to properly do this. Can anyone point me in the right direction? Thanks!

---

## [RDoc formatting](https://www.ruby-forum.com/t/rdoc-formatting/141219)

<div class="topic-metadata">

**Author:** [@Dave\_McNulla](https://www.ruby-forum.com/u/Dave_McNulla)\
**Replies:** 1\
**Last updated:** [September 27, 2008, 6:56pm UTC](https://www.ruby-forum.com/t/rdoc-formatting/141219 "2008-09-27T18:56:19Z")

</div>

I found a few formatting bits in the RDoc RDoc. But I am looking how to force a in my doc. I found a request about it in this group from 2006 but there was no conclusion. The only ways I can find are to use bullet p…

---

## [Rdoc & Apostrophes](https://www.ruby-forum.com/t/rdoc-apostrophes/147577)

<div class="topic-metadata">

**Author:** [@jtoy](https://www.ruby-forum.com/u/jtoy)\
**Replies:** 1\
**Last updated:** [September 27, 2008, 6:50pm UTC](https://www.ruby-forum.com/t/rdoc-apostrophes/147577 "2008-09-27T18:50:22Z")

</div>

Rdoc seems to substitute all apostrophes with some fancy versions of them ‘apostrophe’ -\> â€˜apostrophesâ€™ Is there a way to disable this?

---

## [Does array's each-block destroies outer objects?](https://www.ruby-forum.com/t/does-arrays-each-block-destroies-outer-objects/149650)

<div class="topic-metadata">

**Author:** [@w\_wg](https://www.ruby-forum.com/u/w_wg)\
**Replies:** 3\
**Last updated:** [September 27, 2008, 4:15pm UTC](https://www.ruby-forum.com/t/does-arrays-each-block-destroies-outer-objects/149650 "2008-09-27T16:15:42Z")

</div>

Hi, Please look: x = 2840 =\> 2840 x.object\_id =\> 5681 a = \[1,2,3,4,5\] =\> \[1, 2, 3, 4, 5\] a\[4\].object\_id =\> 11 a.each {|x| puts x} 1 2 3 4 5 =\> \[1, 2, 3, 4, 5\] a\[4\].object\_id =\> 11 x.object\_id …

---

## [Re: Trying to use gsub using variables](https://www.ruby-forum.com/t/re-trying-to-use-gsub-using-variables/149659)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [September 27, 2008, 2:57pm UTC](https://www.ruby-forum.com/t/re-trying-to-use-gsub-using-variables/149659 "2008-09-27T14:57:12Z")

</div>

\----- Original Message ---- y = TEST you meant, didn’t you? x = “time” y = ‘TEST’ acl.gsub(/x/,y) How do I get gsub to use the value of x rather “x” itself in my match? You can use the #{ruby code} notation …

---

## [How does Array's each method change its elements?](https://www.ruby-forum.com/t/how-does-arrays-each-method-change-its-elements/149569)

<div class="topic-metadata">

**Author:** [@w\_wg](https://www.ruby-forum.com/u/w_wg)\
**Replies:** 7\
**Last updated:** [September 27, 2008, 9:57am UTC](https://www.ruby-forum.com/t/how-does-arrays-each-method-change-its-elements/149569 "2008-09-27T09:57:24Z")

</div>

Hi, I found Array’s each method (block) changes its elements sometimes, but sometimes it don’t. Please look this: a = \[1,2,3,4,5\] b = a.each { |x| x + 1} puts a \[1,2,3,4,5\] puts b \[1,2,3,4,5\] The array keeps …

---

## [Mapping Signal.list to keyboard](https://www.ruby-forum.com/t/mapping-signal-list-to-keyboard/149645)

<div class="topic-metadata">

**Author:** [@sentinel](https://www.ruby-forum.com/u/sentinel)\
**Replies:** 0\
**Last updated:** [September 27, 2008, 7:34am UTC](https://www.ruby-forum.com/t/mapping-signal-list-to-keyboard/149645 "2008-09-27T07:34:35Z")

</div>

I’ve done a lot of searching but can’t figure out which signals correspond to which keyboard characters. The only one’s I’ve figured out are: INT - ^C (based on a sample on another thread) TSTP - ^Z However, I want…

---

## [Ncurses.init\_pair no longer seems to exist in the 'ncurses' package](https://www.ruby-forum.com/t/ncurses-init-pair-no-longer-seems-to-exist-in-the-ncurses-package/149595)

<div class="topic-metadata">

**Author:** [@Kenneth\_McDonald](https://www.ruby-forum.com/u/Kenneth_McDonald)\
**Replies:** 1\
**Last updated:** [September 27, 2008, 5:19am UTC](https://www.ruby-forum.com/t/ncurses-init-pair-no-longer-seems-to-exist-in-the-ncurses-package/149595 "2008-09-27T05:19:08Z")

</div>

Just wondering if this is true, or if something has gone wrong with my installation. Thanks, Ken

---

## [Save http response file attachment](https://www.ruby-forum.com/t/save-http-response-file-attachment/149633)

<div class="topic-metadata">

**Author:** [@twerth](https://www.ruby-forum.com/u/twerth)\
**Replies:** 0\
**Last updated:** [September 27, 2008, 12:59am UTC](https://www.ruby-forum.com/t/save-http-response-file-attachment/149633 "2008-09-27T00:59:46Z")

</div>

I’m looking for some samples on saving off an attached file from a response to an HTTPS Post. Here’s what I got so far. I was hoping that read\_body would be able to use the block keep pulling the data but all I get …

---

## [Using maven to build a jar/war/ear with jruby source?](https://www.ruby-forum.com/t/using-maven-to-build-a-jar-war-ear-with-jruby-source/149577)

<div class="topic-metadata">

**Author:** [@mcampbell](https://www.ruby-forum.com/u/mcampbell)\
**Replies:** 3\
**Last updated:** [September 26, 2008, 11:56pm UTC](https://www.ruby-forum.com/t/using-maven-to-build-a-jar-war-ear-with-jruby-source/149577 "2008-09-26T23:56:05Z")

</div>

I have a big J2EE system that I’d like to rewrite some of in JRuby. It’s a maven2 multi-project, but I could easily split it up in different ways if I had to. I’m not a maven expert but I understand the basics. At …

---

## [Problem with rake and dependencies](https://www.ruby-forum.com/t/problem-with-rake-and-dependencies/149588)

<div class="topic-metadata">

**Author:** [@rake\_newb](https://www.ruby-forum.com/u/rake_newb)\
**Replies:** 5\
**Last updated:** [September 26, 2008, 10:52pm UTC](https://www.ruby-forum.com/t/problem-with-rake-and-dependencies/149588 "2008-09-26T22:52:15Z")

</div>

Hello: I am new to rake, and I am stuck on a problem with incremental building. My rakefile does what I would like, for the most part. If I touch a .c file, the rakefile functions properly and only builds the necessar…

---

## [\[ANN\] RDoc 2.2.0 released](https://www.ruby-forum.com/t/ann-rdoc-2-2-0-released/149077)

<div class="topic-metadata">

**Author:** [@tonys](https://www.ruby-forum.com/u/tonys)\
**Replies:** 19\
**Last updated:** [September 26, 2008, 10:41pm UTC](https://www.ruby-forum.com/t/ann-rdoc-2-2-0-released/149077 "2008-09-26T22:41:09Z")

</div>

RDoc 2.2.0 now is available! This version essentially aims to fix a number of bugs and to provide some small enhancements. I’ve highlighted a few cool things about the release in a blog post at http://blogs.designin…

---

## [Ruby gems doc indexer](https://www.ruby-forum.com/t/ruby-gems-doc-indexer/142437)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 10\
**Last updated:** [September 26, 2008, 10:33pm UTC](https://www.ruby-forum.com/t/ruby-gems-doc-indexer/142437 "2008-09-26T22:33:23Z")

</div>

Don’t know if this would be useful for anyone, but I wrote a utility to create an html index of the rdoc’s of installed rubygems on your system. I.e. ruby gem\_rdoc\_indexer.rb creates file all\_gems\_rdocs.html with c…

---

## [Hash optimization question](https://www.ruby-forum.com/t/hash-optimization-question/147566)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 10\
**Last updated:** [September 26, 2008, 10:30pm UTC](https://www.ruby-forum.com/t/hash-optimization-question/147566 "2008-09-26T22:30:51Z")

</div>

Are there any libraries that overcome this problem: (slow example) Benchmark.measure { a = {:abc =\> :def}; 100\_000.times { a.each{}}} =\> #\<… @real=0.113940954208374, @utime=0.0999999999999999, @cstime=0.0\> (fast…

---

## [Expected \[java.lang.Class\]; got: \[org.jruby.RubyClass\]](https://www.ruby-forum.com/t/expected-java-lang-class-got-org-jruby-rubyclass/149590)

<div class="topic-metadata">

**Author:** [@eipipuz](https://www.ruby-forum.com/u/eipipuz)\
**Replies:** 3\
**Last updated:** [September 26, 2008, 10:23pm UTC](https://www.ruby-forum.com/t/expected-java-lang-class-got-org-jruby-rubyclass/149590 "2008-09-26T22:23:35Z")

</div>

Hello guys, I am performing some tests using Berkeley DB Java edition. To store data on this DB the data needs to be converted into Binary Arrays. To perform this conversion without problems the Berkeley DB API offers …

---

## [Merge XML documents with Ruby](https://www.ruby-forum.com/t/merge-xml-documents-with-ruby/149620)

<div class="topic-metadata">

**Author:** [@harm](https://www.ruby-forum.com/u/harm)\
**Replies:** 2\
**Last updated:** [September 26, 2008, 10:15pm UTC](https://www.ruby-forum.com/t/merge-xml-documents-with-ruby/149620 "2008-09-26T22:15:24Z")

</div>

Dear group, Currently I’m working with Ruby to merge several XML documents into one. I’m using Builder to construct the ‘master’ XML file: x = Builder::XmlMarkup.new(:indent =\> 2) x.instruct! :xml, :version =\> "1.0", …

---

## [Popen3 mysteriously hangs](https://www.ruby-forum.com/t/popen3-mysteriously-hangs/149608)

<div class="topic-metadata">

**Author:** [@jimdeuc](https://www.ruby-forum.com/u/jimdeuc)\
**Replies:** 4\
**Last updated:** [September 26, 2008, 9:25pm UTC](https://www.ruby-forum.com/t/popen3-mysteriously-hangs/149608 "2008-09-26T21:25:57Z")

</div>

I’m having a problem with a popen3 inexplicably hanging. I’m trying to run the rpmbuild command to automate compiling some srpms, as you’ll see below. For most srpms, the script runs through just fine. Here’s the r…

---

## [How to iterate of the attributes of an object?](https://www.ruby-forum.com/t/how-to-iterate-of-the-attributes-of-an-object/149601)

<div class="topic-metadata">

**Author:** [@hotspoons](https://www.ruby-forum.com/u/hotspoons)\
**Replies:** 3\
**Last updated:** [September 26, 2008, 8:40pm UTC](https://www.ruby-forum.com/t/how-to-iterate-of-the-attributes-of-an-object/149601 "2008-09-26T20:40:25Z")

</div>

I need to build a string of all populated attributes of a given object. I need to get the attribute name and it’s value Also,the object may have 10 attributes, but I’m only interested in the attribute that are not nil…

---

## [Code Review: trace-5](https://www.ruby-forum.com/t/code-review-trace-5/149536)

<div class="topic-metadata">

**Author:** [@John\_LSSIRONRUBY](https://www.ruby-forum.com/u/John_LSSIRONRUBY)\
**Replies:** 1\
**Last updated:** [September 26, 2008, 8:26pm UTC](https://www.ruby-forum.com/t/code-review-trace-5/149536 "2008-09-26T20:26:54Z")

</div>

tfpt review “/shelveset:trace-5;REDMOND\\jflam” FYI - reviewed F2F w/Tomas. Work to enable IronRuby tracing. This is part of a larger effort to diff execution traces of Rails between IronRuby and MRI to track down bugs…

---

## [What is "dynamic constant assignment"](https://www.ruby-forum.com/t/what-is-dynamic-constant-assignment/112013)

<div class="topic-metadata">

**Author:** [@sean\_liu](https://www.ruby-forum.com/u/sean_liu)\
**Replies:** 5\
**Last updated:** [September 26, 2008, 7:03pm UTC](https://www.ruby-forum.com/t/what-is-dynamic-constant-assignment/112013 "2008-09-26T19:03:27Z")

</div>

hi, all today i defined a class like this: class C AB = 10 def self.set(value) AB = value end end then i got this error: SyntaxError: compile error (irb):10: dynamic constant assignment. Constants can be chang…

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

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