# Ruby

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

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

---

## [Precedence of '|' and '^' differs from the C language](https://www.ruby-forum.com/t/precedence-of-and-differs-from-the-c-language/157174)

<div class="topic-metadata">

**Author:** [@Yutaka\_HARA](https://www.ruby-forum.com/u/Yutaka_HARA)\
**Replies:** 1\
**Last updated:** [January 8, 2009, 5:11am UTC](https://www.ruby-forum.com/t/precedence-of-and-differs-from-the-c-language/157174 "2009-01-08T05:11:36Z")

</div>

e$B86e(B e$BM\*$H?=$7$^$9!#e(B e$B1i;;;R!Ve(B|e$B!W$H!Ve(B^e$B!W$NM%@h=g0L$,e(BCe$B8@8le(B/C#/Javae$BEy$H0\[$J$k$h$&$J$N$G$9$,!"$3e(B e$B$l$O0U?^$5$l$?$b$N$J$N$G$7$g$&$+!#e(B e$BNc$($P!Ve(B1 | 2 ^ 3e$B!W$H$$$&\<0$O!"e(B …

---

## [\[Bug #978\](Closed) Range#step $B$H(B Integer#step $B$N?6Iq$$$N0c$$(B](https://www.ruby-forum.com/t/bug-978-closed-range-step-b-h-b-integer-step-b-n-6iq-n0c-b/157171)

<div class="topic-metadata">

**Author:** [@Yukihiro\_M](https://www.ruby-forum.com/u/Yukihiro_M)\
**Replies:** 0\
**Last updated:** [January 8, 2009, 3:45am UTC](https://www.ruby-forum.com/t/bug-978-closed-range-step-b-h-b-integer-step-b-n-6iq-n0c-b/157171 "2009-01-08T03:45:38Z")

</div>

e$B%A%1%C%He(B #978 e$B$,99?7$5$l$^$7$?!#e(B (by Yukihiro M.) e$B%9%F!\<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B fixed in r21298 and r21330. http://redmine.ruby-lang.org/issues/show/978

---

## [Creating custom lib/tasks folder for rake files?](https://www.ruby-forum.com/t/creating-custom-lib-tasks-folder-for-rake-files/157161)

<div class="topic-metadata">

**Author:** [@andreux](https://www.ruby-forum.com/u/andreux)\
**Replies:** 3\
**Last updated:** [January 8, 2009, 1:15am UTC](https://www.ruby-forum.com/t/creating-custom-lib-tasks-folder-for-rake-files/157161 "2009-01-08T01:15:50Z")

</div>

How can I setup my own lib/tasks folder (similar to rails) so that all tasks in this folder are available when running rake? Everything I’ve tried so far has been unsuccessful. I get errors even when trying to require…

---

## [Multiple commands in shell](https://www.ruby-forum.com/t/multiple-commands-in-shell/157128)

<div class="topic-metadata">

**Author:** [@gustav](https://www.ruby-forum.com/u/gustav)\
**Replies:** 6\
**Last updated:** [January 7, 2009, 11:20pm UTC](https://www.ruby-forum.com/t/multiple-commands-in-shell/157128 "2009-01-07T23:20:23Z")

</div>

I’m trying to run multiple commands in the shell from ruby but I can’t seem to grasp how I keep the “state” from the previous shell command. For example, how would I perform the following sequence of commands in ruby: …

---

## [Beginner Help -- Txt game](https://www.ruby-forum.com/t/beginner-help-txt-game/157153)

<div class="topic-metadata">

**Author:** [@ezrick](https://www.ruby-forum.com/u/ezrick)\
**Replies:** 0\
**Last updated:** [January 7, 2009, 11:00pm UTC](https://www.ruby-forum.com/t/beginner-help-txt-game/157153 "2009-01-07T23:00:05Z")

</div>

Last time I posted here I was delightfully surprised at the assistance I got. I made a text game on my TI-83+ in high school and figured it would be a good learning experience to recreate that in ruby. I figured I co…

---

## [Novice question about rdoc](https://www.ruby-forum.com/t/novice-question-about-rdoc/157035)

<div class="topic-metadata">

**Author:** [@LAMBEAU\_Bernard](https://www.ruby-forum.com/u/LAMBEAU_Bernard)\
**Replies:** 2\
**Last updated:** [January 7, 2009, 10:52pm UTC](https://www.ruby-forum.com/t/novice-question-about-rdoc/157035 "2009-01-07T22:52:04Z")

</div>

I’ve got a stupid problem with rdoc, and I don’t find any answer on the web. Sorry … Is there an option to force rdoc to generate the html documentation each time it is invoked? I use the following task in Rakefile: d…

---

## [ScratchPad versus Channel in RubySpec](https://www.ruby-forum.com/t/scratchpad-versus-channel-in-rubyspec/157090)

<div class="topic-metadata">

**Author:** [@Shri\_B](https://www.ruby-forum.com/u/Shri_B)\
**Replies:** 1\
**Last updated:** [January 7, 2009, 9:33pm UTC](https://www.ruby-forum.com/t/scratchpad-versus-channel-in-rubyspec/157090 "2009-01-07T21:33:35Z")

</div>

Many tests use Channel to collect data that needs to be tested. For example, the following in inspect\_spec.rb. compliant\_on(:ruby) do it “reports aborting on a killed thread” do c = Channel.new t = Thread.new { c \<\< …

---

## [Compliant\_on(:ruby) in RubySpecs](https://www.ruby-forum.com/t/compliant-on-ruby-in-rubyspecs/157089)

<div class="topic-metadata">

**Author:** [@Shri\_B](https://www.ruby-forum.com/u/Shri_B)\
**Replies:** 3\
**Last updated:** [January 7, 2009, 9:33pm UTC](https://www.ruby-forum.com/t/compliant-on-ruby-in-rubyspecs/157089 "2009-01-07T21:33:00Z")

</div>

I noticed that besides not\_compliant\_on to disable tests on specific Ruby implementations, there is also compliant\_on to enable tests only on selected implementations. There are ~120 such instances. To make IronRuby c…

---

## [Comments in the RubySpec tag files](https://www.ruby-forum.com/t/comments-in-the-rubyspec-tag-files/157086)

<div class="topic-metadata">

**Author:** [@Shri\_B](https://www.ruby-forum.com/u/Shri_B)\
**Replies:** 3\
**Last updated:** [January 7, 2009, 9:14pm UTC](https://www.ruby-forum.com/t/comments-in-the-rubyspec-tag-files/157086 "2009-01-07T21:14:11Z")

</div>

I added a few comments to critical\_tags.txt like this: fails(“need to track which thread owns critical lock”):Thread.critical defers exit This will help the next person who tries to fix the bug, and also as just docu…

---

## [Should equal in RubySpecs](https://www.ruby-forum.com/t/should-equal-in-rubyspecs/157092)

<div class="topic-metadata">

**Author:** [@Shri\_B](https://www.ruby-forum.com/u/Shri_B)\
**Replies:** 3\
**Last updated:** [January 7, 2009, 8:58pm UTC](https://www.ruby-forum.com/t/should-equal-in-rubyspecs/157092 "2009-01-07T20:58:41Z")

</div>

I noticed this in core\\thread\\current\_spec.rb. it “returns the current thread” do t = Thread.new { Thread.current } t.value.should equal(t) Thread.current.should\_not equal(t.value) end Is this any different than wr…

---

## [Ruby version at ruby-doc.org](https://www.ruby-forum.com/t/ruby-version-at-ruby-doc-org/157142)

<div class="topic-metadata">

**Author:** [@Shri\_B](https://www.ruby-forum.com/u/Shri_B)\
**Replies:** 1\
**Last updated:** [January 7, 2009, 8:56pm UTC](https://www.ruby-forum.com/t/ruby-version-at-ruby-doc-org/157142 "2009-01-07T20:56:13Z")

</div>

What Ruby version does ruby-doc.org refer to? The main page has links to 1.8.6, 1.8.7, and 1.9. Following 1.8.6 for Thread takes me to class Thread - RDoc Documentation which lists Thread.exclusive as an api. However,…

---

## [Thread status tests](https://www.ruby-forum.com/t/thread-status-tests/157091)

<div class="topic-metadata">

**Author:** [@Shri\_B](https://www.ruby-forum.com/u/Shri_B)\
**Replies:** 2\
**Last updated:** [January 7, 2009, 8:44pm UTC](https://www.ruby-forum.com/t/thread-status-tests/157091 "2009-01-07T20:44:28Z")

</div>

There are four ways to check the status of threads, Thread#status, Thread#inspect, Thread#alive?, and Thread#stop?. Any objection to adding a single shared file which checks the result of all the four APIs? It won’t f…

---

## [Dynamically Adding Properties Files To Classpath](https://www.ruby-forum.com/t/dynamically-adding-properties-files-to-classpath/157051)

<div class="topic-metadata">

**Author:** [@Tom\_E\_Purl](https://www.ruby-forum.com/u/Tom_E_Purl)\
**Replies:** 2\
**Last updated:** [January 7, 2009, 7:34pm UTC](https://www.ruby-forum.com/t/dynamically-adding-properties-files-to-classpath/157051 "2009-01-07T19:34:12Z")

</div>

I am writing a script that references a few Java libraries that expect some “.properties” files to be in the classpath. I can set the classpath in the shell before I run the jruby executable, but it would be much ni…

---

## [Manage Rails/Merb apps using standard Java tools](https://www.ruby-forum.com/t/manage-rails-merb-apps-using-standard-java-tools/157139)

<div class="topic-metadata">

**Author:** [@arung](https://www.ruby-forum.com/u/arung)\
**Replies:** 0\
**Last updated:** [January 7, 2009, 6:29pm UTC](https://www.ruby-forum.com/t/manage-rails-merb-apps-using-standard-java-tools/157139 "2009-01-07T18:29:14Z")

</div>

Read more details at: http://blogs.sun.com/arungupta/entry/totd\_61\_how\_to\_locally The blog also lists other related entries coming in the near future. Thanks, -Arun – Application Platform, Sun Microsystems, Inc. B…

---

## [Highline - question with multiple choices](https://www.ruby-forum.com/t/highline-question-with-multiple-choices/153287)

<div class="topic-metadata">

**Author:** [@g0nzo](https://www.ruby-forum.com/u/g0nzo)\
**Replies:** 13\
**Last updated:** [January 7, 2009, 6:06pm UTC](https://www.ruby-forum.com/t/highline-question-with-multiple-choices/153287 "2009-01-07T18:06:10Z")

</div>

Hi, I’ve got an array of user logins and need to provide a way to select one or more of them with auto-completion. Currently I’ve got code straight from readline example: users = ask("Select users: ", user\_logins) do…

---

## [\[Bug #974\] Range#max $B$G=\*N;$7$J$$$3$H$,$"$k(B](https://www.ruby-forum.com/t/bug-974-range-max-b-g-n-7-j-3-h-k-b/156826)

<div class="topic-metadata">

**Author:** [@tadayoshi\_funaba](https://www.ruby-forum.com/u/tadayoshi_funaba)\
**Replies:** 5\
**Last updated:** [January 7, 2009, 4:51pm UTC](https://www.ruby-forum.com/t/bug-974-range-max-b-g-n-7-j-3-h-k-b/156826 "2009-01-07T16:51:14Z")

</div>

Bug #974: Range#max e$B$G=\*N;$7$J$$$3$H$,$"$ke(B http://redmine.ruby-lang.org/issues/show/974 e$B5/I\<\<Te(B: tadayoshi funaba e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal e$B0J2\<$N$h$&$K$9$k$H=\*N;$7$J$$$h$&$G$9!#e(B $…

---

## [Changing date backward messes up threaded sleep](https://www.ruby-forum.com/t/changing-date-backward-messes-up-threaded-sleep/113411)

<div class="topic-metadata">

**Author:** [@eclubb](https://www.ruby-forum.com/u/eclubb)\
**Replies:** 12\
**Last updated:** [January 7, 2009, 4:41pm UTC](https://www.ruby-forum.com/t/changing-date-backward-messes-up-threaded-sleep/113411 "2009-01-07T16:41:46Z")

</div>

Can anyone explain this behavior? If the system time is set backward, the sleep method in the thread sleeps until the system clock has caught back up to the original time. The main thread does not display this behav…

---

## [Anyone knows this warning?](https://www.ruby-forum.com/t/anyone-knows-this-warning/156989)

<div class="topic-metadata">

**Author:** [@youhaodeyi](https://www.ruby-forum.com/u/youhaodeyi)\
**Replies:** 6\
**Last updated:** [January 7, 2009, 2:57pm UTC](https://www.ruby-forum.com/t/anyone-knows-this-warning/156989 "2009-01-07T14:57:37Z")

</div>

When my ruby runs an external program, it will get this warning: warning: Insecure world writable dir SOMEDIR I have checked the SOMEDIR and its permission mode is 777. Does anyone know this warning? How can I avoid t…

---

## [A question about running external program](https://www.ruby-forum.com/t/a-question-about-running-external-program/157088)

<div class="topic-metadata">

**Author:** [@youhaodeyi](https://www.ruby-forum.com/u/youhaodeyi)\
**Replies:** 4\
**Last updated:** [January 7, 2009, 2:03pm UTC](https://www.ruby-forum.com/t/a-question-about-running-external-program/157088 "2009-01-07T14:03:47Z")

</div>

I use this method to run an external program: output=uname -r | sed 's/\\(\[^\\.\]\*\\.\[^\\.\]\*\\)\\.\*.\*/\\1/' puts output ruby will ignore the sed command. Doesn’t ruby support “|”?

---

## [IRB doesn't prompt for MSWin32](https://www.ruby-forum.com/t/irb-doesnt-prompt-for-mswin32/156823)

<div class="topic-metadata">

**Author:** [@arton](https://www.ruby-forum.com/u/arton)\
**Replies:** 10\
**Last updated:** [January 7, 2009, 1:48pm UTC](https://www.ruby-forum.com/t/irb-doesnt-prompt-for-mswin32/156823 "2009-01-07T13:48:09Z")

</div>

artone$B$G$9!#e(B Ruby-1.9.1-RC1e$B$Ne(BIRBe$B$G!"%W%m%s%W%H$HF~NO$N%(%3!\<%P%C%/$,I=\<($5$l$^$;$s!#e(B e$B!Je(BMSWin32e$B!"e(BVC++6e$B!Ke(B irb/input-method.rbe$B$N0J2\<$N=$@5$GI=\<($5$l$k$h$&$K$J$C$?$N$G$9$,!"K\\Ev$Ke(B …

---

## [Run gems out of jar files without having to unpack them ?!](https://www.ruby-forum.com/t/run-gems-out-of-jar-files-without-having-to-unpack-them/157112)

<div class="topic-metadata">

**Author:** [@alisajjad\_mushtaq](https://www.ruby-forum.com/u/alisajjad_mushtaq)\
**Replies:** 0\
**Last updated:** [January 7, 2009, 1:11pm UTC](https://www.ruby-forum.com/t/run-gems-out-of-jar-files-without-having-to-unpack-them/157112 "2009-01-07T13:11:37Z")

</div>

Dear All, I just checked out the latest comments of the jruby 1.1.6 and noticed the following text: “Run gems out of jar files without having to unpack them.” Then I tried to experience it myself by getting the sourc…

---

## [More gem trouble but different now](https://www.ruby-forum.com/t/more-gem-trouble-but-different-now/157110)

<div class="topic-metadata">

**Author:** [@barby](https://www.ruby-forum.com/u/barby)\
**Replies:** 0\
**Last updated:** [January 7, 2009, 12:40pm UTC](https://www.ruby-forum.com/t/more-gem-trouble-but-different-now/157110 "2009-01-07T12:40:52Z")

</div>

Hi I got the latest svn revision for ironruby (r. 182). I tried upgrading rubygems to version 1.3.1 (rails 2.2.2 needs it) And it has a similar problem with the path name. it fails with a directory not found exceptio…

---

## [How does MP4 encoding work?](https://www.ruby-forum.com/t/how-does-mp4-encoding-work/157109)

<div class="topic-metadata">

**Author:** [@Larz](https://www.ruby-forum.com/u/Larz)\
**Replies:** 0\
**Last updated:** [January 7, 2009, 12:34pm UTC](https://www.ruby-forum.com/t/how-does-mp4-encoding-work/157109 "2009-01-07T12:34:59Z")

</div>

I am curious on how MP4 files are encoded and why is it that I can only play my MP4 files in ITunes ? Obviously there is some protection involved, but it has aroused my curiosity of how it works. Are there ruby gems t…

---

## [Running gem on an "old" computer](https://www.ruby-forum.com/t/running-gem-on-an-old-computer/157100)

<div class="topic-metadata">

**Author:** [@alby](https://www.ruby-forum.com/u/alby)\
**Replies:** 0\
**Last updated:** [January 7, 2009, 11:34am UTC](https://www.ruby-forum.com/t/running-gem-on-an-old-computer/157100 "2009-01-07T11:34:36Z")

</div>

I’m using gem version 1.1.1. I’m trying to update some gems I have. I do “gem update gem\_name” and gem is stuck on: Bulk updating Gem source index for: http://gems.rubyforge.org/ It takes ages and trashes my swap spa…

---

## [Wot is the syntax of form tag?](https://www.ruby-forum.com/t/wot-is-the-syntax-of-form-tag/157084)

<div class="topic-metadata">

**Author:** [@Muhammad\_mohsin\_ali](https://www.ruby-forum.com/u/Muhammad_mohsin_ali)\
**Replies:** 1\
**Last updated:** [January 7, 2009, 11:30am UTC](https://www.ruby-forum.com/t/wot-is-the-syntax-of-form-tag/157084 "2009-01-07T11:30:34Z")

</div>

wot is the syntax of form tag?

---

## [Could not understand this: 3.class is Fixnum or Class](https://www.ruby-forum.com/t/could-not-understand-this-3-class-is-fixnum-or-class/157078)

<div class="topic-metadata">

**Author:** [@sentinel](https://www.ruby-forum.com/u/sentinel)\
**Replies:** 4\
**Last updated:** [January 7, 2009, 8:59am UTC](https://www.ruby-forum.com/t/could-not-understand-this-3-class-is-fixnum-or-class/157078 "2009-01-07T08:59:33Z")

</div>

I stored the class of a variable in a variable and later checked in a switch-case. Instead of going into the Fixnum case, it goes into ELSE. c=23.class # =\> Fixnum c == Fixnum # =\> true case c; when Fixnum; puts “Y…

---

## [What would be the easiest/fastest way to convert Hash keys](https://www.ruby-forum.com/t/what-would-be-the-easiest-fastest-way-to-convert-hash-keys/157085)

<div class="topic-metadata">

**Author:** [@juuser](https://www.ruby-forum.com/u/juuser)\
**Replies:** 0\
**Last updated:** [January 7, 2009, 8:51am UTC](https://www.ruby-forum.com/t/what-would-be-the-easiest-fastest-way-to-convert-hash-keys/157085 "2009-01-07T08:51:10Z")

</div>

Hello. I was wondering, what would be the easiest and fastest way to convert Hash keys from Symbol objects to String? I came up with something like this, but I think that maybe there’s some better Ruby-way to do it: …

---

## [Simple Regexp help](https://www.ruby-forum.com/t/simple-regexp-help/157062)

<div class="topic-metadata">

**Author:** [@joe-black](https://www.ruby-forum.com/u/joe-black)\
**Replies:** 6\
**Last updated:** [January 7, 2009, 8:45am UTC](https://www.ruby-forum.com/t/simple-regexp-help/157062 "2009-01-07T08:45:29Z")

</div>

How can I test a word to make sure it ONLY contains certain characters? Say i have an expression like /\[A-Z\]/i How could i have “Testing” pass but “Testing123” fail? PS. I can not dynamically create the expression so …

---

## [Noob question: object to string](https://www.ruby-forum.com/t/noob-question-object-to-string/156942)

<div class="topic-metadata">

**Author:** [@dginther](https://www.ruby-forum.com/u/dginther)\
**Replies:** 7\
**Last updated:** [January 7, 2009, 8:18am UTC](https://www.ruby-forum.com/t/noob-question-object-to-string/156942 "2009-01-07T08:18:31Z")

</div>

So I’m able to exercise creating my own class and returning an object from that class. I’m having trouble treating the return as an integer (for the purpose of a \< or \> compare)… Yet another noob syntax question. co…

---

## [To get IP addres of the machine](https://www.ruby-forum.com/t/to-get-ip-addres-of-the-machine/156986)

<div class="topic-metadata">

**Author:** [@sijo](https://www.ruby-forum.com/u/sijo)\
**Replies:** 6\
**Last updated:** [January 7, 2009, 7:03am UTC](https://www.ruby-forum.com/t/to-get-ip-addres-of-the-machine/156986 "2009-01-07T07:03:13Z")

</div>

Hi Could you please tell the code to get the IPaddress of my machine Sijo

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

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