# Ruby

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

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

---

## [\[trunk\]fail to compile mingw32 on Cygwin](https://www.ruby-forum.com/t/trunk-fail-to-compile-mingw32-on-cygwin/149261)

<div class="topic-metadata">

**Author:** [@Masaki\_S](https://www.ruby-forum.com/u/Masaki_S)\
**Replies:** 2\
**Last updated:** [September 24, 2008, 1:41pm UTC](https://www.ruby-forum.com/t/trunk-fail-to-compile-mingw32-on-cygwin/149261 "2008-09-24T13:41:10Z")

</div>

e$B=uED$G$9!#e(B Cygwine$B$^$?$O;d$N4D6-$NLdBj$N$h$&$J5$$,$9$k$N$G$9$,0l1~Js9p$7$F$\*$-$^$9!#e(B trunke$B$NOC$G$9!#e(B Cygwine$B\>e$Ge(B CC='gcc -mno-cygwin’e$B$Ge(Bmingw32e$BHGe(BRubye$B$r%3%s%Q%$%k$7$h$&$H$9$ke(B e$…

---

## [Understanding inheritance and class singleton methods](https://www.ruby-forum.com/t/understanding-inheritance-and-class-singleton-methods/149368)

<div class="topic-metadata">

**Author:** [@ittayd](https://www.ruby-forum.com/u/ittayd)\
**Replies:** 6\
**Last updated:** [September 24, 2008, 11:08am UTC](https://www.ruby-forum.com/t/understanding-inheritance-and-class-singleton-methods/149368 "2008-09-24T11:08:36Z")

</div>

Hi, I’ll start with what I understand: class Foo class \<\< self def hi puts ‘HI’ end end end Creates an instance of a singleton class that has the method #hi. So Foo.hi calls the method defined in the class of F…

---

## [\[Bug #591\](Closed) io.c $B$N(B rb\_io\_extract\_modeenc $B$GJQ?t(B has\_vmode $B$OITMQ$+(B?](https://www.ruby-forum.com/t/bug-591-closed-io-c-b-n-b-rb-io-extract-modeenc-b-gjq-t-b-has-vmode-b-oitmq-b/149376)

<div class="topic-metadata">

**Author:** [@Martin\_DSSS\_rst](https://www.ruby-forum.com/u/Martin_DSSS_rst)\
**Replies:** 1\
**Last updated:** [September 24, 2008, 10:35am UTC](https://www.ruby-forum.com/t/bug-591-closed-io-c-b-n-b-rb-io-extract-modeenc-b-gjq-t-b-has-vmode-b-oitmq-b/149376 "2008-09-24T10:35:33Z")

</div>

e$B%A%1%C%He(B #591 e$B$,99?7$5$l$^$7$?!#e(B (by Martin De$(D+de(Brst) e$B%9%F!\<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B e$B$4$a$s$J$5$$!#$3$A$i$N4\*0c$$$G$7$?!#e(Bgoto e$B$^$GFI$a$J$+$C$?$G$9!#e(B http://redmine.ruby…

---

## [\[Bug: 1.9\] tmpdir on mswin32](https://www.ruby-forum.com/t/bug-1-9-tmpdir-on-mswin32/149363)

<div class="topic-metadata">

**Author:** [@SASADA\_Koichi](https://www.ruby-forum.com/u/SASADA_Koichi)\
**Replies:** 9\
**Last updated:** [September 24, 2008, 10:33am UTC](https://www.ruby-forum.com/t/bug-1-9-tmpdir-on-mswin32/149363 "2008-09-24T10:33:45Z")

</div>

e$B!!$5$5$@$G$9!%e(B e$B!!e(Btmpdir e$B=i4|2=;~!$e(BWin32API e$B$Ne(B SHGetFolderPath e$B$G%Q%9$r\<h$C$F$/$ke(B e$B$H!$KvHx$Ke(B nul e$B$,F~$k$?$a!$e(Bexpand\_path e$B$,\<:GT$9$k$h$&$G$9!Je(Brstrip e$B$7e(B e$B$F$be(B …

---

## [Trouble running 'rubyscript2exe' for compiling my code](https://www.ruby-forum.com/t/trouble-running-rubyscript2exe-for-compiling-my-code/149300)

<div class="topic-metadata">

**Author:** [@rubist](https://www.ruby-forum.com/u/rubist)\
**Replies:** 4\
**Last updated:** [September 24, 2008, 10:23am UTC](https://www.ruby-forum.com/t/trouble-running-rubyscript2exe-for-compiling-my-code/149300 "2008-09-24T10:23:47Z")

</div>

All, I am getting the following error while to execute the rubyscript2exe : have the following on my system: 1)ruby 2)gem installed rubyscript2exe Have i missed out on anything else? I get the below mentioned erro…

---

## [\[Bug #591\] io.c $B$N(B rb\_io\_extract\_modeenc $B$GJQ?t(B has\_vmode $B$OITMQ$+(B?](https://www.ruby-forum.com/t/bug-591-io-c-b-n-b-rb-io-extract-modeenc-b-gjq-t-b-has-vmode-b-oitmq-b/149374)

<div class="topic-metadata">

**Author:** [@Martin\_DSSS\_rst](https://www.ruby-forum.com/u/Martin_DSSS_rst)\
**Replies:** 0\
**Last updated:** [September 24, 2008, 9:54am UTC](https://www.ruby-forum.com/t/bug-591-io-c-b-n-b-rb-io-extract-modeenc-b-gjq-t-b-has-vmode-b-oitmq-b/149374 "2008-09-24T09:54:58Z")

</div>

Bug #591: io.c e$B$Ne(B rb\_io\_extract\_modeenc e$B$GJQ?te(B has\_vmode e$B$OITMQ$+e(B? http://redmine.ruby-lang.org/issues/show/591 e$B5/I\<\<Te(B: Martin De$(D+de(Brst e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Low e$BC4Ev\<T…

---

## [Using Ruby as a scripting language within a C app](https://www.ruby-forum.com/t/using-ruby-as-a-scripting-language-within-a-c-app/149166)

<div class="topic-metadata">

**Author:** [@forgottenwizard](https://www.ruby-forum.com/u/forgottenwizard)\
**Replies:** 7\
**Last updated:** [September 24, 2008, 5:02am UTC](https://www.ruby-forum.com/t/using-ruby-as-a-scripting-language-within-a-c-app/149166 "2008-09-24T05:02:50Z")

</div>

I’m working on building a MUD, and I would like to be able to use Ruby as the scripting language within the MUD (such as with mobiles, rooms, objects, ect). I would like someone to give me an idea on how to do this, a…

---

## [Inviting Talk Proposals for the Great Lakes Ruby Bash](https://www.ruby-forum.com/t/inviting-talk-proposals-for-the-great-lakes-ruby-bash/149364)

<div class="topic-metadata">

**Author:** [@Eric\_I](https://www.ruby-forum.com/u/Eric_I)\
**Replies:** 0\
**Last updated:** [September 24, 2008, 4:52am UTC](https://www.ruby-forum.com/t/inviting-talk-proposals-for-the-great-lakes-ruby-bash/149364 "2008-09-24T04:52:54Z")

</div>

We are pleased to announce that we are accepting talk proposals for the Great Lakes Ruby Bash to be held in Ann Arbor, Mich. on Saturday, October 11th. Talks that are either 30 minutes or 1 hour in length are requeste…

---

## [Exiting ri on a mac terminal](https://www.ruby-forum.com/t/exiting-ri-on-a-mac-terminal/149352)

<div class="topic-metadata">

**Author:** [@rubyfreak](https://www.ruby-forum.com/u/rubyfreak)\
**Replies:** 6\
**Last updated:** [September 24, 2008, 3:57am UTC](https://www.ruby-forum.com/t/exiting-ri-on-a-mac-terminal/149352 "2008-09-24T03:57:19Z")

</div>

Hi, I’ve been avoiding using ri for my docs because when I type it I can’t seem to exit out of it without closing terminal. I’ve tried all the usual suspects like ctrl-c, ctrl-d, esc. Any ideas on what I might be do…

---

## [Open-uri fetches outdated content vs. curl](https://www.ruby-forum.com/t/open-uri-fetches-outdated-content-vs-curl/148890)

<div class="topic-metadata">

**Author:** [@dcarneiro](https://www.ruby-forum.com/u/dcarneiro)\
**Replies:** 4\
**Last updated:** [September 24, 2008, 2:17am UTC](https://www.ruby-forum.com/t/open-uri-fetches-outdated-content-vs-curl/148890 "2008-09-24T02:17:18Z")

</div>

Try running the following program: ================ require ‘open-uri’ feed\_url = “Slate Magazine” result1 = open(feed\_url).read puts “Saving result1.xml:” File.open(“result1.xml”, “w”) {|f| f.write(result1)} resu…

---

## [Re-factoring a browser class](https://www.ruby-forum.com/t/re-factoring-a-browser-class/149359)

<div class="topic-metadata">

**Author:** [@aidy](https://www.ruby-forum.com/u/aidy)\
**Replies:** 0\
**Last updated:** [September 24, 2008, 1:24am UTC](https://www.ruby-forum.com/t/re-factoring-a-browser-class/149359 "2008-09-24T01:24:39Z")

</div>

Hi, I have a large Watir Browser class. It relates to specific actions I can do upon a browser. I was thinking of creating separately named files and re-opening the class; however a colleague of mine wants to use num…

---

## [Tomcat, JRuby, and session rebinding problem](https://www.ruby-forum.com/t/tomcat-jruby-and-session-rebinding-problem/149356)

<div class="topic-metadata">

**Author:** [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Replies:** 0\
**Last updated:** [September 24, 2008, 12:30am UTC](https://www.ruby-forum.com/t/tomcat-jruby-and-session-rebinding-problem/149356 "2008-09-24T00:30:48Z")

</div>

I am having a session related problem with a JRuby 1.1.3 application on CentOS 5.2 under Tomcat 5.5.25 (Jpackage rpms) with Sun Java 1.6.0.7. When a server is taken out of service, any session that is bound to that to…

---

## [Code Review: EncodingX6](https://www.ruby-forum.com/t/code-review-encodingx6/149351)

<div class="topic-metadata">

**Author:** [@grujildo](https://www.ruby-forum.com/u/grujildo)\
**Replies:** 0\
**Last updated:** [September 23, 2008, 10:49pm UTC](https://www.ruby-forum.com/t/code-review-encodingx6/149351 "2008-09-23T22:49:20Z")

</div>

tfpt review “/shelveset:EncodingX6;REDMOND\\tomat” Adds RubyCompatibility enum that specifies the major version of Ruby that IronRuby should be compatible with. Adds -18, -19 and -20 command line options that switch th…

---

## [Great Lakes Ruby Bash -- Registration Now Open](https://www.ruby-forum.com/t/great-lakes-ruby-bash-registration-now-open/149348)

<div class="topic-metadata">

**Author:** [@Eric\_I](https://www.ruby-forum.com/u/Eric_I)\
**Replies:** 0\
**Last updated:** [September 23, 2008, 9:57pm UTC](https://www.ruby-forum.com/t/great-lakes-ruby-bash-registration-now-open/149348 "2008-09-23T21:57:40Z")

</div>

Hi Everyone, Registration is now open for the Great Lakes Ruby Bash. This is a one- day regional Ruby conference that will contain a mixture of 30-minute and 1-hour talks. Attendance is only $50 and includes lunch. …

---

## [Unable to start jruby](https://www.ruby-forum.com/t/unable-to-start-jruby/149341)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 0\
**Last updated:** [September 23, 2008, 9:17pm UTC](https://www.ruby-forum.com/t/unable-to-start-jruby/149341 "2008-09-23T21:17:43Z")

</div>

This happens to me on linux after a download of jruby: \[23:1316\]\[rdp@ilab2:~/dev/downloads/jruby-1.1.4/bin\]$ ./jruby Exception in thread “main” java.lang.NoClassDefFoundError: org/jruby/Main Caused by: java.lang.Clas…

---

## [Question on RubyGems](https://www.ruby-forum.com/t/question-on-rubygems/146164)

<div class="topic-metadata">

**Author:** [@mgiorno](https://www.ruby-forum.com/u/mgiorno)\
**Replies:** 11\
**Last updated:** [September 23, 2008, 7:45pm UTC](https://www.ruby-forum.com/t/question-on-rubygems/146164 "2008-09-23T19:45:47Z")

</div>

Hi all, Can I download the first binary release and install RubyGems, then install gems? Is it too early in the game? Are there any instructions on how to setup the environment. I would like to run Ramaze + Sequel on …

---

## [Ruby block as text](https://www.ruby-forum.com/t/ruby-block-as-text/149219)

<div class="topic-metadata">

**Author:** [@wolfmanjm](https://www.ruby-forum.com/u/wolfmanjm)\
**Replies:** 4\
**Last updated:** [September 23, 2008, 6:32pm UTC](https://www.ruby-forum.com/t/ruby-block-as-text/149219 "2008-09-23T18:32:50Z")

</div>

We want to be able to send a chunk of Ruby code (block/proc) to a server and have the code run there. The code is essentially used as the WHERE clause in an OO database select. The code needs to run on the db server,…

---

## [Shortcut for "if options.key?(:full)"?](https://www.ruby-forum.com/t/shortcut-for-if-options-key-full/149309)

<div class="topic-metadata">

**Author:** [@mrpete](https://www.ruby-forum.com/u/mrpete)\
**Replies:** 2\
**Last updated:** [September 23, 2008, 6:25pm UTC](https://www.ruby-forum.com/t/shortcut-for-if-options-key-full/149309 "2008-09-23T18:25:45Z")

</div>

If I pass an options hash into a def, how do I easily check to see if an option is set? This is how I’m doing it now: if options.key?(:some\_option) … end Knowing Ruby, there’s got to be a cleaner/better way! Pete

---

## [JRuby-Rack problems](https://www.ruby-forum.com/t/jruby-rack-problems/149159)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 7\
**Last updated:** [September 23, 2008, 6:19pm UTC](https://www.ruby-forum.com/t/jruby-rack-problems/149159 "2008-09-23T18:19:18Z")

</div>

Have switched from goldspike to jruby-rack 0.9.2, and overall it’s working OK. Using it with JBoss 4.0.5 with embedded Tomcat 5.5. Also using jruby 1.1.4. A couple of problems: If the contaxt pathname of the app se…

---

## [Ruby gem to watch file](https://www.ruby-forum.com/t/ruby-gem-to-watch-file/149127)

<div class="topic-metadata">

**Author:** [@Junkone](https://www.ruby-forum.com/u/Junkone)\
**Replies:** 4\
**Last updated:** [September 23, 2008, 5:54pm UTC](https://www.ruby-forum.com/t/ruby-gem-to-watch-file/149127 "2008-09-23T17:54:04Z")

</div>

is there any gem that will watch for a file and if the file exists, or changes, can trigger process or event. i am looking for something on the windows platform only. appreciate any help.

---

## [Learning WxRuby](https://www.ruby-forum.com/t/learning-wxruby/149303)

<div class="topic-metadata">

**Author:** [@snaggy](https://www.ruby-forum.com/u/snaggy)\
**Replies:** 2\
**Last updated:** [September 23, 2008, 5:16pm UTC](https://www.ruby-forum.com/t/learning-wxruby/149303 "2008-09-23T17:16:33Z")

</div>

I decided to learn WxRuby. I’d like a book or something about it, can you point me to some good resources? I don’t want to study from c++ or python stuff, only ruby… thanks Snaggy

---

## [Bug in WindowsFileStat in jna-posix](https://www.ruby-forum.com/t/bug-in-windowsfilestat-in-jna-posix/149211)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [September 23, 2008, 4:31pm UTC](https://www.ruby-forum.com/t/bug-in-windowsfilestat-in-jna-posix/149211 "2008-09-23T16:31:21Z")

</div>

I think I’ve found a problem in the jna-posix library. (Latest from trunk, and also the version in jruby-1.1.4) Running on Windows/Vista (32 bit) this comes up with complete nonsense for file sizes. I note from the ch…

---

## [\[Feature #583\] Tmpdir$B$H(BTempfile](https://www.ruby-forum.com/t/feature-583-tmpdir-b-h-btempfile/149184)

<div class="topic-metadata">

**Author:** [@Yuki\_S](https://www.ruby-forum.com/u/Yuki_S)\
**Replies:** 10\
**Last updated:** [September 23, 2008, 3:00pm UTC](https://www.ruby-forum.com/t/feature-583-tmpdir-b-h-btempfile/149184 "2008-09-23T15:00:03Z")

</div>

Feature #583: Tmpdire$B$He(BTempfile http://redmine.ruby-lang.org/issues/show/583 e$B5/I\<\<Te(B: Yuki S. e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal Tempfilee$B$Ke(BTmpfilee$B$H$$$&JLL\>$rIU$1$Fe(BTempfilee$B$Oe(B2.0e…

---

## [String#== is not transitive again](https://www.ruby-forum.com/t/string-is-not-transitive-again/149311)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 0\
**Last updated:** [September 23, 2008, 2:11pm UTC](https://www.ruby-forum.com/t/string-is-not-transitive-again/149311 "2008-09-23T14:11:05Z")

</div>

String#== e$B$,?d0\\N’$rK~$?$7$F$\*$i$:!"F1CM4X78$G$J$/$J$C$F$$$^e(B e$B$9!#e(B % ./ruby -ve ’ e = “\\xa1\\xa1”.force\_encoding(“euc-jp”) a = “\\xa1\\xa1”.force\_encoding(“ascii-8bit”) s = “\\xa1\\xa1”.force\_encoding(“sjis”) …

---

## [Optionally pass a parameter?](https://www.ruby-forum.com/t/optionally-pass-a-parameter/149310)

<div class="topic-metadata">

**Author:** [@mrpete](https://www.ruby-forum.com/u/mrpete)\
**Replies:** 1\
**Last updated:** [September 23, 2008, 1:57pm UTC](https://www.ruby-forum.com/t/optionally-pass-a-parameter/149310 "2008-09-23T13:57:31Z")

</div>

In general, how do you optionally pass an optional qualifier to a Ruby def? For example, for some model in Rails, like this: MyDBClass.find(:all, … How do I optionally add a condition? This generates a syntax error: …

---

## [Net/sftp problem](https://www.ruby-forum.com/t/net-sftp-problem/149307)

<div class="topic-metadata">

**Author:** [@ther](https://www.ruby-forum.com/u/ther)\
**Replies:** 1\
**Last updated:** [September 23, 2008, 1:38pm UTC](https://www.ruby-forum.com/t/net-sftp-problem/149307 "2008-09-23T13:38:23Z")

</div>

I am trying to transfer a file to remote server with net::sftp. require ‘rubygems’ require ‘net/sftp’ Net::SFTP.start(‘192.168.1.111’, ‘rems’, :password =\> ‘mypwd’) do |sftp| sftp.upload!(‘testSFTP.rb’, ‘/home/rems’…

---

## [Returning the names of each defined method](https://www.ruby-forum.com/t/returning-the-names-of-each-defined-method/149288)

<div class="topic-metadata">

**Author:** [@kain\_nobel](https://www.ruby-forum.com/u/kain_nobel)\
**Replies:** 2\
**Last updated:** [September 23, 2008, 11:23am UTC](https://www.ruby-forum.com/t/returning-the-names-of-each-defined-method/149288 "2008-09-23T11:23:49Z")

</div>

Good day everybody! I was curious, for code that isn’t veiwable, how would I print each defined method in a class/module? For instance… lets say that File happened to be a hidden class, how could I make the interprete…

---

## [To be not, or not to be not?](https://www.ruby-forum.com/t/to-be-not-or-not-to-be-not/149267)

<div class="topic-metadata">

**Author:** [@rubyfreak](https://www.ruby-forum.com/u/rubyfreak)\
**Replies:** 2\
**Last updated:** [September 23, 2008, 10:04am UTC](https://www.ruby-forum.com/t/to-be-not-or-not-to-be-not/149267 "2008-09-23T10:04:36Z")

</div>

That is not the question Code in question: module AuthenticatedSystem protected Returns true or false if the user is logged in. # Preloads @current\_user with the user model if they're logged in. def logged\_in? !!cu…

---

## [Subscribing to ruby-core](https://www.ruby-forum.com/t/subscribing-to-ruby-core/149251)

<div class="topic-metadata">

**Author:** [@fxn](https://www.ruby-forum.com/u/fxn)\
**Replies:** 2\
**Last updated:** [September 23, 2008, 9:48am UTC](https://www.ruby-forum.com/t/subscribing-to-ruby-core/149251 "2008-09-23T09:48:19Z")

</div>

I’ve tried to subscribe to ruby-core both via the web interface and direct email to removed\_email\_address@domain.invalid, but looks like something is not working properly (which could be me :-). I don’t get any confir…

---

## [Short regexp question](https://www.ruby-forum.com/t/short-regexp-question/148957)

<div class="topic-metadata">

**Author:** [@Fritzek](https://www.ruby-forum.com/u/Fritzek)\
**Replies:** 18\
**Last updated:** [September 23, 2008, 9:44am UTC](https://www.ruby-forum.com/t/short-regexp-question/148957 "2008-09-23T09:44:47Z")

</div>

Hi folks short question how to use regexp the right way given is a=“a\[b\]c” I nedd b=“a c” tried to split using (/(\[|\])/) to get \[“a”, “\[”, “b”, “\]”, “c”\] b=a.strip.split(/(\[|\])/) and then joined the bits together.…

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

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