# Ruby

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

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

---

## [Why return gives error when used with ? :](https://www.ruby-forum.com/t/why-return-gives-error-when-used-with/119350)

<div class="topic-metadata">

**Author:** [@shuaib85](https://www.ruby-forum.com/u/shuaib85)\
**Replies:** 10\
**Last updated:** [November 6, 2007, 5:32pm UTC](https://www.ruby-forum.com/t/why-return-gives-error-when-used-with/119350 "2007-11-06T17:32:26Z")

</div>

Hi all in my program I am using a lot of true false conditions. So, I want to shorten my code by using the conditional operator ? : but when I use the word return it gives an error which i do not really know why? e.g…

---

## [Autoload\_delete](https://www.ruby-forum.com/t/autoload-delete/119333)

<div class="topic-metadata">

**Author:** [@Hidetoshi\_NAGAI](https://www.ruby-forum.com/u/Hidetoshi_NAGAI)\
**Replies:** 6\
**Last updated:** [November 6, 2007, 5:04pm UTC](https://www.ruby-forum.com/t/autoload-delete/119333 "2007-11-06T17:04:57Z")

</div>

e$B1J0f!wCNG=!%6e9)Bg$G$9!%e(B e$B8=\>u$Ne(B 1.9 e$B$G$O!$e(Bautoload e$BEPO?$7$F$$$k%U%!%$%k$re(B e$BL@\<(E\*$Ke(B require e$B$7$h$&$H$9$k$HNc30$,H/@8$7$^$9!%e(B 1.8 e$B$G$3$l$r$d$k$H!$BP\>\]%U%!%$%k$r#22sFI$s$G$7$^$&$i$7…

---

## [Named parameters idiom](https://www.ruby-forum.com/t/named-parameters-idiom/119365)

<div class="topic-metadata">

**Author:** [@fernan2](https://www.ruby-forum.com/u/fernan2)\
**Replies:** 5\
**Last updated:** [November 6, 2007, 4:59pm UTC](https://www.ruby-forum.com/t/named-parameters-idiom/119365 "2007-11-06T16:59:04Z")

</div>

Hi people, I often see hashes used as a form of named parameters, with some variations. However, I couldn’t find the idiom properly explained anywhere. I’m just missing it? Where is it? Would anyone like to explain …

---

## [Convert a string into a decimal](https://www.ruby-forum.com/t/convert-a-string-into-a-decimal/119382)

<div class="topic-metadata">

**Author:** [@ernsttanaka](https://www.ruby-forum.com/u/ernsttanaka)\
**Replies:** 6\
**Last updated:** [November 6, 2007, 4:54pm UTC](https://www.ruby-forum.com/t/convert-a-string-into-a-decimal/119382 "2007-11-06T16:54:57Z")

</div>

I am a new Ruby programmer. I am really amazed with the ease of programming. I seem not to be able to find a solution for the following task. I want to convert an object with the class string into a object with the c…

---

## [Operator |=](https://www.ruby-forum.com/t/operator/119366)

<div class="topic-metadata">

**Author:** [@fernan2](https://www.ruby-forum.com/u/fernan2)\
**Replies:** 10\
**Last updated:** [November 6, 2007, 4:50pm UTC](https://www.ruby-forum.com/t/operator/119366 "2007-11-06T16:50:51Z")

</div>

Hi people, Did I dream about an opeartor |=? I can’t find any reference to it in the online docs, yet I think I’ve seen it in some samples. What does it do? TIA

---

## [String to symbol](https://www.ruby-forum.com/t/string-to-symbol/119367)

<div class="topic-metadata">

**Author:** [@fernan2](https://www.ruby-forum.com/u/fernan2)\
**Replies:** 7\
**Last updated:** [November 6, 2007, 4:31pm UTC](https://www.ruby-forum.com/t/string-to-symbol/119367 "2007-11-06T16:31:32Z")

</div>

Hi people, Is there a way to “intern” a string so that it becomes denoted by a symbol? Something like: This doesn’t work as I wrote it, I know :repetitive\_message \<= “blah blah blah” puts :repetitive\_message puts :…

---

## [Line ending problem](https://www.ruby-forum.com/t/line-ending-problem/119326)

<div class="topic-metadata">

**Author:** [@goodness](https://www.ruby-forum.com/u/goodness)\
**Replies:** 3\
**Last updated:** [November 6, 2007, 4:19pm UTC](https://www.ruby-forum.com/t/line-ending-problem/119326 "2007-11-06T16:19:13Z")

</div>

Hi I am writing a ruby script to insert some content into the beginning of some files. The files would be used in Windows or Mac, when I use File.puts method to write the file, it changes the line ending of the file. …

---

## [Start of string?](https://www.ruby-forum.com/t/start-of-string/119368)

<div class="topic-metadata">

**Author:** [@Jari\_W](https://www.ruby-forum.com/u/Jari_W)\
**Replies:** 6\
**Last updated:** [November 6, 2007, 2:26pm UTC](https://www.ruby-forum.com/t/start-of-string/119368 "2007-11-06T14:26:18Z")

</div>

What’t the most elegant way to find a substring match at the very start of a string? Currently I’m using this approach: a = “long string” key = “long” if a\[0, key.length\] == key then …while this might look ok, it d…

---

## [\[0\].product(0) dumps core](https://www.ruby-forum.com/t/0-product-0-dumps-core/119372)

<div class="topic-metadata">

**Author:** [@Yusuke\_ENDOH](https://www.ruby-forum.com/u/Yusuke_ENDOH)\
**Replies:** 0\
**Last updated:** [November 6, 2007, 2:26pm UTC](https://www.ruby-forum.com/t/0-product-0-dumps-core/119372 "2007-11-06T14:26:18Z")

</div>

e$B1sF#$H?=$7$^$9!#e(B 1.9 e$B$Ge(B Array#product e$B$N0z?t$Ke(B Array e$B0J30$rM?$($k$HMn$A$^$9!#e(B $ ./ruby -e ‘\[0\].product(0)’ -e:1: – control frame ---------- c:0004 p:---- s:0009 b:0009 l:000008 d:000008 CFUNC…

---

## [InstructionSequence$B$N:#8e(B](https://www.ruby-forum.com/t/instructionsequence-b-n-8e-b/119334)

<div class="topic-metadata">

**Author:** [@miura](https://www.ruby-forum.com/u/miura)\
**Replies:** 2\
**Last updated:** [November 6, 2007, 2:18pm UTC](https://www.ruby-forum.com/t/instructionsequence-b-n-8e-b/119334 "2007-11-06T14:18:42Z")

</div>

e$B;01:$H?=$7$^$9!#e(B e$B8=:\_!“e(BRuby1.9.0e$B$Ne(BVM::InstructionSequencee$B%b%8%e!\<%k$r;H$C$F%P%$%H%3!\<%I$K%Q%C%A$re(B e$BEv$F$kJ}\<0$G%G%P%C%,$r:n$C$F$$$^$9!#e(B e$B:n$C$F$$$F$U$He(BVM::InstructionSequencee$B$C$FL5…

---

## [Using 'require' with modules in the same folder](https://www.ruby-forum.com/t/using-require-with-modules-in-the-same-folder/119369)

<div class="topic-metadata">

**Author:** [@fernan2](https://www.ruby-forum.com/u/fernan2)\
**Replies:** 3\
**Last updated:** [November 6, 2007, 2:14pm UTC](https://www.ruby-forum.com/t/using-require-with-modules-in-the-same-folder/119369 "2007-11-06T14:14:36Z")

</div>

Hi people, I’ve modularized my very first ruby program (a port of a bash script). However, if I use ‘load’ and the target program is loaded multiple times (indirectly), I get warnings about redefinition of constants, …

---

## [FileUtils.ln\_s in Vista](https://www.ruby-forum.com/t/fileutils-ln-s-in-vista/118848)

<div class="topic-metadata">

**Author:** [@fernan2](https://www.ruby-forum.com/u/fernan2)\
**Replies:** 8\
**Last updated:** [November 6, 2007, 2:12pm UTC](https://www.ruby-forum.com/t/fileutils-ln-s-in-vista/118848 "2007-11-06T14:12:51Z")

</div>

I just found out that Windows Vista supports symbolic links. In fact, it has a new command line tool “mklink” for that. However, 1.8.6 says that the functionality is not supported. So, 1.Is there a more recent versi…

---

## [Passing all parameters to a method with a unique variable](https://www.ruby-forum.com/t/passing-all-parameters-to-a-method-with-a-unique-variable/119355)

<div class="topic-metadata">

**Author:** [@tcblues](https://www.ruby-forum.com/u/tcblues)\
**Replies:** 9\
**Last updated:** [November 6, 2007, 2:05pm UTC](https://www.ruby-forum.com/t/passing-all-parameters-to-a-method-with-a-unique-variable/119355 "2007-11-06T14:05:12Z")

</div>

I’m trying to pass to a method all the parameters in a global variable: $allparameters=“dos”,“ie”,“4”,“alone”,"",“8” … myclass.mymethod($allparameters) I’m doing that because I’m using this parameters a lot. The err…

---

## [Affecting variables inside a while loop that are initialised outside its scope](https://www.ruby-forum.com/t/affecting-variables-inside-a-while-loop-that-are-initialised-outside-its-scope/119338)

<div class="topic-metadata">

**Author:** [@Rawn](https://www.ruby-forum.com/u/Rawn)\
**Replies:** 5\
**Last updated:** [November 6, 2007, 1:32pm UTC](https://www.ruby-forum.com/t/affecting-variables-inside-a-while-loop-that-are-initialised-outside-its-scope/119338 "2007-11-06T13:32:25Z")

</div>

How can I do it? Sorry if this is stupid or something but I’m just learning to program (starting with ruby) and this seemed like a more interesting way to start than endless arithmatic operations… #!/usr/bin/ruby Inv…

---

## [Hoe does not like windows?](https://www.ruby-forum.com/t/hoe-does-not-like-windows/118923)

<div class="topic-metadata">

**Author:** [@Vassilis\_R](https://www.ruby-forum.com/u/Vassilis_R)\
**Replies:** 3\
**Last updated:** [November 6, 2007, 11:15am UTC](https://www.ruby-forum.com/t/hoe-does-not-like-windows/118923 "2007-11-06T11:15:49Z")

</div>

I get the following running rake -T on a project seeded for Hoe: rake aborted! couldn’t find HOME environment – expanding \`~/.hoerc’ ruby -v: ruby 1.8.6 (2007-03-13 patchlevel 0) \[i386-mswin32\] and all gems are upda…

---

## [\[ANN\] London Ruby User Group - 12th Novemeber, 2007](https://www.ruby-forum.com/t/ann-london-ruby-user-group-12th-novemeber-2007/119349)

<div class="topic-metadata">

**Author:** [@Murray\_S](https://www.ruby-forum.com/u/Murray_S)\
**Replies:** 0\
**Last updated:** [November 6, 2007, 10:47am UTC](https://www.ruby-forum.com/t/ann-london-ruby-user-group-12th-novemeber-2007/119349 "2007-11-06T10:47:39Z")

</div>

Hi all, The next London Ruby U. Group meeting will happen this coming Monday: Date: November 12th Time: 6:30pm onwards Location: the Skills Matter offices at 1 Sekforde Street, EC1R 0BEL\[1\] Closest tube: Farringdon …

---

## [ANN: smsc\_manager, stomp\_message](https://www.ruby-forum.com/t/ann-smsc-manager-stomp-message/119347)

<div class="topic-metadata">

**Author:** [@Scott\_Sproule](https://www.ruby-forum.com/u/Scott_Sproule)\
**Replies:** 0\
**Last updated:** [November 6, 2007, 10:26am UTC](https://www.ruby-forum.com/t/ann-smsc-manager-stomp-message/119347 "2007-11-06T10:26:01Z")

</div>

Just a quick announcement of two rubygems available on rubyforge: stomp\_message which builds upon the stomp client to provide client, server implementations, active record and wfe participants for stomp messaging . s…

---

## [Reading a class-file and calling it at runtime](https://www.ruby-forum.com/t/reading-a-class-file-and-calling-it-at-runtime/119221)

<div class="topic-metadata">

**Author:** [@Miss\_Elaine\_E](https://www.ruby-forum.com/u/Miss_Elaine_E)\
**Replies:** 18\
**Last updated:** [November 6, 2007, 8:20am UTC](https://www.ruby-forum.com/t/reading-a-class-file-and-calling-it-at-runtime/119221 "2007-11-06T08:20:53Z")

</div>

I’m trying to read-in a folder full of “plug-ins” and call each of them, in turn. Once I get the class-name, I do something like: require "#{PLUG\_IN\_DIR}/#{one\_plugin}" plugin\_class=Object.const\_get(pl…

---

## [Retrieving values from combo box](https://www.ruby-forum.com/t/retrieving-values-from-combo-box/119337)

<div class="topic-metadata">

**Author:** [@jojobert](https://www.ruby-forum.com/u/jojobert)\
**Replies:** 2\
**Last updated:** [November 6, 2007, 6:22am UTC](https://www.ruby-forum.com/t/retrieving-values-from-combo-box/119337 "2007-11-06T06:22:12Z")

</div>

Jul/10: \<%= select\_tag "jul10", "YNR" %\> At the moment, my html form displays this combo box the way i want it, but it does not record down what the user has selected and save it to the database help please, thank…

---

## [Gateway Upgraded](https://www.ruby-forum.com/t/gateway-upgraded/118682)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 26\
**Last updated:** [November 6, 2007, 2:45am UTC](https://www.ruby-forum.com/t/gateway-upgraded/118682 "2007-11-06T02:45:24Z")

</div>

We are now running on my new gateway code that will hopefully get even more messages across the Usenet divide. Please help me keep an eye on the gateway these next couple of days and verify that it’s running as planne…

---

## [Sending cell-phone text-message from Rails](https://www.ruby-forum.com/t/sending-cell-phone-text-message-from-rails/119313)

<div class="topic-metadata">

**Author:** [@paul](https://www.ruby-forum.com/u/paul)\
**Replies:** 3\
**Last updated:** [November 6, 2007, 2:14am UTC](https://www.ruby-forum.com/t/sending-cell-phone-text-message-from-rails/119313 "2007-11-06T02:14:09Z")

</div>

Is there a way of sending a cell-phone text-message from Rails? If so, how? Thanks, Paul D.

---

## [Naked object macros](https://www.ruby-forum.com/t/naked-object-macros/119314)

<div class="topic-metadata">

**Author:** [@keynan](https://www.ruby-forum.com/u/keynan)\
**Replies:** 2\
**Last updated:** [November 6, 2007, 1:09am UTC](https://www.ruby-forum.com/t/naked-object-macros/119314 "2007-11-06T01:09:03Z")

</div>

I have module A module B module ClassMethods def a\_method end end end end I would like to be able to class Klass include A::B a\_method end ============================================================== the …

---

## [File Save Question](https://www.ruby-forum.com/t/file-save-question/119305)

<div class="topic-metadata">

**Author:** [@superfly](https://www.ruby-forum.com/u/superfly)\
**Replies:** 5\
**Last updated:** [November 6, 2007, 12:27am UTC](https://www.ruby-forum.com/t/file-save-question/119305 "2007-11-06T00:27:04Z")

</div>

Hello! I’ve created a program that will run and update the array storing the information within that program. When the program is over, I would like the file to save, so th next time I run it, the same information is …

---

## [Procmail to ruby](https://www.ruby-forum.com/t/procmail-to-ruby/119261)

<div class="topic-metadata">

**Author:** [@Mislav\_K](https://www.ruby-forum.com/u/Mislav_K)\
**Replies:** 4\
**Last updated:** [November 5, 2007, 11:55pm UTC](https://www.ruby-forum.com/t/procmail-to-ruby/119261 "2007-11-05T23:55:59Z")

</div>

Hello, I want to write a Procmail recipe that pipes a message to a Ruby script as ARGV argument. I wrote this recipe but it doesn’t work. :0 ^TO\_\* | ruby main.rb How can I pass a message as argument to the script…

---

## [Compare 2 "arrays"](https://www.ruby-forum.com/t/compare-2-arrays/119282)

<div class="topic-metadata">

**Author:** [@caefer](https://www.ruby-forum.com/u/caefer)\
**Replies:** 2\
**Last updated:** [November 5, 2007, 10:55pm UTC](https://www.ruby-forum.com/t/compare-2-arrays/119282 "2007-11-05T22:55:11Z")

</div>

Hello, sorry i’m a beginner with ruby and hanging on a problem comparing two arrays? Have anybody an advice what’s wrong in my logic, beacuse printing of k and row2\[“id”\] like p “#{k} = #{row2\[“id”\]}” works!? many…

---

## [Library/gem popularity index?](https://www.ruby-forum.com/t/library-gem-popularity-index/119285)

<div class="topic-metadata">

**Author:** [@princenamor](https://www.ruby-forum.com/u/princenamor)\
**Replies:** 1\
**Last updated:** [November 5, 2007, 10:50pm UTC](https://www.ruby-forum.com/t/library-gem-popularity-index/119285 "2007-11-05T22:50:29Z")

</div>

Guys, While trying to find a log library for a project I’m toying with, I was a bit overwhelmed at the number of possible options out there. Choice is great, but I simply don’t have time to research each option in dep…

---

## [Fastercsv: row\["header1"\] syntax doesn't work, why?](https://www.ruby-forum.com/t/fastercsv-row-header1-syntax-doesnt-work-why/119296)

<div class="topic-metadata">

**Author:** [@7stud](https://www.ruby-forum.com/u/7stud)\
**Replies:** 1\
**Last updated:** [November 5, 2007, 9:55pm UTC](https://www.ruby-forum.com/t/fastercsv-row-header1-syntax-doesnt-work-why/119296 "2007-11-05T21:55:34Z")

</div>

$ cat data.csv name number me 12 you 20 require ‘rubygems’ require ‘fastercsv’ FasterCSV.foreach(“data.csv”, :headers =\>true, :col\_sep =\>’\\t’) do |row| puts row puts row\[‘name’\] puts row\[‘number’\] p…

---

## [Pulseaudio c extension callback function](https://www.ruby-forum.com/t/pulseaudio-c-extension-callback-function/119273)

<div class="topic-metadata">

**Author:** [@blackedder](https://www.ruby-forum.com/u/blackedder)\
**Replies:** 3\
**Last updated:** [November 5, 2007, 9:08pm UTC](https://www.ruby-forum.com/t/pulseaudio-c-extension-callback-function/119273 "2007-11-05T21:08:19Z")

</div>

Hi all, I started working on a ruby wrapper for pulseaudio. I am a bit out of my depth here, because my c experience is very limited and very rusty and I am kinda stuck. The library is basically event driven. You atta…

---

## [JRuby disabling ObjectSpace: what implications?](https://www.ruby-forum.com/t/jruby-disabling-objectspace-what-implications/118533)

<div class="topic-metadata">

**Author:** [@headius](https://www.ruby-forum.com/u/headius)\
**Replies:** 27\
**Last updated:** [November 5, 2007, 7:13pm UTC](https://www.ruby-forum.com/t/jruby-disabling-objectspace-what-implications/118533 "2007-11-05T19:13:44Z")

</div>

As some of you may have heard, we’re considering disabling ObjectSpace.each\_object by default in JRuby. Primarily, this is for performance; to support each\_object, we have to bend over backwards, maintaining lists of …

---

## [Winlogon - cannot set empty password from ruby](https://www.ruby-forum.com/t/winlogon-cannot-set-empty-password-from-ruby/119283)

<div class="topic-metadata">

**Author:** [@Michal\_S](https://www.ruby-forum.com/u/Michal_S)\
**Replies:** 0\
**Last updated:** [November 5, 2007, 7:11pm UTC](https://www.ruby-forum.com/t/winlogon-cannot-set-empty-password-from-ruby/119283 "2007-11-05T19:11:59Z")

</div>

Hello I tried to make a ruby script that makes Windows XP automatically log on the local user “user” on startup. The purpose of the script is to find out the computer name and put it into the winlogon registry along …

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

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