# Ruby

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

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

---

## [\[OT\] Ruby as a poetic language?](https://www.ruby-forum.com/t/ot-ruby-as-a-poetic-language/169554)

<div class="topic-metadata">

**Author:** [@albertosesena](https://www.ruby-forum.com/u/albertosesena)\
**Replies:** 5\
**Last updated:** [June 5, 2009, 11:30pm UTC](https://www.ruby-forum.com/t/ot-ruby-as-a-poetic-language/169554 "2009-06-05T23:30:40Z")

</div>

According to google… yes! → http://unix-monk.com/pub/Ruby.jpg

---

## [Problem with cronjob and ruby script](https://www.ruby-forum.com/t/problem-with-cronjob-and-ruby-script/169580)

<div class="topic-metadata">

**Author:** [@turnkeytraders](https://www.ruby-forum.com/u/turnkeytraders)\
**Replies:** 19\
**Last updated:** [June 5, 2009, 10:55pm UTC](https://www.ruby-forum.com/t/problem-with-cronjob-and-ruby-script/169580 "2009-06-05T22:55:56Z")

</div>

Hello, I’m trying to get a ruby script run into a crontab and it keeps failing saying it can’t find my mechanize gem. When I run the script form the command line, everything runs fine and I don’t get any failures. An…

---

## [Block one cookie and accept others?](https://www.ruby-forum.com/t/block-one-cookie-and-accept-others/169608)

<div class="topic-metadata">

**Author:** [@mmcolli00](https://www.ruby-forum.com/u/mmcolli00)\
**Replies:** 0\
**Last updated:** [June 5, 2009, 9:37pm UTC](https://www.ruby-forum.com/t/block-one-cookie-and-accept-others/169608 "2009-06-05T21:37:24Z")

</div>

This may be a shot in the dark, but does anyone know if it is possible to block one cookie and accept other cookies using ruby? Please point me in the right direction. Thanks in advance. MC

---

## [Sup 0.8 released](https://www.ruby-forum.com/t/sup-0-8-released/169603)

<div class="topic-metadata">

**Author:** [@trucker](https://www.ruby-forum.com/u/trucker)\
**Replies:** 0\
**Last updated:** [June 5, 2009, 9:03pm UTC](https://www.ruby-forum.com/t/sup-0-8-released/169603 "2009-06-05T21:03:42Z")

</div>

I’m pleased to announce the release of Sup 0.8. Sup is a console-based email client for people with a lot of email. It supports tagging, very fast full-text search, automatic contact- list management, and more. If you…

---

## [Workaround for rake (even with --trace) seemingly eating stdout and stderr in JRuby - is this ok, or](https://www.ruby-forum.com/t/workaround-for-rake-even-with-trace-seemingly-eating-stdout-and-stderr-in-jruby-is-this-ok-or/169516)

<div class="topic-metadata">

**Author:** [@pfharlock](https://www.ruby-forum.com/u/pfharlock)\
**Replies:** 7\
**Last updated:** [June 5, 2009, 8:27pm UTC](https://www.ruby-forum.com/t/workaround-for-rake-even-with-trace-seemingly-eating-stdout-and-stderr-in-jruby-is-this-ok-or/169516 "2009-06-05T20:27:19Z")

</div>

For testing a JRuby + (Jruby) Rack + Sinatra app, in my Rakefile I have: —start Rakefile— raise “Rake must be called with JRuby: try again with \`jruby -S rake’” unless defined?(JRUBY\_VERSION) #raise “Read the README.…

---

## [How to send the email by Ruby script?](https://www.ruby-forum.com/t/how-to-send-the-email-by-ruby-script/169595)

<div class="topic-metadata">

**Author:** [@chenpassion](https://www.ruby-forum.com/u/chenpassion)\
**Replies:** 4\
**Last updated:** [June 5, 2009, 8:10pm UTC](https://www.ruby-forum.com/t/how-to-send-the-email-by-ruby-script/169595 "2009-06-05T20:10:18Z")

</div>

Hi, Guys, I can read my sina.com email by the following code: require ‘net/pop’ Net::POP3.foreach(‘pop3.sina.com.cn’, 110, ‘removed\_email\_address@domain.invalid’, ‘my\_password’ ) do |email| hdr = email.header if hd…

---

## [Code Review: LazyMethods](https://www.ruby-forum.com/t/code-review-lazymethods/169540)

<div class="topic-metadata">

**Author:** [@grujildo](https://www.ruby-forum.com/u/grujildo)\
**Replies:** 2\
**Last updated:** [June 5, 2009, 7:53pm UTC](https://www.ruby-forum.com/t/code-review-lazymethods/169540 "2009-06-05T19:53:51Z")

</div>

tfpt review “/shelveset:LazyMethods;REDMOND\\tomat” A simple change in DLR. Ruby: Implements lazy method transformation. Previously a method was transformed to DLR AST as soon as it was defined (def foo; …; end). We …

---

## [How to capitalize first word of a string?](https://www.ruby-forum.com/t/how-to-capitalize-first-word-of-a-string/169528)

<div class="topic-metadata">

**Author:** [@railslist](https://www.ruby-forum.com/u/railslist)\
**Replies:** 4\
**Last updated:** [June 5, 2009, 7:37pm UTC](https://www.ruby-forum.com/t/how-to-capitalize-first-word-of-a-string/169528 "2009-06-05T19:37:21Z")

</div>

I have a string that I would like to capitalize and add bold html tag to the first word only. How do i do it?. Do I have to split first and then “upcase!” it then join again. Not sure how to do it. any help is muc…

---

## [Javafx with jruby possible?](https://www.ruby-forum.com/t/javafx-with-jruby-possible/169594)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 0\
**Last updated:** [June 5, 2009, 6:49pm UTC](https://www.ruby-forum.com/t/javafx-with-jruby-possible/169594 "2009-06-05T18:49:27Z")

</div>

Is it at all possible to drive javafx with jruby? If so that could become the killer app :slight\_smile: Cheers! -=r

---

## [Mysql gem error](https://www.ruby-forum.com/t/mysql-gem-error/169394)

<div class="topic-metadata">

**Author:** [@virendra](https://www.ruby-forum.com/u/virendra)\
**Replies:** 1\
**Last updated:** [June 5, 2009, 6:48pm UTC](https://www.ruby-forum.com/t/mysql-gem-error/169394 "2009-06-05T18:48:46Z")

</div>

Hello I am trying to install mysql gem in jruby but it is resulting in error Building native extensions. This could take a while… ERROR: Error installing mysql: ERROR: Failed to build gem native extension. C:/jrub…

---

## [Anonymous class with JRuby](https://www.ruby-forum.com/t/anonymous-class-with-jruby/169487)

<div class="topic-metadata">

**Author:** [@4wai](https://www.ruby-forum.com/u/4wai)\
**Replies:** 4\
**Last updated:** [June 5, 2009, 6:38pm UTC](https://www.ruby-forum.com/t/anonymous-class-with-jruby/169487 "2009-06-05T18:38:01Z")

</div>

Hi all, I have some questions about anonymous class with JRuby. I want to have some code like JPanel p = new JPanel() { public void paint(Graphics g) { //draw something } }; new JFrame().getContentPane().add( p); …

---

## [Question about exiting from a block](https://www.ruby-forum.com/t/question-about-exiting-from-a-block/169538)

<div class="topic-metadata">

**Author:** [@guoliang](https://www.ruby-forum.com/u/guoliang)\
**Replies:** 7\
**Last updated:** [June 5, 2009, 5:15pm UTC](https://www.ruby-forum.com/t/question-about-exiting-from-a-block/169538 "2009-06-05T17:15:52Z")

</div>

def test puts ‘before’ yield 2 puts ‘after’ end test do |i| XXX if i \> 1 a lot of code appears below end I have code above and wonder if it is possible to use return/break/anything to stop execution of block and…

---

## [Hash of hashes group\_by](https://www.ruby-forum.com/t/hash-of-hashes-group-by/169578)

<div class="topic-metadata">

**Author:** [@dnstevenson](https://www.ruby-forum.com/u/dnstevenson)\
**Replies:** 1\
**Last updated:** [June 5, 2009, 5:06pm UTC](https://www.ruby-forum.com/t/hash-of-hashes-group-by/169578 "2009-06-05T17:06:03Z")

</div>

Hi Guys, I have the following code which grabs some data from the database in my model def get\_stats sql = “select id, value from table” my\_data = self.class.connection.select\_all(sql) my\_data.group\_by { |row| row\[…

---

## [Games for Programmers](https://www.ruby-forum.com/t/games-for-programmers/169279)

<div class="topic-metadata">

**Author:** [@danielb](https://www.ruby-forum.com/u/danielb)\
**Replies:** 17\
**Last updated:** [June 5, 2009, 4:31pm UTC](https://www.ruby-forum.com/t/games-for-programmers/169279 "2009-06-05T16:31:54Z")

</div>

Hi everyone, Here’s a list of board or card games that are based, more or less, on computer programming, along with a description. The games range from obscure to humorous. Note that I have not played any of these my…

---

## [Env change, or iconv library self-mutated?](https://www.ruby-forum.com/t/env-change-or-iconv-library-self-mutated/169437)

<div class="topic-metadata">

**Author:** [@mk27](https://www.ruby-forum.com/u/mk27)\
**Replies:** 10\
**Last updated:** [June 5, 2009, 3:52pm UTC](https://www.ruby-forum.com/t/env-change-or-iconv-library-self-mutated/169437 "2009-06-05T15:52:26Z")

</div>

I have been trying to use iconv to deal with ISO-8559-1 to UTF-8 translation of web page data in rails. I wrote a short program to test the syntax, processing one of the pages I was having a problem with. It worked, …

---

## [Specifying ports when creating sockets?](https://www.ruby-forum.com/t/specifying-ports-when-creating-sockets/169569)

<div class="topic-metadata">

**Author:** [@alexmic](https://www.ruby-forum.com/u/alexmic)\
**Replies:** 1\
**Last updated:** [June 5, 2009, 11:50am UTC](https://www.ruby-forum.com/t/specifying-ports-when-creating-sockets/169569 "2009-06-05T11:50:18Z")

</div>

In TCP, when you create a socket to a particular address, the OS chooses a free port number. I’d like to either specify that port number, or find out that port number. I can easily find the port number like so: sock…

---

## [Nested HTTP params on ruby HTTP requests](https://www.ruby-forum.com/t/nested-http-params-on-ruby-http-requests/169496)

<div class="topic-metadata">

**Author:** [@dgaj](https://www.ruby-forum.com/u/dgaj)\
**Replies:** 5\
**Last updated:** [June 5, 2009, 10:14am UTC](https://www.ruby-forum.com/t/nested-http-params-on-ruby-http-requests/169496 "2009-06-05T10:14:56Z")

</div>

Hi, I’m using ruby HTTP classes to send POST requests to a server. The problem is that I’m posting some many-levels hierarchical structures on my form . When POST parameters are simple key/value there’s no serializat…

---

## [State of the JRuby wiki](https://www.ruby-forum.com/t/state-of-the-jruby-wiki/169515)

<div class="topic-metadata">

**Author:** [@iceburgh](https://www.ruby-forum.com/u/iceburgh)\
**Replies:** 4\
**Last updated:** [June 5, 2009, 10:09am UTC](https://www.ruby-forum.com/t/state-of-the-jruby-wiki/169515 "2009-06-05T10:09:12Z")

</div>

Can someone fill me in on what the state of the JRuby wiki is? A few months ago I remember a thread about moving everything over to Kenai. Is that still the plan? I was going to update the Nailgun page since it’s n…

---

## [How is alias magic?](https://www.ruby-forum.com/t/how-is-alias-magic/163539)

<div class="topic-metadata">

**Author:** [@LAMBEAU\_Bernard](https://www.ruby-forum.com/u/LAMBEAU_Bernard)\
**Replies:** 2\
**Last updated:** [June 5, 2009, 9:50am UTC](https://www.ruby-forum.com/t/how-is-alias-magic/163539 "2009-06-05T09:50:58Z")

</div>

Hi all, Is there any way to create a alias-like method allowing arguments not to be separated by comma? def my\_alias(from, to) … end myalias :me :you thx blambeau

---

## [Ruby Mendicant 2.0 (An Effort To Make RubySpec even more awesome)](https://www.ruby-forum.com/t/ruby-mendicant-2-0-an-effort-to-make-rubyspec-even-more-awesome/169544)

<div class="topic-metadata">

**Author:** [@naething](https://www.ruby-forum.com/u/naething)\
**Replies:** 0\
**Last updated:** [June 5, 2009, 1:05am UTC](https://www.ruby-forum.com/t/ruby-mendicant-2-0-an-effort-to-make-rubyspec-even-more-awesome/169544 "2009-06-05T01:05:43Z")

</div>

Hi folks, For those familiar with Ruby Mendicant (http://majesticseacreature.com/mendicant/), this is actually a totally different project. But it does have to do with community funded open source development, and s…

---

## [Class Method & Singletons - newbie question](https://www.ruby-forum.com/t/class-method-singletons-newbie-question/169428)

<div class="topic-metadata">

**Author:** [@koko](https://www.ruby-forum.com/u/koko)\
**Replies:** 2\
**Last updated:** [June 5, 2009, 1:03am UTC](https://www.ruby-forum.com/t/class-method-singletons-newbie-question/169428 "2009-06-05T01:03:22Z")

</div>

Dear Freinds, Class Method and Singletons are the same? Can you explain me with some simple code. Many thanks in advance, regards, salai.

---

## [GlassFish gem 0.9.5 released](https://www.ruby-forum.com/t/glassfish-gem-0-9-5-released/169543)

<div class="topic-metadata">

**Author:** [@Vivek\_P](https://www.ruby-forum.com/u/Vivek_P)\
**Replies:** 0\
**Last updated:** [June 5, 2009, 12:55am UTC](https://www.ruby-forum.com/t/glassfish-gem-0-9-5-released/169543 "2009-06-05T00:55:12Z")

</div>

I am pleased to announce availability of GlassFish gem 0.9.5. It was released in quick succession of 0.9.4 as a fix in 0.9.4 version broke GlassFish gem integration with NetBeans 6.7. RC1. GlassFish gem documentation …

---

## [Why is require 'rubygems' sometimes needed?](https://www.ruby-forum.com/t/why-is-require-rubygems-sometimes-needed/169475)

<div class="topic-metadata">

**Author:** [@leveille](https://www.ruby-forum.com/u/leveille)\
**Replies:** 8\
**Last updated:** [June 5, 2009, 12:53am UTC](https://www.ruby-forum.com/t/why-is-require-rubygems-sometimes-needed/169475 "2009-06-05T00:53:39Z")

</div>

I noticed that some libraries (such as wx or gnuplot) need to have require ‘rubygems’ before the require of the actual library of interest. But some other libraries (such as gsl) do not require this. Can someone expla…

---

## [Regular expressions: Find part of a string](https://www.ruby-forum.com/t/regular-expressions-find-part-of-a-string/169530)

<div class="topic-metadata">

**Author:** [@Jermaine](https://www.ruby-forum.com/u/Jermaine)\
**Replies:** 4\
**Last updated:** [June 5, 2009, 12:10am UTC](https://www.ruby-forum.com/t/regular-expressions-find-part-of-a-string/169530 "2009-06-05T00:10:44Z")

</div>

Hello Everyone, I’m quite new to regular expressions, and I’m looking for a way to find the first 3 letters in a string. So let’s say I have the following string: “foobar”, I want to know what the first three letters…

---

## [Deaf Calculus](https://www.ruby-forum.com/t/deaf-calculus/169518)

<div class="topic-metadata">

**Author:** [@lynxinator](https://www.ruby-forum.com/u/lynxinator)\
**Replies:** 4\
**Last updated:** [June 4, 2009, 10:56pm UTC](https://www.ruby-forum.com/t/deaf-calculus/169518 "2009-06-04T22:56:09Z")

</div>

Hey, I am trying a variation of Deaf Grandma program that takes off of Tintin’s Character Professor Calculus. I tried to make it… But it did not work very well. Any help/advice?

---

## [Ruby Execution](https://www.ruby-forum.com/t/ruby-execution/169483)

<div class="topic-metadata">

**Author:** [@mschwab](https://www.ruby-forum.com/u/mschwab)\
**Replies:** 5\
**Last updated:** [June 4, 2009, 10:45pm UTC](https://www.ruby-forum.com/t/ruby-execution/169483 "2009-06-04T22:45:40Z")

</div>

If you have a script with a lot of classes, does the interpreter read through and ‘execute’ each class even though they haven’t yet been called? Similarly, if you ‘require’ other libraries, does the interpreter insert…

---

## [Use methods from a library in my own class](https://www.ruby-forum.com/t/use-methods-from-a-library-in-my-own-class/169521)

<div class="topic-metadata">

**Author:** [@leveille](https://www.ruby-forum.com/u/leveille)\
**Replies:** 4\
**Last updated:** [June 4, 2009, 9:57pm UTC](https://www.ruby-forum.com/t/use-methods-from-a-library-in-my-own-class/169521 "2009-06-04T21:57:27Z")

</div>

I want to create a class that uses the RubyGnuplot library that can create a plot using one simple command and only add options if so desired. Below is what I have done so far and I was wondering if someone could prov…

---

## [Block as string](https://www.ruby-forum.com/t/block-as-string/169372)

<div class="topic-metadata">

**Author:** [@Louis-Philippe](https://www.ruby-forum.com/u/Louis-Philippe)\
**Replies:** 11\
**Last updated:** [June 4, 2009, 9:52pm UTC](https://www.ruby-forum.com/t/block-as-string/169372 "2009-06-04T21:52:09Z")

</div>

Hi All, Is there an easy way to get a block / proc / lambda as a string… without any fancy serialization, no binding… just the code block as string? Thanks! L-P

---

## [\[ANN\] JRuby 1.3.0 Released](https://www.ruby-forum.com/t/ann-jruby-1-3-0-released/169457)

<div class="topic-metadata">

**Author:** [@Thomas\_E\_Enebo](https://www.ruby-forum.com/u/Thomas_E_Enebo)\
**Replies:** 7\
**Last updated:** [June 4, 2009, 9:38pm UTC](https://www.ruby-forum.com/t/ann-jruby-1-3-0-released/169457 "2009-06-04T21:38:34Z")

</div>

The JRuby community is pleased to announce the release of JRuby 1.3.0 Homepage: http://www.jruby.org/ Download: http://dist.codehaus.org/jruby/ The fixes in this release are primarily obvious compatibility problems a…

---

## [And in ternary operator](https://www.ruby-forum.com/t/and-in-ternary-operator/169526)

<div class="topic-metadata">

**Author:** [@parvg](https://www.ruby-forum.com/u/parvg)\
**Replies:** 6\
**Last updated:** [June 4, 2009, 9:30pm UTC](https://www.ruby-forum.com/t/and-in-ternary-operator/169526 "2009-06-04T21:30:55Z")

</div>

hi, i would like to do something like the following if true do\_a else d\_a d\_b end Can this be done using ternary operator? This seem to give different result: ifTrue ? do\_a : do\_a and do\_b Thank you.

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

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