# Ruby

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

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

---

## [Sort lines alpahetically](https://www.ruby-forum.com/t/sort-lines-alpahetically/126176)

<div class="topic-metadata">

**Author:** [@Junkone](https://www.ruby-forum.com/u/Junkone)\
**Replies:** 3\
**Last updated:** [January 16, 2008, 8:03pm UTC](https://www.ruby-forum.com/t/sort-lines-alpahetically/126176 "2008-01-16T20:03:23Z")

</div>

What is the fastest way to sort all the lines of a file alphabetically.

---

## [Bug in Rails 2.0 when overloading a find\_by method?](https://www.ruby-forum.com/t/bug-in-rails-2-0-when-overloading-a-find-by-method/196575)

<div class="topic-metadata">

**Author:** [@carr0t](https://www.ruby-forum.com/u/carr0t)\
**Replies:** 1\
**Last updated:** [January 16, 2008, 7:47pm UTC](https://www.ruby-forum.com/t/bug-in-rails-2-0-when-overloading-a-find-by-method/196575 "2008-01-16T19:47:29Z")

</div>

I’ve got an interesting replecatable bug that has sprung up since I migrated some code i’ve written from rails 1.2.3 to 2.0.2. I am using a mysql backend database, in which I am storing IPv4 addresses as 32 bit unsign…

---

## [Not catching my exception](https://www.ruby-forum.com/t/not-catching-my-exception/126224)

<div class="topic-metadata">

**Author:** [@Junkone](https://www.ruby-forum.com/u/Junkone)\
**Replies:** 3\
**Last updated:** [January 16, 2008, 7:06pm UTC](https://www.ruby-forum.com/t/not-catching-my-exception/126224 "2008-01-16T19:06:59Z")

</div>

Hello begin if(nil|pattern.match(details)) then id=$1 rec=Scans.find(id) rec.scannable=MARKTRUE rec.save else badpattern=true end rescue RecordNotFound badpattern=true end I still get the prog stopping and p…

---

## [The Ruport Book : Your guide to mastering Ruby Reports](https://www.ruby-forum.com/t/the-ruport-book-your-guide-to-mastering-ruby-reports/126190)

<div class="topic-metadata">

**Author:** [@naething](https://www.ruby-forum.com/u/naething)\
**Replies:** 2\
**Last updated:** [January 16, 2008, 6:35pm UTC](https://www.ruby-forum.com/t/the-ruport-book-your-guide-to-mastering-ruby-reports/126190 "2008-01-16T18:35:52Z")

</div>

Hi folks, I am pleased to announce that Mike Milner and I have finished the Ruport Book. We have published it under our own company (Rinara Press LLC) through Lulu. With the help of the Ruport community, we’ve refin…

---

## [How to generate a serial random number](https://www.ruby-forum.com/t/how-to-generate-a-serial-random-number/196573)

<div class="topic-metadata">

**Author:** [@alex-osu3](https://www.ruby-forum.com/u/alex-osu3)\
**Replies:** 5\
**Last updated:** [January 16, 2008, 6:27pm UTC](https://www.ruby-forum.com/t/how-to-generate-a-serial-random-number/196573 "2008-01-16T18:27:14Z")

</div>

Hi all, I want to generate a serial of 5 random numbers based on the size of an array(let say the size of array is 100). Here are the rules:1) 5 random numbers are different 2) Once they are generated they can’t appe…

---

## [Getting Apache error when trying to load mod\_ruby](https://www.ruby-forum.com/t/getting-apache-error-when-trying-to-load-mod-ruby/126240)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [January 16, 2008, 5:17pm UTC](https://www.ruby-forum.com/t/getting-apache-error-when-trying-to-load-mod-ruby/126240 "2008-01-16T17:17:03Z")

</div>

Hi, I’m using Apache 2.2 on Fedora Core 6 Linux. I’m using ruby 1.8.6 and mod\_ruby 1.2.5. I get this error when starting Apache: \[Wed Jan 16 09:40:26 2008\] \[error\] mod\_ruby: failed to require apache/ ruby-run \[Wed…

---

## [Example CVS/SVN commit script](https://www.ruby-forum.com/t/example-cvs-svn-commit-script/126231)

<div class="topic-metadata">

**Author:** [@shinji](https://www.ruby-forum.com/u/shinji)\
**Replies:** 1\
**Last updated:** [January 16, 2008, 4:03pm UTC](https://www.ruby-forum.com/t/example-cvs-svn-commit-script/126231 "2008-01-16T16:03:12Z")

</div>

I’ve been googling, but not too succesfully for examples of CVS and Subversion commit scripts. I’ve got documentation for the CVS and SVN libraries, but would like to see examples if anyone can point me at them. ta

---

## [Here Document syntax is stringent - trailing blank](https://www.ruby-forum.com/t/here-document-syntax-is-stringent-trailing-blank/125719)

<div class="topic-metadata">

**Author:** [@toadkicker](https://www.ruby-forum.com/u/toadkicker)\
**Replies:** 11\
**Last updated:** [January 16, 2008, 3:36pm UTC](https://www.ruby-forum.com/t/here-document-syntax-is-stringent-trailing-blank/125719 "2008-01-16T15:36:03Z")

</div>

text = \<\<EOD Hi there. Why does the Here Document require there to be no space after the closing symbol? If I type "EOD " and press enter, I get a syntax error. (See below.) If I type “EOD” with an immediate carra…

---

## [Creating a process and/or executing a ruby script internally](https://www.ruby-forum.com/t/creating-a-process-and-or-executing-a-ruby-script-internally/126229)

<div class="topic-metadata">

**Author:** [@sgarcia](https://www.ruby-forum.com/u/sgarcia)\
**Replies:** 0\
**Last updated:** [January 16, 2008, 3:28pm UTC](https://www.ruby-forum.com/t/creating-a-process-and-or-executing-a-ruby-script-internally/126229 "2008-01-16T15:28:00Z")

</div>

\##this is my process create script puts(‘hello im run create clicker’) $pid = Process.create( :app\_name =\> ‘ruby clicker.rb’, :creation\_flags =\> Process::DETACHED\_PROCESS ).process\_id at\_exit{ Process.kill(…

---

## [String#valid\_encoding? shoud be strict?](https://www.ruby-forum.com/t/string-valid-encoding-shoud-be-strict/126012)

<div class="topic-metadata">

**Author:** [@Masayoshi\_T](https://www.ruby-forum.com/u/Masayoshi_T)\
**Replies:** 8\
**Last updated:** [January 16, 2008, 3:16pm UTC](https://www.ruby-forum.com/t/string-valid-encoding-shoud-be-strict/126012 "2008-01-16T15:16:35Z")

</div>

e$B9b66@,5A$G$9!#e(B1.9e$B$N%(%s%3!\<%G%#%s%0$He(BString#valid\_encoding?e$B$K$D$$$F!#e(B e$B!ZGX7J!\[e(B e$BF~NO%A%’%C%/Ey$G!"$"$kJ8;zNs$,$"$k%(%s%3!\<%G%#%s%0$NHO0OFb$Ke(B e$B$$5$^$C$F$$$k$+!“873J$K%A%’%C%/$7$?$$\>l9g$,$…

---

## [Problem with StringList object in Ruby/Qt4](https://www.ruby-forum.com/t/problem-with-stringlist-object-in-ruby-qt4/126153)

<div class="topic-metadata">

**Author:** [@Rosalind\_M](https://www.ruby-forum.com/u/Rosalind_M)\
**Replies:** 2\
**Last updated:** [January 16, 2008, 3:13pm UTC](https://www.ruby-forum.com/t/problem-with-stringlist-object-in-ruby-qt4/126153 "2008-01-16T15:13:04Z")

</div>

I’m experimenting with building Ruby applications with Qt4 GUI interfaces. While most of it is going easily - I like using Qt4 more than most GUI tools - I seem to have run into a problem with Qt::StringList objects. …

---

## [Enc\_register\_at should use strdup](https://www.ruby-forum.com/t/enc-register-at-should-use-strdup/126223)

<div class="topic-metadata">

**Author:** [@sheepman](https://www.ruby-forum.com/u/sheepman)\
**Replies:** 0\
**Last updated:** [January 16, 2008, 2:19pm UTC](https://www.ruby-forum.com/t/enc-register-at-should-use-strdup/126223 "2008-01-16T14:19:29Z")

</div>

e$B$3$s$P$s$Oe(B sheepman e$B$G$9!#e(B e$B\<!$N$h$&$J%3!\<%I$G%(%i!\<$K$J$j$^$9!#e(B require e$B$O4X78$"$j$^$;$s!#%(%s%3!\<%G%#%s%0L\>$rI=$9J8;zNs$,e(B GC e$B$5$l$F$7$^$&$h$&$G$9!#e(B $ cat t.rb #-- coding: euc-jp -- 10…

---

## [Ruby as application scripting language?](https://www.ruby-forum.com/t/ruby-as-application-scripting-language/126198)

<div class="topic-metadata">

**Author:** [@MohsinHijazee](https://www.ruby-forum.com/u/MohsinHijazee)\
**Replies:** 2\
**Last updated:** [January 16, 2008, 1:55pm UTC](https://www.ruby-forum.com/t/ruby-as-application-scripting-language/126198 "2008-01-16T13:55:51Z")

</div>

Hello again! I’ve seen some applications which expose their object model for the user to write program to automate some of the tasks he wishes to do. One example is FontLab which allows you to use Python. Is that done …

---

## [Time.mktime](https://www.ruby-forum.com/t/time-mktime/125800)

<div class="topic-metadata">

**Author:** [@Tadayoshi\_F](https://www.ruby-forum.com/u/Tadayoshi_F)\
**Replies:** 3\
**Last updated:** [January 16, 2008, 1:49pm UTC](https://www.ruby-forum.com/t/time-mktime/125800 "2008-01-16T13:49:23Z")

</div>

1.8 e$B$Ge(B Time.mktime(2001,2,3,24) e$B$O$?$@HO0O30%(%i!\<$G$9$,!"e(B1.9 e$B$G$O0c$&e(B e$B$h$&$G$9!#e(B24e$B;~$r5v$9$D$b$@$C$?$N$+$b$7$l$^$;$s$,!"7k6I%(%i!\<$K$J$C$F$7e(B e$B$^$$$^$9!#e(B $ ruby19 -v -e ‘Time.mktime…

---

## [New replica encodings and encoding aliases](https://www.ruby-forum.com/t/new-replica-encodings-and-encoding-aliases/125901)

<div class="topic-metadata">

**Author:** [@NARUSES\_Yui](https://www.ruby-forum.com/u/NARUSES_Yui)\
**Replies:** 4\
**Last updated:** [January 16, 2008, 1:48pm UTC](https://www.ruby-forum.com/t/new-replica-encodings-and-encoding-aliases/125901 "2008-01-16T13:48:48Z")

</div>

e$B@.@%$G$9!#e(B e$B\<j85$N4D6-$rD/$a$D$D!"?’!9$He(B replica e$B$de(B alias e$B$r@Dj$7$F$$^$7$?!#8=:\_;Xe(B e$BDj2DG=$J%(%s%3!\<%G%#%s%0$O0J2\<$N$H$\*$j$G$9!#e(BISO 8859 e$B%7%j!\<%:$O$H$j$"$(e(B e$B$:$=$l$C$\]$$$N$Ne(B re…

---

## [TreeView question(SOLVED)](https://www.ruby-forum.com/t/treeview-question-solved/126222)

<div class="topic-metadata">

**Author:** [@cesarstafe](https://www.ruby-forum.com/u/cesarstafe)\
**Replies:** 0\
**Last updated:** [January 16, 2008, 1:46pm UTC](https://www.ruby-forum.com/t/treeview-question-solved/126222 "2008-01-16T13:46:27Z")

</div>

the method for drop all rows in TreeView is ‘clear’ \[1\] @grid.model.clear thanks, bye \[1\] : http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gtk%3A%3ATreeStore#clear http://www.sindominio.net/ayuda/preguntas-in…

---

## [I have q question about using ruby/dl for win32 dll](https://www.ruby-forum.com/t/i-have-q-question-about-using-ruby-dl-for-win32-dll/126219)

<div class="topic-metadata">

**Author:** [@bbmerong](https://www.ruby-forum.com/u/bbmerong)\
**Replies:** 0\
**Last updated:** [January 16, 2008, 1:31pm UTC](https://www.ruby-forum.com/t/i-have-q-question-about-using-ruby-dl-for-win32-dll/126219 "2008-01-16T13:31:40Z")

</div>

I’d like to access some function in win32 dll Sample dll’s source is like the belows. – part of source – #ifndef TESTDLL #define TESTDLL extern “C” \_\_declspec(dllimport) #endif TESTDLL float \_stdcall AddNum(floa…

---

## [How to use LDAP with Rails appliaction](https://www.ruby-forum.com/t/how-to-use-ldap-with-rails-appliaction/126207)

<div class="topic-metadata">

**Author:** [@varunkumargoel](https://www.ruby-forum.com/u/varunkumargoel)\
**Replies:** 0\
**Last updated:** [January 16, 2008, 10:32am UTC](https://www.ruby-forum.com/t/how-to-use-ldap-with-rails-appliaction/126207 "2008-01-16T10:32:32Z")

</div>

Hi all, I am new to LDAP and i wanna deploy my application with LDAP server within my company.I do’nt know how to do this please help me out for that. Please guide me step by step. Looking for your positive reply. …

---

## [Returning with methods](https://www.ruby-forum.com/t/returning-with-methods/126186)

<div class="topic-metadata">

**Author:** [@lazukars](https://www.ruby-forum.com/u/lazukars)\
**Replies:** 3\
**Last updated:** [January 16, 2008, 9:46am UTC](https://www.ruby-forum.com/t/returning-with-methods/126186 "2008-01-16T09:46:32Z")

</div>

struct.rb: #!/usr/bin/env ruby class User \< Struct.new(:screenname, :password) def initialize(sn, pw) self.screenname = sn self.password = pw end def inspect self.values end end in IRB: Ruby\> irb -r struct.rb …

---

## [Rational 1.18](https://www.ruby-forum.com/t/rational-1-18/125805)

<div class="topic-metadata">

**Author:** [@Tadayoshi\_F](https://www.ruby-forum.com/u/Tadayoshi_F)\
**Replies:** 1\
**Last updated:** [January 16, 2008, 9:45am UTC](https://www.ruby-forum.com/t/rational-1-18/125805 "2008-01-16T09:45:22Z")

</div>

e$B86$5$s$Ne(B rational 1.18 e$B$G!"$D$.$N$h$&$J%(%i!\<$K$J$j$^$7$?!#e(B $ ruby -r mathn -e ‘(((211847976306000123000 - 210866803200000000000) / 1000000000.0) - 1.0) \< 1e-6’ -e:1:in -': undefined methodsize’ for 7.6654…

---

## [Any Desktop Application?](https://www.ruby-forum.com/t/any-desktop-application/126197)

<div class="topic-metadata">

**Author:** [@MohsinHijazee](https://www.ruby-forum.com/u/MohsinHijazee)\
**Replies:** 3\
**Last updated:** [January 16, 2008, 9:23am UTC](https://www.ruby-forum.com/t/any-desktop-application/126197 "2008-01-16T09:23:01Z")

</div>

Hello everyone! I am new to both the groups, and to the ruby and I like ruby very much! Are there any great Ruby Desktop applications attempted with GUI like Blender in Python? Or should we start some? Regards, Mohs…

---

## [Uninitialized constant Encoding::ASCII\_8BIT (NameError)](https://www.ruby-forum.com/t/uninitialized-constant-encoding-ascii-8bit-nameerror/126196)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 0\
**Last updated:** [January 16, 2008, 7:18am UTC](https://www.ruby-forum.com/t/uninitialized-constant-encoding-ascii-8bit-nameerror/126196 "2008-01-16T07:18:44Z")

</div>

e$B:G6a!"e(Btest-all e$B$,F0$+$J$$$h$&$J5$$,$7$^$9!#e(B % make test-all ./miniruby -I./lib -I.ext/i686-linux ./runruby.rb --extout=.ext – “./test/runner.rb” --basedir="./test" --runner=console /home/akr/ruby/yarvo0…

---

## [How to catch and rescue a login error through telnet](https://www.ruby-forum.com/t/how-to-catch-and-rescue-a-login-error-through-telnet/126102)

<div class="topic-metadata">

**Author:** [@prasadm29](https://www.ruby-forum.com/u/prasadm29)\
**Replies:** 3\
**Last updated:** [January 16, 2008, 6:42am UTC](https://www.ruby-forum.com/t/how-to-catch-and-rescue-a-login-error-through-telnet/126102 "2008-01-16T06:42:46Z")

</div>

Hi, I was trying out the following snippet of code and just wanted to know why the rescue doesn’t work when the username or password are not valid. The code works fine when both are valid, but I wanted to catch inval…

---

## [Regex failure notifcation](https://www.ruby-forum.com/t/regex-failure-notifcation/126146)

<div class="topic-metadata">

**Author:** [@Junkone](https://www.ruby-forum.com/u/Junkone)\
**Replies:** 1\
**Last updated:** [January 16, 2008, 5:26am UTC](https://www.ruby-forum.com/t/regex-failure-notifcation/126146 "2008-01-16T05:26:27Z")

</div>

When i match a pattern and if it returns a nil, obviously the regex did not match the pattern. is there a way of identifying which set did not match pattern=Regexp.new(’(\[g|l\])\\s+(\[0-9.\]+)’) irb(main):073:0\> pattern.…

---

## [Windows File Comparing](https://www.ruby-forum.com/t/windows-file-comparing/126167)

<div class="topic-metadata">

**Author:** [@lmcilwain](https://www.ruby-forum.com/u/lmcilwain)\
**Replies:** 7\
**Last updated:** [January 16, 2008, 4:50am UTC](https://www.ruby-forum.com/t/windows-file-comparing/126167 "2008-01-16T04:50:47Z")

</div>

I am attempting to right a small utility that checks one file against an automated snapshot of itself in a different location to make sure that they are the same. I have not had any luck doing this and thought I would…

---

## [Command-set 0.9.2 Released](https://www.ruby-forum.com/t/command-set-0-9-2-released/126181)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [January 16, 2008, 3:43am UTC](https://www.ruby-forum.com/t/command-set-0-9-2-released/126181 "2008-01-16T03:43:01Z")

</div>

command-set version 0.9.2 has been released! CommandSet is a interactive program framework. Its focus is a DSL for defining commands, much like Rake or RSpec. The actual interpreter is left as an open question, alth…

---

## [Set operations on array of hash](https://www.ruby-forum.com/t/set-operations-on-array-of-hash/126141)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [January 16, 2008, 3:26am UTC](https://www.ruby-forum.com/t/set-operations-on-array-of-hash/126141 "2008-01-16T03:26:01Z")

</div>

var1 = \[ {‘color’=\>‘blue’,‘shape’=\>‘round’,‘flavor’=\>‘sweet’}, ## 1a {‘color’=\>‘yellow’,‘shape’=\>‘oblong’,‘flavor’=\>‘sweet’},## 1b {‘color’=\>‘red’,‘shape’=\>‘round’,‘flavor’=\>‘tart’}, ## 1c \]; var2 = \[ {…

---

## [Can't install ccsv (wiered)](https://www.ruby-forum.com/t/cant-install-ccsv-wiered/126025)

<div class="topic-metadata">

**Author:** [@heinrich1208](https://www.ruby-forum.com/u/heinrich1208)\
**Replies:** 2\
**Last updated:** [January 16, 2008, 2:23am UTC](https://www.ruby-forum.com/t/cant-install-ccsv-wiered/126025 "2008-01-16T02:23:21Z")

</div>

gem install ccsv -r Building native extensions. This could take a while… ERROR: While executing gem … (Gem::Installer::ExtensionBuildError) ERROR: Failed to build gem native extension. ruby extconf.rb install ccsv …

---

## [RSpec: How do I reload the environment?](https://www.ruby-forum.com/t/rspec-how-do-i-reload-the-environment/125894)

<div class="topic-metadata">

**Author:** [@wet](https://www.ruby-forum.com/u/wet)\
**Replies:** 3\
**Last updated:** [January 16, 2008, 2:07am UTC](https://www.ruby-forum.com/t/rspec-how-do-i-reload-the-environment/125894 "2008-01-16T02:07:09Z")

</div>

Hi I’m writing a series of RSpec tests for a Rails plugin. In some of these tests I use meta-programming (using class\_eval) to change core features of my environment. But these changes to the environment also affect …

---

## [Utime a dir and convert Date to Time](https://www.ruby-forum.com/t/utime-a-dir-and-convert-date-to-time/126094)

<div class="topic-metadata">

**Author:** [@matthew](https://www.ruby-forum.com/u/matthew)\
**Replies:** 3\
**Last updated:** [January 15, 2008, 10:57pm UTC](https://www.ruby-forum.com/t/utime-a-dir-and-convert-date-to-time/126094 "2008-01-15T22:57:46Z")

</div>

Hi list I am learning some core Ruby (non Rails env) by playing with some File i/o stuff and running under JRuby How do I utime a Dir? - Dir doesn’t seem to have the method and passing a dir to File.utime seems to …

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

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