# Ruby

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

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

---

## [Methods and default values](https://www.ruby-forum.com/t/methods-and-default-values/66068)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 3\
**Last updated:** [February 12, 2006, 12:47pm UTC](https://www.ruby-forum.com/t/methods-and-default-values/66068 "2006-02-12T12:47:36Z")

</div>

Hi all, let’s say that I have a very nice: class Text def initialize(text, bold=“no”, italic=“no”, color=“black”) @text=text @bold=bold @italic=italic @color=color end end class TextSet def initialize @texts=A…

---

## [Getting last character from a string](https://www.ruby-forum.com/t/getting-last-character-from-a-string/66001)

<div class="topic-metadata">

**Author:** [@draco](https://www.ruby-forum.com/u/draco)\
**Replies:** 5\
**Last updated:** [February 12, 2006, 10:34am UTC](https://www.ruby-forum.com/t/getting-last-character-from-a-string/66001 "2006-02-12T10:34:34Z")

</div>

Hello I’m new to Ruby. I’ve a simple question. Is there a more readable way to get last character from string than this one? : x = “text” last\_char = x\[x.length-1, x.length-1\]

---

## [Debugging](https://www.ruby-forum.com/t/debugging/65618)

<div class="topic-metadata">

**Author:** [@PaatschS\_Bernd](https://www.ruby-forum.com/u/PaatschS_Bernd)\
**Replies:** 2\
**Last updated:** [February 12, 2006, 8:19am UTC](https://www.ruby-forum.com/t/debugging/65618 "2006-02-12T08:19:37Z")

</div>

Hello, Is it possible in ruby to generate during runtime in case of an error a log file containing the name of the file, the line number and the line of the code? If so how, or where to find information about it? T…

---

## [Facet gem versions](https://www.ruby-forum.com/t/facet-gem-versions/53617)

<div class="topic-metadata">

**Author:** [@brian](https://www.ruby-forum.com/u/brian)\
**Replies:** 2\
**Last updated:** [February 12, 2006, 7:33am UTC](https://www.ruby-forum.com/t/facet-gem-versions/53617 "2006-02-12T07:33:32Z")

</div>

The facet gems currently installed my system are facets (2005.10.30, 2005.10.15, 1.0.2) The proverbial Zoo-of-More for Ruby facets\_core (1.0.2) Vast collection of atomic core extension methods. facets\_more (1.0.2) …

---

## [Re: Simultaneous text input/output in a command line game](https://www.ruby-forum.com/t/re-simultaneous-text-input-output-in-a-command-line-game/66072)

<div class="topic-metadata">

**Author:** [@Gennady\_B](https://www.ruby-forum.com/u/Gennady_B)\
**Replies:** 0\
**Last updated:** [February 12, 2006, 7:17am UTC](https://www.ruby-forum.com/t/re-simultaneous-text-input-output-in-a-command-line-game/66072 "2006-02-12T07:17:47Z")

</div>

Just from the tip of my head: t = Thread.new { while true sleep 5 puts "What are you waiting for, dude? Enter something now: " end } puts "Enter something: " s = gets t.kill puts “You entered: #{s.inspect}” Ge…

---

## [Re: Getting last character from a string](https://www.ruby-forum.com/t/re-getting-last-character-from-a-string/66070)

<div class="topic-metadata">

**Author:** [@Gennady\_B](https://www.ruby-forum.com/u/Gennady_B)\
**Replies:** 0\
**Last updated:** [February 12, 2006, 6:28am UTC](https://www.ruby-forum.com/t/re-getting-last-character-from-a-string/66070 "2006-02-12T06:28:05Z")

</div>

x\[-1\].chr \[tiger-ppc.gfbm:246\]bystr\> irb irb(main):001:0\> s = “abc” =\> “abc” irb(main):002:0\> s\[-1\] =\> 99 irb(main):003:0\> s\[-1\].chr =\> “c” irb(main):004:0\>

---

## [Test message](https://www.ruby-forum.com/t/test-message/65744)

<div class="topic-metadata">

**Author:** [@eric99](https://www.ruby-forum.com/u/eric99)\
**Replies:** 2\
**Last updated:** [February 12, 2006, 4:48am UTC](https://www.ruby-forum.com/t/test-message/65744 "2006-02-12T04:48:40Z")

</div>

hello, is anyone online?

---

## [Adding variables to a binding](https://www.ruby-forum.com/t/adding-variables-to-a-binding/53618)

<div class="topic-metadata">

**Author:** [@marcus](https://www.ruby-forum.com/u/marcus)\
**Replies:** 3\
**Last updated:** [February 12, 2006, 4:33am UTC](https://www.ruby-forum.com/t/adding-variables-to-a-binding/53618 "2006-02-12T04:33:17Z")

</div>

I need to run an ERB template (a normal Rails view template) in a Rails model (and then write the result to a file). The problem is that I need to run it in the scope of the calling controller. So I was thinking of cr…

---

## [February Ruby events in the SF Bay Area](https://www.ruby-forum.com/t/february-ruby-events-in-the-sf-bay-area/66034)

<div class="topic-metadata">

**Author:** [@iceburgh](https://www.ruby-forum.com/u/iceburgh)\
**Replies:** 0\
**Last updated:** [February 12, 2006, 4:09am UTC](https://www.ruby-forum.com/t/february-ruby-events-in-the-sf-bay-area/66034 "2006-02-12T04:09:25Z")

</div>

Although it’s getting late in the month for this announcement, you haven’t missed anything yet (that I know of :-). 2/21 6:00 pm We got a venue! (RSVPs requested, via Meetup) The SF Ruby Meetup usual…

---

## [Re: Getting last character from a string](https://www.ruby-forum.com/t/re-getting-last-character-from-a-string/66025)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [February 12, 2006, 1:12am UTC](https://www.ruby-forum.com/t/re-getting-last-character-from-a-string/66025 "2006-02-12T01:12:09Z")

</div>

you can use text=“my unfinishing text with an unknown last character” result=text\[-1\].chr p result =\> r

---

## [The ruby way of interrupting a Kernel::select?](https://www.ruby-forum.com/t/the-ruby-way-of-interrupting-a-kernel-select/53619)

<div class="topic-metadata">

**Author:** [@Christoffer\_LernSSS](https://www.ruby-forum.com/u/Christoffer_LernSSS)\
**Replies:** 0\
**Last updated:** [February 11, 2006, 11:37pm UTC](https://www.ruby-forum.com/t/the-ruby-way-of-interrupting-a-kernel-select/53619 "2006-02-11T23:37:16Z")

</div>

Hello everyone, As a newbie with too much java-experience, I found it strange that I couldn’t interrupt the Kernel::select. Basically what I wanted to do would be to interrupt the select as soon as a socket decided i…

---

## [Starting Ruby](https://www.ruby-forum.com/t/starting-ruby/65746)

<div class="topic-metadata">

**Author:** [@anil](https://www.ruby-forum.com/u/anil)\
**Replies:** 6\
**Last updated:** [February 11, 2006, 11:03pm UTC](https://www.ruby-forum.com/t/starting-ruby/65746 "2006-02-11T23:03:13Z")

</div>

Hi, i m a web-developer(php).I just started learning ruby. I already tried basic tutorials online.I also installed ruby on my machine(fedora). But i since not understand where i have to write ruby code & how to exec…

---

## [Win32OLE + DRb - Windows = Fun](https://www.ruby-forum.com/t/win32ole-drb-windows-fun/65572)

<div class="topic-metadata">

**Author:** [@keith2koool](https://www.ruby-forum.com/u/keith2koool)\
**Replies:** 2\
**Last updated:** [February 11, 2006, 9:30pm UTC](https://www.ruby-forum.com/t/win32ole-drb-windows-fun/65572 "2006-02-11T21:30:53Z")

</div>

Hey, The following is a message posted to the Boston Ruby Group mailing list after our second meeting last Tuesday. \[ANNOUNCE\] Boston folks that weren’t at the meeting, check out http://boston.rubygroup.org/boston/s…

---

## [Serializing Class and Module objects](https://www.ruby-forum.com/t/serializing-class-and-module-objects/100769)

<div class="topic-metadata">

**Author:** [@Joel\_VanderWerf](https://www.ruby-forum.com/u/Joel_VanderWerf)\
**Replies:** 3\
**Last updated:** [February 11, 2006, 8:52pm UTC](https://www.ruby-forum.com/t/serializing-class-and-module-objects/100769 "2006-02-11T20:52:16Z")

</div>

Hey, \_why, what do you think about allowing YAML to dump/load Class and Module objects rather than gagging? I’ve posted code like the following (different versions for 1.8.2 and 1.8.4) several times in response to inq…

---

## [Insights into Ruby from Lua](https://www.ruby-forum.com/t/insights-into-ruby-from-lua/65829)

<div class="topic-metadata">

**Author:** [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Replies:** 3\
**Last updated:** [February 11, 2006, 8:33pm UTC](https://www.ruby-forum.com/t/insights-into-ruby-from-lua/65829 "2006-02-11T20:33:31Z")

</div>

In my job, I have to use Lua to program some of our software. For anything complex, I love OOP concepts. For those that don’t know, Lua doesn’t have OOP, though it has some syntactic sugar to make basic OOP possible. …

---

## [Determining system information](https://www.ruby-forum.com/t/determining-system-information/53616)

<div class="topic-metadata">

**Author:** [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Replies:** 3\
**Last updated:** [February 11, 2006, 8:15pm UTC](https://www.ruby-forum.com/t/determining-system-information/53616 "2006-02-11T20:15:29Z")

</div>

Chaps, Running ENV in irb displays the system’s environment. I’ve tried the same thing in a script. What’s missing here? #!/usr/bin/ruby -w stuff = %w{ENV RUBY\_VERSION RUBY\_RELEASE\_DATE RUBY\_PLATFORM VERSION} stuff.…

---

## [Graphics in irb](https://www.ruby-forum.com/t/graphics-in-irb/53612)

<div class="topic-metadata">

**Author:** [@Andrew\_McGuinness](https://www.ruby-forum.com/u/Andrew_McGuinness)\
**Replies:** 1\
**Last updated:** [February 11, 2006, 7:35pm UTC](https://www.ruby-forum.com/t/graphics-in-irb/53612 "2006-02-11T19:35:50Z")

</div>

I’m starting to teach my 7-year-old programming in Ruby, but unlike Scheme or Python or Logo, there doesn’t seem to be a graphical interactive environment, such as DrScheme or Livewires. It should be easy to create on…

---

## [LibIDN Ruby Bindings Release 0.0.2](https://www.ruby-forum.com/t/libidn-ruby-bindings-release-0-0-2/65920)

<div class="topic-metadata">

**Author:** [@Erik\_Abele](https://www.ruby-forum.com/u/Erik_Abele)\
**Replies:** 0\
**Last updated:** [February 11, 2006, 6:23pm UTC](https://www.ruby-forum.com/t/libidn-ruby-bindings-release-0-0-2/65920 "2006-02-11T18:23:13Z")

</div>

LibIDN Ruby Bindings Release 0.0.2 This is the second public release of the Ruby Bindings for the GNU LibIDN library, an implementation of the Stringprep, Punycode and IDNA specifications defined by the IETF Interna…

---

## [Testing Rails: problem running a Gruff sample](https://www.ruby-forum.com/t/testing-rails-problem-running-a-gruff-sample/53334)

<div class="topic-metadata">

**Author:** [@rjlyders](https://www.ruby-forum.com/u/rjlyders)\
**Replies:** 4\
**Last updated:** [February 11, 2006, 5:57pm UTC](https://www.ruby-forum.com/t/testing-rails-problem-running-a-gruff-sample/53334 "2006-02-11T17:57:36Z")

</div>

Hi All, I get errors when I try to run a Gruff sample for my WinXP/SP2 system and get an error which I can’t fathom. The sample is “Code Sample” from http://nubyonrails.topfunky.com/pages/gruff (scroll down to find…

---

## [Splitting the Loot (#65)](https://www.ruby-forum.com/t/splitting-the-loot-65/65031)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 8\
**Last updated:** [February 11, 2006, 5:30pm UTC](https://www.ruby-forum.com/t/splitting-the-loot-65/65031 "2006-02-11T17:30:42Z")

</div>

There was some debate on the list about which NP-complete problem this actually is. I personally thought it was a variant of the partitioning problem when I put it together, but others made good cases for similar pr…

---

## [Programming cell phones in Ruby?](https://www.ruby-forum.com/t/programming-cell-phones-in-ruby/65517)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 3\
**Last updated:** [February 11, 2006, 3:48pm UTC](https://www.ruby-forum.com/t/programming-cell-phones-in-ruby/65517 "2006-02-11T15:48:13Z")

</div>

Dear all, I would like to play around with my cell phone a bit … it understands Java MIDP1.0 – is there any way to access this from Ruby ? I have found JRuby in RAA - can you recommend this for some very simple gam…

---

## [Setting the items of anÃ?NSPopUpButton programmatically](https://www.ruby-forum.com/t/setting-the-items-of-ana-nspopupbutton-programmatically/101011)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 2\
**Last updated:** [February 11, 2006, 10:48am UTC](https://www.ruby-forum.com/t/setting-the-items-of-ana-nspopupbutton-programmatically/101011 "2006-02-11T10:48:33Z")

</div>

i’m starting within RubyCocoa, although i’ve been using Cocoa-Java, i want to setup the items of an NSPopUpButton programmatically. the related named ib\_outlets is called “:choixTheme” if i list all the associated met…

---

## [NC Ruby group?](https://www.ruby-forum.com/t/nc-ruby-group/65784)

<div class="topic-metadata">

**Author:** [@asetzler](https://www.ruby-forum.com/u/asetzler)\
**Replies:** 2\
**Last updated:** [February 11, 2006, 9:57am UTC](https://www.ruby-forum.com/t/nc-ruby-group/65784 "2006-02-11T09:57:42Z")

</div>

Hello all, I was just wondering if there was a Ruby group in NC (triad area). If there is one, can someone shoot me a link or something? If not, anyone out there interested in starting one? Thanks! Adam

---

## [Grep via Ruby](https://www.ruby-forum.com/t/grep-via-ruby/102033)

<div class="topic-metadata">

**Author:** [@ralf](https://www.ruby-forum.com/u/ralf)\
**Replies:** 13\
**Last updated:** [February 11, 2006, 1:38am UTC](https://www.ruby-forum.com/t/grep-via-ruby/102033 "2006-02-11T01:38:42Z")

</div>

Hi, I’d like to have a “grep” with case-insensitive match. normal grep does not have this functionality (afaik), but ruby does. So this is, what i wrote: cat rgrep: #!/usr/bin/env ruby Grep with full regexp-functio…

---

## [Preserve value-type semantics in imported types](https://www.ruby-forum.com/t/preserve-value-type-semantics-in-imported-types/65523)

<div class="topic-metadata">

**Author:** [@johnlester](https://www.ruby-forum.com/u/johnlester)\
**Replies:** 4\
**Last updated:** [February 11, 2006, 12:02am UTC](https://www.ruby-forum.com/t/preserve-value-type-semantics-in-imported-types/65523 "2006-02-11T00:02:08Z")

</div>

I’m importing a value type from the CLR and I’d like to preserve value type semantics in Ruby … I’m not sure this can be done. Consider the Point struct in C# as an example: Point p1 = new Point(2, 3); Point p2 = p1…

---

## [Rebinding a Proc](https://www.ruby-forum.com/t/rebinding-a-proc/65569)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 2\
**Last updated:** [February 10, 2006, 10:14pm UTC](https://www.ruby-forum.com/t/rebinding-a-proc/65569 "2006-02-10T22:14:07Z")

</div>

Weird stuff ahead. I’m making (actually, remaking) a DSL. I’m re-visioning RHDL to take more advantage of metaprogramming tricks. So I’d like the user to be able to declare a logic gate like so: class AndGate \< RHD…

---

## [Re: Yahoo! Widgets (JavaScript) - do we have a anything like](https://www.ruby-forum.com/t/re-yahoo-widgets-javascript-do-we-have-a-anything-like/64948)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 14\
**Last updated:** [February 10, 2006, 9:19pm UTC](https://www.ruby-forum.com/t/re-yahoo-widgets-javascript-do-we-have-a-anything-like/64948 "2006-02-10T21:19:53Z")

</div>

Dear Glenn, Fox is a GUI toolkit that can run on Windows, Linux, OSX. There are Ruby bindings FXRuby for it. Just yesterday,a new version of foxGUIb, a very nice helper for building GUIs with all sorts of widgets …

---

## [How to test a ruby class](https://www.ruby-forum.com/t/how-to-test-a-ruby-class/65519)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 2\
**Last updated:** [February 10, 2006, 8:47pm UTC](https://www.ruby-forum.com/t/how-to-test-a-ruby-class/65519 "2006-02-10T20:47:26Z")

</div>

Hi: I just installed Ruby and have FreeRIDE open. In Ruby, is there a method comparable to the “main” method in java that will run the class for testing? I would like to run my class from the IDE. Thanks, Doug E…

---

## [Re: how to test a ruby class](https://www.ruby-forum.com/t/re-how-to-test-a-ruby-class/65521)

<div class="topic-metadata">

**Author:** [@Gennady\_B](https://www.ruby-forum.com/u/Gennady_B)\
**Replies:** 0\
**Last updated:** [February 10, 2006, 8:15pm UTC](https://www.ruby-forum.com/t/re-how-to-test-a-ruby-class/65521 "2006-02-10T20:15:25Z")

</div>

You can do === some-class.rb class SomeClass … end if $0 == FILE c = SomeClass.new c.whatever\_method\_you\_want\_to\_test end This way the code in the ‘if’ block will be executed only when you do $ ruby some-class.…

---

## [Re: How to find the current path?](https://www.ruby-forum.com/t/re-how-to-find-the-current-path/65520)

<div class="topic-metadata">

**Author:** [@PaatschS\_Bernd](https://www.ruby-forum.com/u/PaatschS_Bernd)\
**Replies:** 0\
**Last updated:** [February 10, 2006, 8:09pm UTC](https://www.ruby-forum.com/t/re-how-to-find-the-current-path/65520 "2006-02-10T20:09:54Z")

</div>

Thanks, Dir.pwd is what I was looking for. Bernd

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

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