# Ruby

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

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

---

## [Trouble with scrolling on a TK frame](https://www.ruby-forum.com/t/trouble-with-scrolling-on-a-tk-frame/107601)

<div class="topic-metadata">

**Author:** [@Andreas\_Pinkert](https://www.ruby-forum.com/u/Andreas_Pinkert)\
**Replies:** 3\
**Last updated:** [June 24, 2007, 2:10pm UTC](https://www.ruby-forum.com/t/trouble-with-scrolling-on-a-tk-frame/107601 "2007-06-24T14:10:52Z")

</div>

Hi together, Fist: Against all common sense I post a question without having read for a few days in this group. However, I used groups.google and the apropriate faqs in the www but all I could come up with were examp…

---

## [Can't include a module in Enumerable?](https://www.ruby-forum.com/t/cant-include-a-module-in-enumerable/107595)

<div class="topic-metadata">

**Author:** [@Trans](https://www.ruby-forum.com/u/Trans)\
**Replies:** 7\
**Last updated:** [June 24, 2007, 2:02pm UTC](https://www.ruby-forum.com/t/cant-include-a-module-in-enumerable/107595 "2007-06-24T14:02:51Z")

</div>

irb(main):002:1\> module Z irb(main):003:1\> def x; “x”; end irb(main):004:1\> end =\> nil irb(main):005:0\> module Enumerable irb(main):006:1\> include Z irb(main):007:1\> end =\> Enumerable irb(main):008:0\> a = \[1,…

---

## [Parameterizing REXML::XPath expressions](https://www.ruby-forum.com/t/parameterizing-rexml-xpath-expressions/107628)

<div class="topic-metadata">

**Author:** [@SySySy](https://www.ruby-forum.com/u/SySySy)\
**Replies:** 1\
**Last updated:** [June 24, 2007, 1:50pm UTC](https://www.ruby-forum.com/t/parameterizing-rexml-xpath-expressions/107628 "2007-06-24T13:50:51Z")

</div>

Hi there, I’m struggling a bit with what I think should be straightforward. I basically want to pull information out of an XML document. The working example I have is as follows… version = REXML::XPath.match(@doc, ‘/…

---

## [LRUG Nights - Episode #1 "Pursuit" - Tuesday 26th June](https://www.ruby-forum.com/t/lrug-nights-episode-1-pursuit-tuesday-26th-june/107631)

<div class="topic-metadata">

**Author:** [@Murray\_S](https://www.ruby-forum.com/u/Murray_S)\
**Replies:** 0\
**Last updated:** [June 24, 2007, 1:46pm UTC](https://www.ruby-forum.com/t/lrug-nights-episode-1-pursuit-tuesday-26th-june/107631 "2007-06-24T13:46:51Z")

</div>

Hi all, The London Ruby U. Group has started a 2nd monthly meetup called LRUG Nights \[1\]- it’s an agenda-free pub meetup for the local ruby community to get together and have a couple of beers (also maybe solve crime…

---

## [Open Doc/Open XML library](https://www.ruby-forum.com/t/open-doc-open-xml-library/107392)

<div class="topic-metadata">

**Author:** [@mike](https://www.ruby-forum.com/u/mike)\
**Replies:** 3\
**Last updated:** [June 24, 2007, 12:02pm UTC](https://www.ruby-forum.com/t/open-doc-open-xml-library/107392 "2007-06-24T12:02:43Z")

</div>

Hello all, Is there any library for creating “open document” or/and “open XML” documents available? Thank you. Michael

---

## [From the ruby book install on win32](https://www.ruby-forum.com/t/from-the-ruby-book-install-on-win32/107503)

<div class="topic-metadata">

**Author:** [@paradise](https://www.ruby-forum.com/u/paradise)\
**Replies:** 5\
**Last updated:** [June 24, 2007, 11:22am UTC](https://www.ruby-forum.com/t/from-the-ruby-book-install-on-win32/107503 "2007-06-24T11:22:16Z")

</div>

Hi folks, Though i’d give ruby a try :slight\_smile: from the book you get when installing ruby 1.8.6 about the program Song. this is the code i pasted into SciTE. class Song def initialize(name, artist, duration) @…

---

## [Newbie Question Passing variables to methods](https://www.ruby-forum.com/t/newbie-question-passing-variables-to-methods/107616)

<div class="topic-metadata">

**Author:** [@Starke](https://www.ruby-forum.com/u/Starke)\
**Replies:** 4\
**Last updated:** [June 24, 2007, 10:55am UTC](https://www.ruby-forum.com/t/newbie-question-passing-variables-to-methods/107616 "2007-06-24T10:55:36Z")

</div>

Im trying to set up a method and pass a varible to it then out put the new manipulated varible back out. Here is what I have var1 = ‘test’ def change var\_in puts var\_in var\_in = ‘test1’ puts var\_in end change …

---

## [Parameterizing REXML::XPath expressions](https://www.ruby-forum.com/t/parameterizing-rexml-xpath-expressions/168842)

<div class="topic-metadata">

**Author:** [@SySySy](https://www.ruby-forum.com/u/SySySy)\
**Replies:** 0\
**Last updated:** [June 24, 2007, 10:46am UTC](https://www.ruby-forum.com/t/parameterizing-rexml-xpath-expressions/168842 "2007-06-24T10:46:35Z")

</div>

Hi there, I’m struggling a bit with what I think should be straightforward. I basically want to pull information out of an XML document. The working example I have is as follows… version = REXML::XPath.match(@doc, ‘/…

---

## [What is the last argument to rb\_attr()?](https://www.ruby-forum.com/t/what-is-the-last-argument-to-rb-attr/107567)

<div class="topic-metadata">

**Author:** [@danielb](https://www.ruby-forum.com/u/danielb)\
**Replies:** 1\
**Last updated:** [June 24, 2007, 8:46am UTC](https://www.ruby-forum.com/t/what-is-the-last-argument-to-rb-attr/107567 "2007-06-24T08:46:30Z")

</div>

Hi, What is the last argument to the rb\_attr function exactly? I looked at eval.c and I think it sets its visibility (private?) but I wasn’t sure and I didn’t see it documented anywhere. Thanks, Dan

---

## [Deadlock dumps core](https://www.ruby-forum.com/t/deadlock-dumps-core/107575)

<div class="topic-metadata">

**Author:** [@sheepman](https://www.ruby-forum.com/u/sheepman)\
**Replies:** 1\
**Last updated:** [June 24, 2007, 8:16am UTC](https://www.ruby-forum.com/t/deadlock-dumps-core/107575 "2007-06-24T08:16:29Z")

</div>

e$B$3$s$P$s$O!"e(Bsheepman e$B$G$9!#e(B e$B$D$.$N$h$&$Je(B deadlock e$B$r5/$3$9%3!\<%I$r\<B9T$9$k$H!"e(B ruby-1.8 e$B$,e(B core e$B$rEG$-$^$9!#e(B –enable-pthread e$B$G%3%s%Q%$%k$7$F$$$^$9!#e(B Linux 2.4.33-0vl0.5 i686 …

---

## [Unpacking signed shorts and integers with specified endianne](https://www.ruby-forum.com/t/unpacking-signed-shorts-and-integers-with-specified-endianne/107189)

<div class="topic-metadata">

**Author:** [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Replies:** 4\
**Last updated:** [June 24, 2007, 6:43am UTC](https://www.ruby-forum.com/t/unpacking-signed-shorts-and-integers-with-specified-endianne/107189 "2007-06-24T06:43:25Z")

</div>

I’m deciphering a byte-based binary file structure which can be stored in either big or little endian. (The first byte of the file describes the format.) Among others, some of the fields are UINT32 (unsigned 4- byte i…

---

## [Ruby equivalent of htons or htonl](https://www.ruby-forum.com/t/ruby-equivalent-of-htons-or-htonl/107504)

<div class="topic-metadata">

**Author:** [@rinda](https://www.ruby-forum.com/u/rinda)\
**Replies:** 5\
**Last updated:** [June 24, 2007, 6:16am UTC](https://www.ruby-forum.com/t/ruby-equivalent-of-htons-or-htonl/107504 "2007-06-24T06:16:24Z")

</div>

Hi, I try to port this c code: \*(uint16\_t \*)(ptr+FSP\_OFFSET\_KEY)=htons(p-\>key); \*(uint16\_t \*)(ptr+FSP\_OFFSET\_SEQ)=htons(p-\>seq); \*(uint16\_t \*)(ptr+FSP\_OFFSET\_LEN)=htons(p-\>len); \*(uint32\_t \*)(ptr+FSP\_OFFSET\_POS)=hto…

---

## [IRC Transcripts in Instiki and Markdown](https://www.ruby-forum.com/t/irc-transcripts-in-instiki-and-markdown/107588)

<div class="topic-metadata">

**Author:** [@levander](https://www.ruby-forum.com/u/levander)\
**Replies:** 3\
**Last updated:** [June 24, 2007, 3:36am UTC](https://www.ruby-forum.com/t/irc-transcripts-in-instiki-and-markdown/107588 "2007-06-24T03:36:14Z")

</div>

I haven’t found a way to easily markup IRC transcripts in Markdown on my Instiki install yet. Hopefully this isn’t a reason to go through all my wiki pages and switch to Textile. For an IRC transcript like this: M …

---

## [GetoptLong, but not on ARGV](https://www.ruby-forum.com/t/getoptlong-but-not-on-argv/107348)

<div class="topic-metadata">

**Author:** [@Trans](https://www.ruby-forum.com/u/Trans)\
**Replies:** 10\
**Last updated:** [June 24, 2007, 12:10am UTC](https://www.ruby-forum.com/t/getoptlong-but-not-on-argv/107348 "2007-06-24T00:10:57Z")

</div>

Is there a way to utilize Getoptlong on an arbitrary command var, ie. not on ARGV. I figure I can alway do something like: require ‘getoptlong’ my\_argv = Shellwords.shellwords( “foo -x” ) const\_set(:ARGV, my\_argv) o…

---

## [Html -\> redcloth](https://www.ruby-forum.com/t/html-redcloth/107605)

<div class="topic-metadata">

**Author:** [@mikec](https://www.ruby-forum.com/u/mikec)\
**Replies:** 1\
**Last updated:** [June 23, 2007, 11:19pm UTC](https://www.ruby-forum.com/t/html-redcloth/107605 "2007-06-23T23:19:51Z")

</div>

ok, mebbe i’m just plain stupid. i have an existing site or two with static html that i want to move over to a redcloth-supported site, so my annoying clients can maintain their own content on their oft-changing pages…

---

## [Eval going boom](https://www.ruby-forum.com/t/eval-going-boom/107382)

<div class="topic-metadata">

**Author:** [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Replies:** 15\
**Last updated:** [June 23, 2007, 10:27pm UTC](https://www.ruby-forum.com/t/eval-going-boom/107382 "2007-06-23T22:27:47Z")

</div>

Object X is going to be an exact clone of Object Y, but it’s a member of a different class. This does not work: x.attributes.each {|attr, value| eval(“y.#{attr}= #{value}”)} irb says: (eval):1: warning: parenthesize…

---

## [Class variables in class\_eval](https://www.ruby-forum.com/t/class-variables-in-class-eval/107229)

<div class="topic-metadata">

**Author:** [@mslagell](https://www.ruby-forum.com/u/mslagell)\
**Replies:** 9\
**Last updated:** [June 23, 2007, 10:17pm UTC](https://www.ruby-forum.com/t/class-variables-in-class-eval/107229 "2007-06-23T22:17:45Z")

</div>

I’m confused, to say the least! I’m setting up caches on objects using a class variable. It all works well until I try to extract it out to a module to mixin to other objects: module HostBasedCache def setup\_cache(m…

---

## [Beginner's question on methods](https://www.ruby-forum.com/t/beginners-question-on-methods/107585)

<div class="topic-metadata">

**Author:** [@wpvanpaassen](https://www.ruby-forum.com/u/wpvanpaassen)\
**Replies:** 2\
**Last updated:** [June 23, 2007, 9:44pm UTC](https://www.ruby-forum.com/t/beginners-question-on-methods/107585 "2007-06-23T21:44:53Z")

</div>

I’m new to Ruby, having worked with Perl the past couple of years. I’m having trouble calling a method to increment a counter, and I’m assuming that the problem is with the scope of the variables? I’m getting the fol…

---

## [Land use](https://www.ruby-forum.com/t/land-use/107594)

<div class="topic-metadata">

**Author:** [@toadkicker](https://www.ruby-forum.com/u/toadkicker)\
**Replies:** 0\
**Last updated:** [June 23, 2007, 8:34pm UTC](https://www.ruby-forum.com/t/land-use/107594 "2007-06-23T20:34:32Z")

</div>

Okay, I was going to make the subject “Trepidus use of Ruby, again” just to make a bunch of people mad (and also catch their attention). I think there is a really cool Ruby quiz in here that I just don’t know how to w…

---

## [Is $! thread safe?](https://www.ruby-forum.com/t/is-thread-safe/107549)

<div class="topic-metadata">

**Author:** [@erikveen](https://www.ruby-forum.com/u/erikveen)\
**Replies:** 7\
**Last updated:** [June 23, 2007, 8:02pm UTC](https://www.ruby-forum.com/t/is-thread-safe/107549 "2007-06-23T20:02:24Z")

</div>

From the code below, it appears that $! is thread safe. Is it? Thanks. gegroet, Erik V. - http://www.erikveen.dds.nl/ OUTPUT: T=1 → \[1, :a, 1\] T=2 → \[2, :a, 2\] T=3 → \[3, :b, 2\] T=4 → \[4, :b, 1\] Thread.abort\_…

---

## [Viewing some links!](https://www.ruby-forum.com/t/viewing-some-links/107587)

<div class="topic-metadata">

**Author:** [@feduz](https://www.ruby-forum.com/u/feduz)\
**Replies:** 1\
**Last updated:** [June 23, 2007, 7:17pm UTC](https://www.ruby-forum.com/t/viewing-some-links/107587 "2007-06-23T19:17:01Z")

</div>

Hello everyone hope u r doing great… \[sorry if i doubled posted this ididnt know which is the right place to do so the other post is on RoR forum (http://www.ruby-forum.com/topic/112870#new)\] Im a almost three weeks o…

---

## [Globals not incrementing inside block](https://www.ruby-forum.com/t/globals-not-incrementing-inside-block/106173)

<div class="topic-metadata">

**Author:** [@Todd\_ASJacobs](https://www.ruby-forum.com/u/Todd_ASJacobs)\
**Replies:** 12\
**Last updated:** [June 23, 2007, 6:57pm UTC](https://www.ruby-forum.com/t/globals-not-incrementing-inside-block/106173 "2007-06-23T18:57:34Z")

</div>

I have the following snippet: at\_exit do $total\_count, $daily\_count = 0, 0 IO.foreach(my\_logfile) do |line| $total\_count.next $daily\_count.next if line =~ /^#{Time.now.strftime(’%Y%m%d’)}/ end printf("\\ns Total: %…

---

## [Deadlock detection when main thread calls Thread.stop](https://www.ruby-forum.com/t/deadlock-detection-when-main-thread-calls-thread-stop/107578)

<div class="topic-metadata">

**Author:** [@sheepman](https://www.ruby-forum.com/u/sheepman)\
**Replies:** 1\
**Last updated:** [June 23, 2007, 5:01pm UTC](https://www.ruby-forum.com/t/deadlock-detection-when-main-thread-calls-thread-stop/107578 "2007-06-23T17:01:10Z")

</div>

e$B$3$s$P$s$O!"e(Bsheepman e$B$G$9!#e(B e$B:Y$+$$OC$G$9$,!#7k2LE\*$K%a%$%s%9%l%C%I$@$1$,e(B Thread.stop e$B$7$F$$$k\>uBV$Ke(B e$B$J$C$?;~$K!“e(Bdeadlock e$B$NNc30$,H/@8$7$J$$$N$O$=$&$$$&$b$N$J$N$G$7$g$&$+!#e(B e$B%a%$…

---

## [Ruby on rail is fast?](https://www.ruby-forum.com/t/ruby-on-rail-is-fast/107568)

<div class="topic-metadata">

**Author:** [@howa](https://www.ruby-forum.com/u/howa)\
**Replies:** 1\
**Last updated:** [June 23, 2007, 2:57pm UTC](https://www.ruby-forum.com/t/ruby-on-rail-is-fast/107568 "2007-06-23T14:57:57Z")

</div>

i have been using our custom framework for apps development, and generally is it pretty fast… anyone has experience in using ruby on rails and face performance issue which made you need to modify the framework itself? …

---

## [Read individual words from input?](https://www.ruby-forum.com/t/read-individual-words-from-input/107565)

<div class="topic-metadata">

**Author:** [@keriostar](https://www.ruby-forum.com/u/keriostar)\
**Replies:** 4\
**Last updated:** [June 23, 2007, 2:05pm UTC](https://www.ruby-forum.com/t/read-individual-words-from-input/107565 "2007-06-23T14:05:45Z")

</div>

Hello folks, I’m a semi-newbie C++ programmer and a total newbie Ruby programmer, so please bear with my incompetence. In C++, as I’m sure most of you know, it’s possible to read individual “words” into string variab…

---

## [Traits in Ruby](https://www.ruby-forum.com/t/traits-in-ruby/107476)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 2\
**Last updated:** [June 23, 2007, 1:22pm UTC](https://www.ruby-forum.com/t/traits-in-ruby/107476 "2007-06-23T13:22:45Z")

</div>

Hello everybody ! I just read a nice article about traits and now I’m wondering if they’re on the roadmap of ruby. I read that matz said something about them on the Ruby Conference 2005, but are there concrete plans …

---

## [Looking for minimalist ruby](https://www.ruby-forum.com/t/looking-for-minimalist-ruby/107494)

<div class="topic-metadata">

**Author:** [@soliton](https://www.ruby-forum.com/u/soliton)\
**Replies:** 11\
**Last updated:** [June 23, 2007, 12:03pm UTC](https://www.ruby-forum.com/t/looking-for-minimalist-ruby/107494 "2007-06-23T12:03:38Z")

</div>

Does any body know if there is ruby binary not greater than 1MB? It would be better if smaller, because it would be implemented in space constraint application like embedded linux system. TIA

---

## [Cannot dump FeedNormalizer Feed objects using YAML](https://www.ruby-forum.com/t/cannot-dump-feednormalizer-feed-objects-using-yaml/107563)

<div class="topic-metadata">

**Author:** [@Shajith\_C\_T](https://www.ruby-forum.com/u/Shajith_C_T)\
**Replies:** 2\
**Last updated:** [June 23, 2007, 10:19am UTC](https://www.ruby-forum.com/t/cannot-dump-feednormalizer-feed-objects-using-yaml/107563 "2007-06-23T10:19:29Z")

</div>

Hi, I’m downloading and parsing an RSS/Atom feed using open-uri and feed-normalizer and trying to save the parsed feed as yaml. Sample code below: %w(rubygems open-uri feed-normalizer yaml).each {|lib| require lib} …

---

## [Xml newbie](https://www.ruby-forum.com/t/xml-newbie/107551)

<div class="topic-metadata">

**Author:** [@banry](https://www.ruby-forum.com/u/banry)\
**Replies:** 4\
**Last updated:** [June 23, 2007, 6:22am UTC](https://www.ruby-forum.com/t/xml-newbie/107551 "2007-06-23T06:22:14Z")

</div>

Okay, so I am scraping the FAA site and keeping track of some airplanes. A lot of the time I get a tail number and I have it already, so I am going to store the important information in a file that is {tailnumber}.xml …

---

## [Eval, bindings and scope](https://www.ruby-forum.com/t/eval-bindings-and-scope/107530)

<div class="topic-metadata">

**Author:** [@guest](https://www.ruby-forum.com/u/guest)\
**Replies:** 4\
**Last updated:** [June 23, 2007, 5:59am UTC](https://www.ruby-forum.com/t/eval-bindings-and-scope/107530 "2007-06-23T05:59:11Z")

</div>

hey i have a question: if i do this in the top level: foo = lambda {p a} eval “a=1” foo.call It doesn’t work, giving me a NameError: undefined variable or method in main:Object but whats perhaps wierder, is if …

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

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