# Ruby

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

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

---

## [Refactoring Global Constants](https://www.ruby-forum.com/t/refactoring-global-constants/193419)

<div class="topic-metadata">

**Author:** [@goodfriend](https://www.ruby-forum.com/u/goodfriend)\
**Replies:** 2\
**Last updated:** [August 18, 2010, 2:22am UTC](https://www.ruby-forum.com/t/refactoring-global-constants/193419 "2010-08-18T02:22:01Z")

</div>

Hi, I’m going to ask a dumb question (sorry for that, in advance)… What’s the most elegant syntax and form for refactoring Global Constants out of Ruby code so they can be shared across different Ruby code files? For…

---

## [Question on if / defined?()](https://www.ruby-forum.com/t/question-on-if-defined/193438)

<div class="topic-metadata">

**Author:** [@Jedrin](https://www.ruby-forum.com/u/Jedrin)\
**Replies:** 6\
**Last updated:** [August 18, 2010, 2:21am UTC](https://www.ruby-forum.com/t/question-on-if-defined/193438 "2010-08-18T02:21:51Z")

</div>

assuming x is not defined, why does the statement x = true if !defined?(x) produce x is nil ? y = true if !defined?(x) is no different this however works fine: if !defined?(x) x = true end

---

## [LAST CHANCE TO REGISTER ONLINE for 2010 Workshop on Scheme and Functional Programming](https://www.ruby-forum.com/t/last-chance-to-register-online-for-2010-workshop-on-scheme-and-functional-programming/193454)

<div class="topic-metadata">

**Author:** [@mrcfab3](https://www.ruby-forum.com/u/mrcfab3)\
**Replies:** 0\
**Last updated:** [August 18, 2010, 1:46am UTC](https://www.ruby-forum.com/t/last-chance-to-register-online-for-2010-workshop-on-scheme-and-functional-programming/193454 "2010-08-18T01:46:44Z")

</div>

The 2010 Scheme Workshop will be held in Montreal in less than 4 days from now. If you are planning to attend the workshop PLEASE REGISTER ONLINE ASAP. By going through the online registration process we will get vi…

---

## [For a new ed. of "The Ruby Way"?](https://www.ruby-forum.com/t/for-a-new-ed-of-the-ruby-way/193443)

<div class="topic-metadata">

**Author:** [@diego\_v](https://www.ruby-forum.com/u/diego_v)\
**Replies:** 1\
**Last updated:** [August 17, 2010, 9:29pm UTC](https://www.ruby-forum.com/t/for-a-new-ed-of-the-ruby-way/193443 "2010-08-17T21:29:08Z")

</div>

Hello, I was wondering if anyone has heard of any plan by Hal F. to update “The Ruby Way” to a third ed. Since the 2nd ed. a lot has changed in the Ruby community: a lot of areas have ended up with a couple of very s…

---

## [\[patch\] Fix for RubyModule.LoadNestedTypes](https://www.ruby-forum.com/t/patch-fix-for-rubymodule-loadnestedtypes/193441)

<div class="topic-metadata">

**Author:** [@Jb\_Evain](https://www.ruby-forum.com/u/Jb_Evain)\
**Replies:** 1\
**Last updated:** [August 17, 2010, 8:41pm UTC](https://www.ruby-forum.com/t/patch-fix-for-rubymodule-loadnestedtypes/193441 "2010-08-17T20:41:45Z")

</div>

Hey, In the ClrGenerics3 scenario: public class ClassWithNestedGenericTypes1 { public class D { } public class C { public int Id { get { return 0; } } } public …

---

## [Odd errors](https://www.ruby-forum.com/t/odd-errors/193440)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 1\
**Last updated:** [August 17, 2010, 8:32pm UTC](https://www.ruby-forum.com/t/odd-errors/193440 "2010-08-17T20:32:17Z")

</div>

I get these every so often: http://gist.github.com/531294 Any way to disable these bad boys? They scare end users :slight\_smile: -r

---

## [\[Feature #3638\] VM$BFb%G!\<%?9=B$$X%"%/%;%9$9$k%^%/%m(B](https://www.ruby-forum.com/t/feature-3638-vm-bfb-g-9-b-x-9-9-k-m-b/192515)

<div class="topic-metadata">

**Author:** [@SSwanabe](https://www.ruby-forum.com/u/SSwanabe)\
**Replies:** 3\
**Last updated:** [August 17, 2010, 8:06pm UTC](https://www.ruby-forum.com/t/feature-3638-vm-bfb-g-9-b-x-9-9-k-m-b/192515 "2010-08-17T20:06:31Z")

</div>

Feature #3638: VMe$BFb%G!\<%?9=B$$X%"%/%;%9$9$k%^%/%me(B http://redmine.ruby-lang.org/issues/show/3638 e$B5/I\<\<Te(B: \_ wanabe e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal e$BC4Ev\<Te(B: Koichi Sasada, e$B%+%F%4%je(B: Y…

---

## [IMAP: unexpected token LPAR (expected QUOTED or LITERAL)](https://www.ruby-forum.com/t/imap-unexpected-token-lpar-expected-quoted-or-literal/193406)

<div class="topic-metadata">

**Author:** [@voxom](https://www.ruby-forum.com/u/voxom)\
**Replies:** 2\
**Last updated:** [August 17, 2010, 7:11pm UTC](https://www.ruby-forum.com/t/imap-unexpected-token-lpar-expected-quoted-or-literal/193406 "2010-08-17T19:11:28Z")

</div>

I’m writing an IMAP parser that uses BODYSTRUCTURE to fetch only the text (not attachments) part of an email. On a few messages, ruby errors out on imap.fetch id, “BODYSTRUCTURE”, with “Net::IMAP::ResponseParseError: …

---

## [SMTP SMS Reminder Script](https://www.ruby-forum.com/t/smtp-sms-reminder-script/193423)

<div class="topic-metadata">

**Author:** [@humandictionary](https://www.ruby-forum.com/u/humandictionary)\
**Replies:** 5\
**Last updated:** [August 17, 2010, 7:03pm UTC](https://www.ruby-forum.com/t/smtp-sms-reminder-script/193423 "2010-08-17T19:03:08Z")

</div>

require ‘net/smtp’ puts “How many times do you want to bomb 'em?” x = gets.to\_i puts “What’s your gmail account?” username = gets puts “Password for that account?” password=gets message = \<\<MESSAGE\_END From: Priv…

---

## [Have I been staring at the screen too long?](https://www.ruby-forum.com/t/have-i-been-staring-at-the-screen-too-long/193400)

<div class="topic-metadata">

**Author:** [@tensaiji](https://www.ruby-forum.com/u/tensaiji)\
**Replies:** 10\
**Last updated:** [August 17, 2010, 5:36pm UTC](https://www.ruby-forum.com/t/have-i-been-staring-at-the-screen-too-long/193400 "2010-08-17T17:36:04Z")

</div>

$ irb r = \[1…99, 100…199\] =\> \[1…99, 100…199\] xs = r.local\_methods =\> \[:, :, :, :-, :, :=\>, :\[\], :\[\], :all?, :any?, :assoc, :at, :clear, :collect, :collect!, :combination, :compact, :compact!, :concat, :count, :cyc…

---

## [HTTP Downloader](https://www.ruby-forum.com/t/http-downloader/193426)

<div class="topic-metadata">

**Author:** [@humandictionary](https://www.ruby-forum.com/u/humandictionary)\
**Replies:** 9\
**Last updated:** [August 17, 2010, 4:50pm UTC](https://www.ruby-forum.com/t/http-downloader/193426 "2010-08-17T16:50:18Z")

</div>

require ‘net/http’ puts “Enter the URL of the site you want to download from (You must have http:// and www. if the site has it). e.g. http://www.google.com” site = gets.chomp.to\_s puts “Enter the sub-URL of the file…

---

## [Re: \[ANN\] New GUI gem for JRuby](https://www.ruby-forum.com/t/re-ann-new-gui-gem-for-jruby/193424)

<div class="topic-metadata">

**Author:** [@destiney](https://www.ruby-forum.com/u/destiney)\
**Replies:** 1\
**Last updated:** [August 17, 2010, 4:26pm UTC](https://www.ruby-forum.com/t/re-ann-new-gui-gem-for-jruby/193424 "2010-08-17T16:26:52Z")

</div>

Interesting. I’ll have to take a look. Have you ever used monkeybars? GregD ---- Roger G. removed\_email\_address@domain.invalid wrote: people that still do non web based application development :wink: Regards Roge…

---

## [Write to file](https://www.ruby-forum.com/t/write-to-file/193417)

<div class="topic-metadata">

**Author:** [@taura](https://www.ruby-forum.com/u/taura)\
**Replies:** 2\
**Last updated:** [August 17, 2010, 12:59pm UTC](https://www.ruby-forum.com/t/write-to-file/193417 "2010-08-17T12:59:29Z")

</div>

Hi, I’m trying to write to a new file, wich I’m creating by file=File.new(‘file.txt’, ‘w’) This works fine so far, the file is created in my working folder and contains the text I’m putting in. Now I want the user t…

---

## [Killing a gnome-terminal process from a ruby script](https://www.ruby-forum.com/t/killing-a-gnome-terminal-process-from-a-ruby-script/193401)

<div class="topic-metadata">

**Author:** [@fasterrain](https://www.ruby-forum.com/u/fasterrain)\
**Replies:** 2\
**Last updated:** [August 17, 2010, 10:03am UTC](https://www.ruby-forum.com/t/killing-a-gnome-terminal-process-from-a-ruby-script/193401 "2010-08-17T10:03:47Z")

</div>

Hello: I’m working on a dialog manager and I’m stuck at the part where I need to launch a terminal process and also kill it. This is what I have so far. Launch: @terminal\_pid = IO.popen(‘gnome-terminal’) Kill Proc…

---

## [Ruby hit rocky ground at Microsoft](https://www.ruby-forum.com/t/ruby-hit-rocky-ground-at-microsoft/193164)

<div class="topic-metadata">

**Author:** [@archiloque](https://www.ruby-forum.com/u/archiloque)\
**Replies:** 3\
**Last updated:** [August 17, 2010, 4:17am UTC](https://www.ruby-forum.com/t/ruby-hit-rocky-ground-at-microsoft/193164 "2010-08-17T04:17:58Z")

</div>

Hi, (I have only see this info on few place so FYI, even if many rubyists don’t particularly love Microsoft I think it’s a bad news for Ruby.) “Microsoftâ€™s open source IronRuby and IronPython projects are shrouded …

---

## [\[ANN\] sensible-cinema 0.7.7](https://www.ruby-forum.com/t/ann-sensible-cinema-0-7-7/193395)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 0\
**Last updated:** [August 17, 2010, 4:09am UTC](https://www.ruby-forum.com/t/ann-sensible-cinema-0-7-7/193395 "2010-08-17T04:09:22Z")

</div>

Hi all. In the spirit of “release early, release often”, I’d like to announce my “sensible-cinema” program. This gem allows you to “bleep out” sections of movies as you watch them on players like hulu and VLC. It’s …

---

## [Indentation in stdlib](https://www.ruby-forum.com/t/indentation-in-stdlib/193388)

<div class="topic-metadata">

**Author:** [@Philipp\_K](https://www.ruby-forum.com/u/Philipp_K)\
**Replies:** 1\
**Last updated:** [August 17, 2010, 3:18am UTC](https://www.ruby-forum.com/t/indentation-in-stdlib/193388 "2010-08-17T03:18:16Z")

</div>

Annoyed about inconsistent indentation in some files in the stdlib (e.g. ipaddr.rb) … Sometimes 4 indentations are written as 8 spaces and sometimes (in the same file) as 1 tab. Example: def initialize(addr = ‘::’, …

---

## [Which C standard](https://www.ruby-forum.com/t/which-c-standard/193349)

<div class="topic-metadata">

**Author:** [@graza](https://www.ruby-forum.com/u/graza)\
**Replies:** 1\
**Last updated:** [August 17, 2010, 3:10am UTC](https://www.ruby-forum.com/t/which-c-standard/193349 "2010-08-17T03:10:38Z")

</div>

Hi, Which C standard does MRI use? When I run configure on HP-UX, it seems to use C89. I recently ran into an issue compiling the gherkin gem. Seems that the C code in that gem makes use of C99 features like variab…

---

## [Rendering svg file into a jpg format](https://www.ruby-forum.com/t/rendering-svg-file-into-a-jpg-format/193161)

<div class="topic-metadata">

**Author:** [@martin\_mercy2001](https://www.ruby-forum.com/u/martin_mercy2001)\
**Replies:** 1\
**Last updated:** [August 17, 2010, 2:25am UTC](https://www.ruby-forum.com/t/rendering-svg-file-into-a-jpg-format/193161 "2010-08-17T02:25:07Z")

</div>

Dear Friends, I need to prepare some some logo’s, i have inputs like svg images and text. I need to read the same and write into a jpg file. I have an svg image with 600 X 400 size, and a text called “Company Log” I …

---

## [Synchronize between download and save in multi-threads?](https://www.ruby-forum.com/t/synchronize-between-download-and-save-in-multi-threads/193250)

<div class="topic-metadata">

**Author:** [@luofeiyu](https://www.ruby-forum.com/u/luofeiyu)\
**Replies:** 1\
**Last updated:** [August 17, 2010, 2:23am UTC](https://www.ruby-forum.com/t/synchronize-between-download-and-save-in-multi-threads/193250 "2010-08-17T02:23:58Z")

</div>

i want to download all usa listed company historial data from yahoo finance, at first i download all compamy name list and save it in /home/pt/usastock/totalname(amex nyse nasdaq,6000 companies),here is my program t…

---

## [Gather autocompletion-information while running tests?](https://www.ruby-forum.com/t/gather-autocompletion-information-while-running-tests/193270)

<div class="topic-metadata">

**Author:** [@Jan\_Kechel](https://www.ruby-forum.com/u/Jan_Kechel)\
**Replies:** 1\
**Last updated:** [August 17, 2010, 2:23am UTC](https://www.ruby-forum.com/t/gather-autocompletion-information-while-running-tests/193270 "2010-08-17T02:23:02Z")

</div>

\-----BEGIN PGP SIGNED MESSAGE----- Hash: RIPEMD160 Hi everybody, I was looking around for some autocompletion solution for ruby. Most sites tell me that ruby is too dynamic to write any simple IDE supporting this. I…

---

## [1.9.2 array performance](https://www.ruby-forum.com/t/1-9-2-array-performance/193383)

<div class="topic-metadata">

**Author:** [@jzakiya](https://www.ruby-forum.com/u/jzakiya)\
**Replies:** 1\
**Last updated:** [August 17, 2010, 2:21am UTC](https://www.ruby-forum.com/t/1-9-2-array-performance/193383 "2010-08-17T02:21:05Z")

</div>

In Antonio C.'s blog http://antoniocangiano.com/ he released his Great Ruby Shootout (July 2010) results below: His results confirmed what I have seen going from 1.9.1 to 1.9.2. i.e, array performance has regressed …

---

## [TkVariable and accents](https://www.ruby-forum.com/t/tkvariable-and-accents/193079)

<div class="topic-metadata">

**Author:** [@jefff35](https://www.ruby-forum.com/u/jefff35)\
**Replies:** 1\
**Last updated:** [August 17, 2010, 12:46am UTC](https://www.ruby-forum.com/t/tkvariable-and-accents/193079 "2010-08-17T00:46:01Z")

</div>

hello, I’m working on a small gui, I have a tkEntry, for reading the tkEntry.textvariable I have a tkVariable. when I enter something as “toto” in the tkentry i get it in the tkvariable. but when I enter “té” I get t…

---

## [Feature request: die when the main thread closes](https://www.ruby-forum.com/t/feature-request-die-when-the-main-thread-closes/192879)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 7\
**Last updated:** [August 16, 2010, 11:39pm UTC](https://www.ruby-forum.com/t/feature-request-die-when-the-main-thread-closes/192879 "2010-08-16T23:39:15Z")

</div>

Situation currently is that if you “accidentally” (or knowingly) start a java background thread, ex: java.awt.FileDialog.new(nil).show when you exit your jruby main thread, the process hangs, waiting on awt’s thread,…

---

## [1.9.2 RC2 Uses 1.9.1 for various directories](https://www.ruby-forum.com/t/1-9-2-rc2-uses-1-9-1-for-various-directories/192599)

<div class="topic-metadata">

**Author:** [@zampettim](https://www.ruby-forum.com/u/zampettim)\
**Replies:** 2\
**Last updated:** [August 16, 2010, 11:20pm UTC](https://www.ruby-forum.com/t/1-9-2-rc2-uses-1-9-1-for-various-directories/192599 "2010-08-16T23:20:33Z")

</div>

Using 1.9.2 RC2 and building from source, I am seeing the install use 1.9.1 as the directory that various sub dirs are using, like vendorlib, gems, etc. In previous releases, this was usually 1.9. Is the change to a 3…

---

## [Does Ruby have reference parameter?](https://www.ruby-forum.com/t/does-ruby-have-reference-parameter/193258)

<div class="topic-metadata">

**Author:** [@cnguyen](https://www.ruby-forum.com/u/cnguyen)\
**Replies:** 5\
**Last updated:** [August 16, 2010, 10:47pm UTC](https://www.ruby-forum.com/t/does-ruby-have-reference-parameter/193258 "2010-08-16T22:47:11Z")

</div>

Hi everyone, In C++, in order to modify a variable being passed into a function we do void func( int& x ) { x = 10; } I wonder is there a way to do something like this in Ruby or a similar idea? If there’s no refe…

---

## [\[ANN\] New GUI gem for JRuby](https://www.ruby-forum.com/t/ann-new-gui-gem-for-jruby/193386)

<div class="topic-metadata">

**Author:** [@rogergue](https://www.ruby-forum.com/u/rogergue)\
**Replies:** 0\
**Last updated:** [August 16, 2010, 10:09pm UTC](https://www.ruby-forum.com/t/ann-new-gui-gem-for-jruby/193386 "2010-08-16T22:09:08Z")

</div>

Hello, the first release of my own GUI gem for desktop based GUI development is available at http://github.com/rogergl/input\_form. I used it to migrate an old Delphi application to the JRuby plattform wich worked o…

---

## [RubyInstaller 1.8.7-p302 available](https://www.ruby-forum.com/t/rubyinstaller-1-8-7-p302-available/193382)

<div class="topic-metadata">

**Author:** [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Replies:** 0\
**Last updated:** [August 16, 2010, 9:30pm UTC](https://www.ruby-forum.com/t/rubyinstaller-1-8-7-p302-available/193382 "2010-08-16T21:30:28Z")

</div>

Hello, Wanted to inform that RubyInstaller project just made available packages and installers for Ruby 1.8.7-p302. These are available for download at RubyForge: http://rubyforge.org/frs/?group\_id=167&release\_id=443…

---

## [Xml binding for JRuby?](https://www.ruby-forum.com/t/xml-binding-for-jruby/193300)

<div class="topic-metadata">

**Author:** [@soderic](https://www.ruby-forum.com/u/soderic)\
**Replies:** 4\
**Last updated:** [August 16, 2010, 9:03pm UTC](https://www.ruby-forum.com/t/xml-binding-for-jruby/193300 "2010-08-16T21:03:24Z")

</div>

Does anyone here know how to get JAXB working with JRuby? I’m having trouble with it. It keeps giving me a: “syntax error, unexpected tIDENTIFIER (SyntaxError)” The specific location its complaining about is the line …

---

## [QtRuby : constructor optional parameter](https://www.ruby-forum.com/t/qtruby-constructor-optional-parameter/193373)

<div class="topic-metadata">

**Author:** [@bonechi](https://www.ruby-forum.com/u/bonechi)\
**Replies:** 2\
**Last updated:** [August 16, 2010, 8:50pm UTC](https://www.ruby-forum.com/t/qtruby-constructor-optional-parameter/193373 "2010-08-16T20:50:09Z")

</div>

Hello everyone! I would like to know how to manage (with QtRuby) the optional parameter from the constructor of a lot of classes (in Qt C++). I join a quick example. Thank you! Here is the code: require “Qt4” clas…

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

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