# Ruby

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

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

---

## [Shorten SHA1-hash](https://www.ruby-forum.com/t/shorten-sha1-hash/112253)

<div class="topic-metadata">

**Author:** [@splattael](https://www.ruby-forum.com/u/splattael)\
**Replies:** 2\
**Last updated:** [August 16, 2007, 10:22pm UTC](https://www.ruby-forum.com/t/shorten-sha1-hash/112253 "2007-08-16T22:22:08Z")

</div>

In one of my railsapplications I have system for up/downloading files. Since I don’t want people to browse all the files, but anyone should be able to link to his/her files each file has it’s own unique URL - all pret…

---

## [Mp3 file magic number identification](https://www.ruby-forum.com/t/mp3-file-magic-number-identification/112160)

<div class="topic-metadata">

**Author:** [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Replies:** 14\
**Last updated:** [August 16, 2007, 9:58pm UTC](https://www.ruby-forum.com/t/mp3-file-magic-number-identification/112160 "2007-08-16T21:58:04Z")

</div>

Does anybody know how to identify (validate) mp3 files (other audio files would be interesting as well) by ‘magic number’? I never trust file extensions to be correct. It’s to easy for users to accidentally munge file…

---

## [Question to all you newbies (others welcome)](https://www.ruby-forum.com/t/question-to-all-you-newbies-others-welcome/91371)

<div class="topic-metadata">

**Author:** [@SonOfLilit](https://www.ruby-forum.com/u/SonOfLilit)\
**Replies:** 39\
**Last updated:** [August 16, 2007, 9:37pm UTC](https://www.ruby-forum.com/t/question-to-all-you-newbies-others-welcome/91371 "2007-08-16T21:37:01Z")

</div>

Hello everyone, As you hopefully know, I founded http://RubyMentor.rubyforge.org, a project that offers volunteer help to Ruby newbies. My question is where would it be most effective to advertise RubyMentor? What ar…

---

## [SciTE and 1.8.6](https://www.ruby-forum.com/t/scite-and-1-8-6/112247)

<div class="topic-metadata">

**Author:** [@rorjeff](https://www.ruby-forum.com/u/rorjeff)\
**Replies:** 1\
**Last updated:** [August 16, 2007, 8:51pm UTC](https://www.ruby-forum.com/t/scite-and-1-8-6/112247 "2007-08-16T20:51:57Z")

</div>

I installed Ruby 1.8.6 this morning. At first I thought my programs would no longer run in Windows. I now know that they will run from a command prompt but not thought SciTE. Anyone else had problems with SciTE V1…

---

## [Ruby 1.8.6 and watir](https://www.ruby-forum.com/t/ruby-1-8-6-and-watir/112250)

<div class="topic-metadata">

**Author:** [@rorjeff](https://www.ruby-forum.com/u/rorjeff)\
**Replies:** 0\
**Last updated:** [August 16, 2007, 8:22pm UTC](https://www.ruby-forum.com/t/ruby-1-8-6-and-watir/112250 "2007-08-16T20:22:56Z")

</div>

I see from a posting on watir page that other are having problems loading watir with 1.8.6. However there has been on answers over there so I thought I’d try here. irb require ‘watir’ =\> true test.rb require ‘wat…

---

## [Double quote escape character](https://www.ruby-forum.com/t/double-quote-escape-character/112231)

<div class="topic-metadata">

**Author:** [@kabish](https://www.ruby-forum.com/u/kabish)\
**Replies:** 12\
**Last updated:** [August 16, 2007, 8:20pm UTC](https://www.ruby-forum.com/t/double-quote-escape-character/112231 "2007-08-16T20:20:55Z")

</div>

Hi all, I’m trying to export a string to a excel file using fastercsv and I wanted it double quote to make it safer. So i tried to use the escape character " to insert double quotes but it doesn’t work: string prod…

---

## [A helpful idea if you're looking for something to do](https://www.ruby-forum.com/t/a-helpful-idea-if-youre-looking-for-something-to-do/112242)

<div class="topic-metadata">

**Author:** [@simonsaid](https://www.ruby-forum.com/u/simonsaid)\
**Replies:** 2\
**Last updated:** [August 16, 2007, 7:56pm UTC](https://www.ruby-forum.com/t/a-helpful-idea-if-youre-looking-for-something-to-do/112242 "2007-08-16T19:56:53Z")

</div>

compile a whole lot of ruby regex examples, with commentary on what’s going on. the few websites I’ve found, and books I’ve looked through just touch on the basics with minimal examples and explanation, or are specifi…

---

## [Ruby load problem on AIX](https://www.ruby-forum.com/t/ruby-load-problem-on-aix/90805)

<div class="topic-metadata">

**Author:** [@MDMDMD](https://www.ruby-forum.com/u/MDMDMD)\
**Replies:** 8\
**Last updated:** [August 16, 2007, 7:10pm UTC](https://www.ruby-forum.com/t/ruby-load-problem-on-aix/90805 "2007-08-16T19:10:45Z")

</div>

Hi, I have built Ruby 1.8.5 on an AIX 5.2 64 bit machine. I am using xlc with OBJECT\_MODE=64. When I try to run the following: $ gem install rails --include-dependencies /fasthome/fast3/manas/ruby185/lib/ruby/1.8/pow…

---

## [Yield \[0\] to {|\*,v|}](https://www.ruby-forum.com/t/yield-0-to-v/112202)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 1\
**Last updated:** [August 16, 2007, 6:18pm UTC](https://www.ruby-forum.com/t/yield-0-to-v/112202 "2007-08-16T18:18:37Z")

</div>

e$B0J2\<$N$h$&$K!"e(B{|\*,v| p v} e$B$KBP$7e(B \[0\] e$B$re(B yield e$B$7$?$H$-e(B v e$B$Oe(B \[0\] e$B$K$J$j$^$9!#e(B % ./ruby -ve ‘def m() yield \[0\] end; m {|\*,v| p v}’ ruby 1.9.0 (2007-08-16 patchlevel 0) \[i686-linux\] …

---

## [Jump in ensure dumps core](https://www.ruby-forum.com/t/jump-in-ensure-dumps-core/111768)

<div class="topic-metadata">

**Author:** [@Yusuke\_ENDOH](https://www.ruby-forum.com/u/Yusuke_ENDOH)\
**Replies:** 2\
**Last updated:** [August 16, 2007, 6:18pm UTC](https://www.ruby-forum.com/t/jump-in-ensure-dumps-core/111768 "2007-08-16T18:18:37Z")

</div>

e$B1sF#$H?=$7$^$9!#e(B 1.9 e$B$Ge(B ensure e$B$NCf$Ge(B illigal e$B$G$J$$e(B next e$B$de(B redo e$B$r$9$k$HMn$A$^$9!#e(B $ ./ruby -ve ‘1.times { begin ensure next end }’ ruby 1.9.0 (2007-08-10 patchlevel 0) \[i686-lin…

---

## [Yield \[1\] to {|v,&b| p v }](https://www.ruby-forum.com/t/yield-1-to-v-b-p-v/112218)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 1\
**Last updated:** [August 16, 2007, 6:17pm UTC](https://www.ruby-forum.com/t/yield-1-to-v-b-p-v/112218 "2007-08-16T18:17:36Z")

</div>

e$B0J2\<$N$h$&$Ke(B {|v,&b|} e$B$Ke(B \[1\] e$B$re(B yield e$B$7$?$H$-!"e(Bv e$B$Oe(B 1 e$B$K$Je(B e$B$j$^$9!#e(B % ./ruby -ve ‘def m() yield \[1\] end; m {|v,&b| p v }’ ruby 1.9.0 (2007-08-16 patchlevel 0) \[i686-linux\] …

---

## [Option parse](https://www.ruby-forum.com/t/option-parse/111728)

<div class="topic-metadata">

**Author:** [@dreamwave](https://www.ruby-forum.com/u/dreamwave)\
**Replies:** 4\
**Last updated:** [August 16, 2007, 6:01pm UTC](https://www.ruby-forum.com/t/option-parse/111728 "2007-08-16T18:01:35Z")

</div>

is there a better, or different way to pipe arguments to a program rather than using optparse? or is that the best and fastest way?

---

## [Subject: What \*exactly\* does an instance variable in the top](https://www.ruby-forum.com/t/subject-what-exactly-does-an-instance-variable-in-the-top/112229)

<div class="topic-metadata">

**Author:** [@pitosalas](https://www.ruby-forum.com/u/pitosalas)\
**Replies:** 2\
**Last updated:** [August 16, 2007, 5:42pm UTC](https://www.ruby-forum.com/t/subject-what-exactly-does-an-instance-variable-in-the-top/112229 "2007-08-16T17:42:32Z")

</div>

Here’s an example: @tl\_instance = “hello ruby” puts @tl\_instance def tl\_method puts “from tl\_method – @tl\_instance: #{@tl\_instance}” end tl\_method class Tl\_class def tlc\_method puts “from tlc\_method – @tl\_insta…

---

## [Smugmug 0.0.1](https://www.ruby-forum.com/t/smugmug-0-0-1/112134)

<div class="topic-metadata">

**Author:** [@Christopher\_Boumeno](https://www.ruby-forum.com/u/Christopher_Boumeno)\
**Replies:** 1\
**Last updated:** [August 16, 2007, 5:01pm UTC](https://www.ruby-forum.com/t/smugmug-0-0-1/112134 "2007-08-16T17:01:23Z")

</div>

I am happy to announce the first release of smugmug. A ruby library for interacting with smugmug.com via its REST interface. The documentation is available inside the gem or tarball, and may be viewed at http://smugm…

---

## [Ruby 1.8.6 problem](https://www.ruby-forum.com/t/ruby-1-8-6-problem/112225)

<div class="topic-metadata">

**Author:** [@rorjeff](https://www.ruby-forum.com/u/rorjeff)\
**Replies:** 1\
**Last updated:** [August 16, 2007, 4:58pm UTC](https://www.ruby-forum.com/t/ruby-1-8-6-problem/112225 "2007-08-16T16:58:22Z")

</div>

I’ve just installed ruby 1.8.6 and my Windows programs will not run. In fxri puts “hi” =\> hi In SciTE test.rb contains puts “hi”. It’s result is “The system cannot find the file specified.” I get this result fro…

---

## [Any Muslims around?](https://www.ruby-forum.com/t/any-muslims-around/112029)

<div class="topic-metadata">

**Author:** [@Kyrre\_NygSSSSrd](https://www.ruby-forum.com/u/Kyrre_NygSSSSrd)\
**Replies:** 7\
**Last updated:** [August 16, 2007, 4:41pm UTC](https://www.ruby-forum.com/t/any-muslims-around/112029 "2007-08-16T16:41:19Z")

</div>

Just wondering if any Muslims have gotten around to making a Ruby script that like plays a sound or something when it’s time for prayer. Thanks, Kyrre Nygård

---

## [Exchanging the extension in a filename](https://www.ruby-forum.com/t/exchanging-the-extension-in-a-filename/112024)

<div class="topic-metadata">

**Author:** [@ronaldfischer](https://www.ruby-forum.com/u/ronaldfischer)\
**Replies:** 8\
**Last updated:** [August 16, 2007, 4:22pm UTC](https://www.ruby-forum.com/t/exchanging-the-extension-in-a-filename/112024 "2007-08-16T16:22:14Z")

</div>

I have a string representing the name of a java file. I would like to get a new string, where the extension .java has been replaced by .class. My approach was to use String#sub: filename=“abc/x.java” filename.sub(/j…

---

## [Cellular Automata (#134)](https://www.ruby-forum.com/t/cellular-automata-134/112224)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 0\
**Last updated:** [August 16, 2007, 4:19pm UTC](https://www.ruby-forum.com/t/cellular-automata-134/112224 "2007-08-16T16:19:14Z")

</div>

I chose this quiz because I felt it was easy and interesting. It seems the jury is still out on the easy aspect though. I believe there were only two correct solution this week. Most of them had problems with at l…

---

## [How can I update a span in the HTML(page)?](https://www.ruby-forum.com/t/how-can-i-update-a-span-in-the-html-page/112206)

<div class="topic-metadata">

**Author:** [@Zhan\_feng\_W](https://www.ruby-forum.com/u/Zhan_feng_W)\
**Replies:** 1\
**Last updated:** [August 16, 2007, 3:51pm UTC](https://www.ruby-forum.com/t/how-can-i-update-a-span-in-the-html-page/112206 "2007-08-16T15:51:12Z")

</div>

Hi,friends, I’d lo=ike to knwo if I can update a span in the html, in C#, I can do that as following: \<form action="Asn1Studio.aspx" method="post" runat="server"\> Output from infering sch…

---

## [Creating and passing a block in a C extension](https://www.ruby-forum.com/t/creating-and-passing-a-block-in-a-c-extension/112162)

<div class="topic-metadata">

**Author:** [@Gerardo\_SSGSSS\_mez](https://www.ruby-forum.com/u/Gerardo_SSGSSS_mez)\
**Replies:** 4\
**Last updated:** [August 16, 2007, 3:06pm UTC](https://www.ruby-forum.com/t/creating-and-passing-a-block-in-a-c-extension/112162 "2007-08-16T15:06:02Z")

</div>

In a C extension I have a function that calls to rb\_yield to invoke the block that the final user will supply. I want to call that function from within that same C extension. The problem is how to create and pass a b…

---

## [Threads and loops](https://www.ruby-forum.com/t/threads-and-loops/112214)

<div class="topic-metadata">

**Author:** [@emilsverige](https://www.ruby-forum.com/u/emilsverige)\
**Replies:** 2\
**Last updated:** [August 16, 2007, 1:58pm UTC](https://www.ruby-forum.com/t/threads-and-loops/112214 "2007-08-16T13:58:53Z")

</div>

Hi, if I run this script: loop{ puts “hello” sleep 1 } It outputs “hello” every second. But if I place it in a separate thread: Thread.new do loop{ puts “hello” sleep 1 } end it prints it only one time and t…

---

## [Typo in ChangeLog](https://www.ruby-forum.com/t/typo-in-changelog/112215)

<div class="topic-metadata">

**Author:** [@Kazuhiro\_NISHIYAMA](https://www.ruby-forum.com/u/Kazuhiro_NISHIYAMA)\
**Replies:** 0\
**Last updated:** [August 16, 2007, 1:07pm UTC](https://www.ruby-forum.com/t/typo-in-changelog/112215 "2007-08-16T13:07:48Z")

</div>

e$B@\>;3OB9-$G$9!#e(B \[ruby-cvs:20205\]e$B$r8+$F5$IU$$$?$N$G$9$,!“e(BChangeLoge$B$NCf$Ke(B from from e$B$He(B from e$B$,Fs=E$K$J$C$F$7$^$C$F$$$k$H$3$m$,e(B (e$B\>/$J$/$H$be(B trunk, ruby\_1\_8, ruby\_1\_8\_5 e$B$Ge(B)e$B$”$k…

---

## [Relationship operator for classes](https://www.ruby-forum.com/t/relationship-operator-for-classes/112210)

<div class="topic-metadata">

**Author:** [@ronaldfischer](https://www.ruby-forum.com/u/ronaldfischer)\
**Replies:** 4\
**Last updated:** [August 16, 2007, 1:05pm UTC](https://www.ruby-forum.com/t/relationship-operator-for-classes/112210 "2007-08-16T13:05:48Z")

</div>

I wanted to distinguish between cases, where a variable is of type Symbol, or Hash, or something other. My first attempt failed: case v.class when Symbol … when Hash … else … end Even if v was a Hash, processi…

---

## [/bin/sh: BASERUBY@: command not found](https://www.ruby-forum.com/t/bin-sh-baseruby-command-not-found/112213)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 0\
**Last updated:** [August 16, 2007, 12:53pm UTC](https://www.ruby-forum.com/t/bin-sh-baseruby-command-not-found/112213 "2007-08-16T12:53:46Z")

</div>

trunk e$B$G!"0J2\<$N$h$&$K$J$C$Fe(B build e$B$G$-$^$;$s!#e(B % make … rm -f ruby /bin/sh: BASERUBY@: command not found make: \*\*\* \[optinsn.inc\] Error 127

---

## [Igraph 0.3 Released](https://www.ruby-forum.com/t/igraph-0-3-released/112203)

<div class="topic-metadata">

**Author:** [@oscar-alexander](https://www.ruby-forum.com/u/oscar-alexander)\
**Replies:** 0\
**Last updated:** [August 16, 2007, 10:43am UTC](https://www.ruby-forum.com/t/igraph-0-3-released/112203 "2007-08-16T10:43:32Z")

</div>

igraph version 0.3 has been released! http://igraph.rubyforge.org/ IGraph is a Ruby extension for interfacing with the C igraph library (http://cneurocvs.rmki.kfki.hu/igraph/). igraph is a library for creating and ma…

---

## [UTF-8 encoding with BOM under Ruby 1.8.x (Windows)](https://www.ruby-forum.com/t/utf-8-encoding-with-bom-under-ruby-1-8-x-windows/112113)

<div class="topic-metadata">

**Author:** [@wonado](https://www.ruby-forum.com/u/wonado)\
**Replies:** 5\
**Last updated:** [August 16, 2007, 10:01am UTC](https://www.ruby-forum.com/t/utf-8-encoding-with-bom-under-ruby-1-8-x-windows/112113 "2007-08-16T10:01:25Z")

</div>

Moin, moin! I still recognized, that a Ruby program encoded in UTF-8 with BOM (standard unter Windows) still has problems when using Ruby 1.8.6 under Windows, while the problem is fixed for Ruby 1.9. Will there be a …

---

## [Removing quotes in a string](https://www.ruby-forum.com/t/removing-quotes-in-a-string/112191)

<div class="topic-metadata">

**Author:** [@wings](https://www.ruby-forum.com/u/wings)\
**Replies:** 7\
**Last updated:** [August 16, 2007, 9:31am UTC](https://www.ruby-forum.com/t/removing-quotes-in-a-string/112191 "2007-08-16T09:31:21Z")

</div>

Hi, does anyone know of a good way to remove leading and trailing quotes (") in a string please? Thanks Grace

---

## [Unit tests and destructive methods](https://www.ruby-forum.com/t/unit-tests-and-destructive-methods/112158)

<div class="topic-metadata">

**Author:** [@darren\_kirby](https://www.ruby-forum.com/u/darren_kirby)\
**Replies:** 4\
**Last updated:** [August 16, 2007, 8:49am UTC](https://www.ruby-forum.com/t/unit-tests-and-destructive-methods/112158 "2007-08-16T08:49:16Z")

</div>

Hello all, As my flac library approaches 1000 lines of code I decided it would be prudent to finally get around to writing some unit tests, which I have done. Now: I have created a ‘reference’ flac file with known v…

---

## [Excessively verbose request for help with regex and arrays](https://www.ruby-forum.com/t/excessively-verbose-request-for-help-with-regex-and-arrays/112192)

<div class="topic-metadata">

**Author:** [@simonsaid](https://www.ruby-forum.com/u/simonsaid)\
**Replies:** 5\
**Last updated:** [August 16, 2007, 7:07am UTC](https://www.ruby-forum.com/t/excessively-verbose-request-for-help-with-regex-and-arrays/112192 "2007-08-16T07:07:07Z")

</div>

text = “(20:29:55) awhilewhileaway: I also need to assemble the cover/back, and figure out the innards of the aimlog formatting/keyword searches” what I want is essentially 3 fields, the text itself, the speaker (str…

---

## [Problem with custom\_require](https://www.ruby-forum.com/t/problem-with-custom-require/112184)

<div class="topic-metadata">

**Author:** [@nuby2ruby](https://www.ruby-forum.com/u/nuby2ruby)\
**Replies:** 0\
**Last updated:** [August 16, 2007, 4:47am UTC](https://www.ruby-forum.com/t/problem-with-custom-require/112184 "2007-08-16T04:47:23Z")

</div>

So, for anyone who remembers, I had a post a while ago about not being to get into console with Rails. I kept getting this error saying error with custom require. I tried uninstalling rails and reinstalling, using the…

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

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