# Ruby

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

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

---

## [Markov Chains (#74)](https://www.ruby-forum.com/t/markov-chains-74/93900)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 0\
**Last updated:** [April 13, 2006, 2:51pm UTC](https://www.ruby-forum.com/t/markov-chains-74/93900 "2006-04-13T14:51:26Z")

</div>

I owe myself a signed copy of my book. Err, I mean, this was a popular quiz! That’s always great because I have so many wonderful selections of code to talk about in the summary, but it can also be hard because I ha…

---

## [Re: File basenames using File.basename . .](https://www.ruby-forum.com/t/re-file-basenames-using-file-basename/93879)

<div class="topic-metadata">

**Author:** [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Replies:** 1\
**Last updated:** [April 13, 2006, 1:56pm UTC](https://www.ruby-forum.com/t/re-file-basenames-using-file-basename/93879 "2006-04-13T13:56:31Z")

</div>

Thanks, Dan. I still get the same thing, though: File.basename(txtfile, “.\*”) } =\> \[“eula.txt”, “libcurl.COPYING.txt”, “openssl.LICENSE.txt”, “psout2.txt”, “run dll32.exe.Z-missing.txt”\] Oh, you’re just seeing…

---

## [Simple substitutions](https://www.ruby-forum.com/t/simple-substitutions/57607)

<div class="topic-metadata">

**Author:** [@bodikp](https://www.ruby-forum.com/u/bodikp)\
**Replies:** 12\
**Last updated:** [April 13, 2006, 1:49pm UTC](https://www.ruby-forum.com/t/simple-substitutions/57607 "2006-04-13T13:49:41Z")

</div>

Hello, Some of you all helped this newbie a couple of weeks ago. I’m getting there! I have a need to parse postscript print files on a daily basis. Some of them are over 10 mB. One thing I need to find out is the num…

---

## [Equivalent of Java static code block in Ruby?](https://www.ruby-forum.com/t/equivalent-of-java-static-code-block-in-ruby/93848)

<div class="topic-metadata">

**Author:** [@weyus](https://www.ruby-forum.com/u/weyus)\
**Replies:** 10\
**Last updated:** [April 13, 2006, 11:36am UTC](https://www.ruby-forum.com/t/equivalent-of-java-static-code-block-in-ruby/93848 "2006-04-13T11:36:56Z")

</div>

All, Is there a notion of a class level “static” code block in Ruby that would get executed whenever the class is loaded? Basically the equivalent of Java’s “static {…}” construct? I don’t necessarily want to put th…

---

## [Installing on Solaris using sparc-sun-solaris-2.8](https://www.ruby-forum.com/t/installing-on-solaris-using-sparc-sun-solaris-2-8/57623)

<div class="topic-metadata">

**Author:** [@powerflower](https://www.ruby-forum.com/u/powerflower)\
**Replies:** 6\
**Last updated:** [April 13, 2006, 11:13am UTC](https://www.ruby-forum.com/t/installing-on-solaris-using-sparc-sun-solaris-2-8/57623 "2006-04-13T11:13:17Z")

</div>

I am a newbie to Solaris and Ruby. I have downloaded the source for Ruby 1.8.4, I added CC to the environment using “CC=/usr/local/bin/gcc” & “export CC”. I have run ./configure successfully. I then set my variables …

---

## [Segmentation fault in recursive function](https://www.ruby-forum.com/t/segmentation-fault-in-recursive-function/57665)

<div class="topic-metadata">

**Author:** [@fink](https://www.ruby-forum.com/u/fink)\
**Replies:** 1\
**Last updated:** [April 13, 2006, 10:35am UTC](https://www.ruby-forum.com/t/segmentation-fault-in-recursive-function/57665 "2006-04-13T10:35:11Z")

</div>

Hi, when executing the attached code I get a segmentation fault. I know the code does not make that much sense but nervertheless should ruby never segfault but throw a SystemStackError or something similar. I am usin…

---

## [Re: Segmentation fault in recursive function](https://www.ruby-forum.com/t/re-segmentation-fault-in-recursive-function/57707)

<div class="topic-metadata">

**Author:** [@dasch](https://www.ruby-forum.com/u/dasch)\
**Replies:** 0\
**Last updated:** [April 13, 2006, 8:26am UTC](https://www.ruby-forum.com/t/re-segmentation-fault-in-recursive-function/57707 "2006-04-13T08:26:11Z")

</div>

It’s most likely because something isn’t compiled right. It’s just as likely gentoo’s fault as it is ruby’s. Upgraded your gcc lately? Updated any of a thousand other dependent libraries lately? Give revdep-rebuild a …

---

## [New ruby forum site](https://www.ruby-forum.com/t/new-ruby-forum-site/57706)

<div class="topic-metadata">

**Author:** [@jtoy](https://www.ruby-forum.com/u/jtoy)\
**Replies:** 1\
**Last updated:** [April 13, 2006, 7:31am UTC](https://www.ruby-forum.com/t/new-ruby-forum-site/57706 "2006-04-13T07:31:05Z")

</div>

Hi everyone, I just finished making this forum site at http://talk.rubynow.com . I was wondering if anyone could make any suggestions for the site and maybe try the site out. I had started the site a few months ago,…

---

## [Difference between classes' methods and its "own" methods?](https://www.ruby-forum.com/t/difference-between-classes-methods-and-its-own-methods/93876)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 2\
**Last updated:** [April 13, 2006, 6:27am UTC](https://www.ruby-forum.com/t/difference-between-classes-methods-and-its-own-methods/93876 "2006-04-13T06:27:10Z")

</div>

Little confused, why don’t the product the same thing? X.methods(false) =\> \[“xxx”\] irb(main):018:0\> (class \<\< X; self; end).instance\_methods(false) =\> \[“xxx”, “to\_yaml”, “yaml\_tag\_subclasses?”, “new”, “superclass”, …

---

## [Shell.rb and class \<\< Shell](https://www.ruby-forum.com/t/shell-rb-and-class-shell/57695)

<div class="topic-metadata">

**Author:** [@amin1426](https://www.ruby-forum.com/u/amin1426)\
**Replies:** 1\
**Last updated:** [April 13, 2006, 4:10am UTC](https://www.ruby-forum.com/t/shell-rb-and-class-shell/57695 "2006-04-13T04:10:14Z")

</div>

I’m confuzzled. In lib/shell.rb I read… ============================================================ class Shell @RCS\_ID=’-$Id: shell.rb,v 1.8 2001/03/19 09:01:11 keiju Exp keiju $-’ include Error extend Exception2…

---

## [SDL in ruby?](https://www.ruby-forum.com/t/sdl-in-ruby/93881)

<div class="topic-metadata">

**Author:** [@Stuffer](https://www.ruby-forum.com/u/Stuffer)\
**Replies:** 1\
**Last updated:** [April 13, 2006, 12:46am UTC](https://www.ruby-forum.com/t/sdl-in-ruby/93881 "2006-04-13T00:46:24Z")

</div>

What use for SDL support in ruby? I dont need extra performance for SDL, so usage of ruby is OK, but i cannot decide what to use.

---

## [Using ansicolor](https://www.ruby-forum.com/t/using-ansicolor/57583)

<div class="topic-metadata">

**Author:** [@Sy\_Ali](https://www.ruby-forum.com/u/Sy_Ali)\
**Replies:** 13\
**Last updated:** [April 13, 2006, 12:08am UTC](https://www.ruby-forum.com/t/using-ansicolor/57583 "2006-04-13T00:08:59Z")

</div>

http://term-ansicolor.rubyforge.org/ I did a successful gem install of term-ansicolor and am trying to use it: include Term::ANSIColor print red, bold, “red bold”, reset, “\\n” gives me: uninitialized constant Term …

---

## [File basenames using File.basename . .](https://www.ruby-forum.com/t/file-basenames-using-file-basename/93877)

<div class="topic-metadata">

**Author:** [@bodikp](https://www.ruby-forum.com/u/bodikp)\
**Replies:** 1\
**Last updated:** [April 12, 2006, 10:59pm UTC](https://www.ruby-forum.com/t/file-basenames-using-file-basename/93877 "2006-04-12T22:59:16Z")

</div>

I need to truncate the extension of some of my files, so that I can add a different extension for a separate write file. I’ve tried this: txtfiles = Dir.glob(".txt") txtfiles.each { |txtfile| File.basename(“txtfile”, …

---

## [Ruby auto formatter](https://www.ruby-forum.com/t/ruby-auto-formatter/57525)

<div class="topic-metadata">

**Author:** [@jamal86](https://www.ruby-forum.com/u/jamal86)\
**Replies:** 3\
**Last updated:** [April 12, 2006, 10:32pm UTC](https://www.ruby-forum.com/t/ruby-auto-formatter/57525 "2006-04-12T22:32:41Z")

</div>

Is there a Windows tool that does a reasonable job of globally formatting an existing Ruby script file so that it complies with the convention for code indentation? Jamal

---

## [FYI Attribute names with spaces in 1.8.4](https://www.ruby-forum.com/t/fyi-attribute-names-with-spaces-in-1-8-4/57671)

<div class="topic-metadata">

**Author:** [@reevesg](https://www.ruby-forum.com/u/reevesg)\
**Replies:** 0\
**Last updated:** [April 12, 2006, 10:07pm UTC](https://www.ruby-forum.com/t/fyi-attribute-names-with-spaces-in-1-8-4/57671 "2006-04-12T22:07:04Z")

</div>

It seems that attribute names cannot contain spaces since 1.8.4. Of course generally you wouldn’t want your attribute name to have a space but I was adding them dynamically. If your interested, there is some more info…

---

## [Re: File basenames using File.basename . .](https://www.ruby-forum.com/t/re-file-basenames-using-file-basename/93875)

<div class="topic-metadata">

**Author:** [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Replies:** 1\
**Last updated:** [April 12, 2006, 9:52pm UTC](https://www.ruby-forum.com/t/re-file-basenames-using-file-basename/93875 "2006-04-12T21:52:30Z")

</div>

a different extension for a separate write file. I’ve tried this: txtfiles = Dir.glob(".txt") txtfiles.each { |txtfile| File.basename(“txtfile”, ".txt") } Remove the quotes around txtfile. Change “\*.txt” to just “.…

---

## [Can not install mysql for ruby](https://www.ruby-forum.com/t/can-not-install-mysql-for-ruby/57606)

<div class="topic-metadata">

**Author:** [@splattael](https://www.ruby-forum.com/u/splattael)\
**Replies:** 5\
**Last updated:** [April 12, 2006, 9:21pm UTC](https://www.ruby-forum.com/t/can-not-install-mysql-for-ruby/57606 "2006-04-12T21:21:36Z")

</div>

Hello, I hope this is not too off-topic, but after 2 days of googling and trying everything possible that crossed my mind i have no idea what to do/how to go on. I have double checked 10k times that i have every pack…

---

## [Gateway?](https://www.ruby-forum.com/t/gateway/93871)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [April 12, 2006, 8:23pm UTC](https://www.ruby-forum.com/t/gateway/93871 "2006-04-12T20:23:18Z")

</div>

Anything I can do to fix the gateway? Please? T.

---

## [Using gems problem -- LoadError](https://www.ruby-forum.com/t/using-gems-problem-loaderror/57632)

<div class="topic-metadata">

**Author:** [@Vladsialv\_T](https://www.ruby-forum.com/u/Vladsialv_T)\
**Replies:** 2\
**Last updated:** [April 12, 2006, 6:59pm UTC](https://www.ruby-forum.com/t/using-gems-problem-loaderror/57632 "2006-04-12T18:59:45Z")

</div>

Hello all, I am a newbie with ruby and gems and I have this frustrating problem not being able to load any gem I install. I am running Ubuntu 5.10 and I have just installed ruby1.8 deb (1.8.4) and have compiled rubyg…

---

## [Unsupported file format (SQLite3)](https://www.ruby-forum.com/t/unsupported-file-format-sqlite3/57637)

<div class="topic-metadata">

**Author:** [@ian](https://www.ruby-forum.com/u/ian)\
**Replies:** 0\
**Last updated:** [April 12, 2006, 6:14pm UTC](https://www.ruby-forum.com/t/unsupported-file-format-sqlite3/57637 "2006-04-12T18:14:24Z")

</div>

I’m running sqlite3-ruby 1.1.0 and sqlite 3.3.4 on 2 linux machines. I create a (small, single table) database on 1 machine, and I can re-open it and work with it fine on that machine. I copy it over to the other and …

---

## [Style question: if !x vs. unless x](https://www.ruby-forum.com/t/style-question-if-x-vs-unless-x/57532)

<div class="topic-metadata">

**Author:** [@david](https://www.ruby-forum.com/u/david)\
**Replies:** 9\
**Last updated:** [April 12, 2006, 5:10pm UTC](https://www.ruby-forum.com/t/style-question-if-x-vs-unless-x/57532 "2006-04-12T17:10:23Z")

</div>

Hi all, One of the coolest things for me about learning ruby is that it’s the first language I’ve learned in a decade where I actually had to learn a new language. Once you know C/C++, you can pick up Java, PHP, perl…

---

## [Smalltalk's favorite Boolean method](https://www.ruby-forum.com/t/smalltalks-favorite-boolean-method/57497)

<div class="topic-metadata">

**Author:** [@ruby-rider](https://www.ruby-forum.com/u/ruby-rider)\
**Replies:** 7\
**Last updated:** [April 12, 2006, 5:07pm UTC](https://www.ruby-forum.com/t/smalltalks-favorite-boolean-method/57497 "2006-04-12T17:07:22Z")

</div>

Hi, For a long time I have been programming Smalltalk. Recently, Ruby “got me” and I was wondering how the famous ifTrue:ifFalse: could be added to the System. 1 = 2 ifTrue: \[Transcript show: “true!” \] ifFalse: \[…

---

## [Class Definition inside a method definition?](https://www.ruby-forum.com/t/class-definition-inside-a-method-definition/57451)

<div class="topic-metadata">

**Author:** [@Bihal](https://www.ruby-forum.com/u/Bihal)\
**Replies:** 24\
**Last updated:** [April 12, 2006, 5:05pm UTC](https://www.ruby-forum.com/t/class-definition-inside-a-method-definition/57451 "2006-04-12T17:05:53Z")

</div>

I was under the impression that a class definition could not be inside a method. Quote from Programming Ruby “Method definitions may not contain class, module, or instance method definitions.” And yet I’ve found thi…

---

## [Module inheritance](https://www.ruby-forum.com/t/module-inheritance/57633)

<div class="topic-metadata">

**Author:** [@beachguy82](https://www.ruby-forum.com/u/beachguy82)\
**Replies:** 0\
**Last updated:** [April 12, 2006, 5:05pm UTC](https://www.ruby-forum.com/t/module-inheritance/57633 "2006-04-12T17:05:53Z")

</div>

I’m trying to modify a module but I can’t seem to access it’s private functions. This is for a rails app but I can’t find the help I’m looking for on the rails list and it’s more of a ruby question than a rails quest…

---

## [Rubyscript2exe and gem](https://www.ruby-forum.com/t/rubyscript2exe-and-gem/57630)

<div class="topic-metadata">

**Author:** [@giom](https://www.ruby-forum.com/u/giom)\
**Replies:** 0\
**Last updated:** [April 12, 2006, 4:53pm UTC](https://www.ruby-forum.com/t/rubyscript2exe-and-gem/57630 "2006-04-12T16:53:30Z")

</div>

Is there a way to tag files in a gem according to their “function”, like documentation, code, etc. The reason I am wondering about this is when I pack a program up with rubyscript2exe, it packages the entire directory…

---

## [Re: Substituting from another file](https://www.ruby-forum.com/t/re-substituting-from-another-file/93864)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [April 12, 2006, 3:49pm UTC](https://www.ruby-forum.com/t/re-substituting-from-another-file/93864 "2006-04-12T15:49:02Z")

</div>

I had resolved a similar problem some time ago by reading what corresponds to your dictionary data into a hash (i.e., {‘PANELED’ =\>‘P AE1 N AH0 L D’, ‘PANELING’=\>“P AE1 N AH0 L IH0 NG”} ). I would then replace th…

---

## [Substituting from another file](https://www.ruby-forum.com/t/substituting-from-another-file/57619)

<div class="topic-metadata">

**Author:** [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Replies:** 0\
**Last updated:** [April 12, 2006, 3:31pm UTC](https://www.ruby-forum.com/t/substituting-from-another-file/57619 "2006-04-12T15:31:31Z")

</div>

I have a textfile with a long text, and a wordlist with words both in letters and phonetic notation. I want to substitute all the words in the text with their phonetic spelling from the wordlist. The wordlist entries …

---

## [Uninitialized constant Customer (NameError)](https://www.ruby-forum.com/t/uninitialized-constant-customer-nameerror/57527)

<div class="topic-metadata">

**Author:** [@gopal](https://www.ruby-forum.com/u/gopal)\
**Replies:** 3\
**Last updated:** [April 12, 2006, 1:11pm UTC](https://www.ruby-forum.com/t/uninitialized-constant-customer-nameerror/57527 "2006-04-12T13:11:55Z")

</div>

Hi everybody, I created a class called Customer and created a sub class called Transaction. The problem iam facing is i can’t extract the super class methods and variables from sub class (i.e from Transaction class). …

---

## [Re: a newbie. not getting run a script](https://www.ruby-forum.com/t/re-a-newbie-not-getting-run-a-script/57595)

<div class="topic-metadata">

**Author:** [@PeSSSSaS\_Botp](https://www.ruby-forum.com/u/PeSSSSaS_Botp)\
**Replies:** 0\
**Last updated:** [April 12, 2006, 9:41am UTC](https://www.ruby-forum.com/t/re-a-newbie-not-getting-run-a-script/57595 "2006-04-12T09:41:41Z")

</div>

san wrote last Wednesday, April 12, 2006 1:45 PM: #i have tried all the methods above but in vain #line by line commands are being executed but i could not run #the program #as a whole #i have a screenshot of the c…

---

## [A newbie. not getting run a script](https://www.ruby-forum.com/t/a-newbie-not-getting-run-a-script/57244)

<div class="topic-metadata">

**Author:** [@san](https://www.ruby-forum.com/u/san)\
**Replies:** 8\
**Last updated:** [April 12, 2006, 9:20am UTC](https://www.ruby-forum.com/t/a-newbie-not-getting-run-a-script/57244 "2006-04-12T09:20:09Z")

</div>

how to start ruby programming installed a irb. started a tutorial as in following website http://www.crai.archi.fr/RubyLibraryDepot/Ruby/RUBY\_Library\_Depot.htm in programming chapter it asks to type and save a coding…

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

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