# Ruby

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

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

---

## [Watir script, log into gmail](https://www.ruby-forum.com/t/watir-script-log-into-gmail/176163)

<div class="topic-metadata">

**Author:** [@avtuvy](https://www.ruby-forum.com/u/avtuvy)\
**Replies:** 1\
**Last updated:** [September 25, 2009, 4:28pm UTC](https://www.ruby-forum.com/t/watir-script-log-into-gmail/176163 "2009-09-25T16:28:17Z")

</div>

This is my first attempt with ruby/watir, the script below populates the login and password but does not click the signIn button, please help. require “watir” require “test/unit” require “win32ole” class TC\_Login \< …

---

## [Ordering XML Attributes with Hpricot?](https://www.ruby-forum.com/t/ordering-xml-attributes-with-hpricot/176116)

<div class="topic-metadata">

**Author:** [@viatropos](https://www.ruby-forum.com/u/viatropos)\
**Replies:** 7\
**Last updated:** [September 25, 2009, 3:13pm UTC](https://www.ruby-forum.com/t/ordering-xml-attributes-with-hpricot/176116 "2009-09-25T15:13:55Z")

</div>

Hey, Is there a way to organize/print out the xml attributes using Hpricot, or do I have to run through the xml file again and replace patterns? I would like to be able to say “put this attribute first, put this attr…

---

## [Parsing dates](https://www.ruby-forum.com/t/parsing-dates/176140)

<div class="topic-metadata">

**Author:** [@rgreen](https://www.ruby-forum.com/u/rgreen)\
**Replies:** 2\
**Last updated:** [September 25, 2009, 2:30pm UTC](https://www.ruby-forum.com/t/parsing-dates/176140 "2009-09-25T14:30:02Z")

</div>

When I do this: dob=“05/01/1968” x=Date.parse(dob) x.month I get 1 instead of 5. How do I do this?

---

## [Noob Problem (sending CTRL + \] )](https://www.ruby-forum.com/t/noob-problem-sending-ctrl/176151)

<div class="topic-metadata">

**Author:** [@sdesbure](https://www.ruby-forum.com/u/sdesbure)\
**Replies:** 1\
**Last updated:** [September 25, 2009, 2:25pm UTC](https://www.ruby-forum.com/t/noob-problem-sending-ctrl/176151 "2009-09-25T14:25:56Z")

</div>

Hi all, I want to create a script which will execute the following tasks: launch a console on a virtual server via libvirt: virsh console NameOfTheServer Log into the server login \\n password\\n send a command insi…

---

## [How to ask for numerica input](https://www.ruby-forum.com/t/how-to-ask-for-numerica-input/176136)

<div class="topic-metadata">

**Author:** [@fim32](https://www.ruby-forum.com/u/fim32)\
**Replies:** 2\
**Last updated:** [September 25, 2009, 2:10pm UTC](https://www.ruby-forum.com/t/how-to-ask-for-numerica-input/176136 "2009-09-25T14:10:07Z")

</div>

I am trying to make a simple temperature converter, and I want to ask for F temperature (numerical value) what command do I use?

---

## [(heeeelp) sending an email as attachment](https://www.ruby-forum.com/t/heeeelp-sending-an-email-as-attachment/176150)

<div class="topic-metadata">

**Author:** [@rabarama](https://www.ruby-forum.com/u/rabarama)\
**Replies:** 1\
**Last updated:** [September 25, 2009, 10:25am UTC](https://www.ruby-forum.com/t/heeeelp-sending-an-email-as-attachment/176150 "2009-09-25T10:25:54Z")

</div>

Problem: i get an email from a pop3 mailbox, i want to send it as an attachment in another mail. I get via Net::pop a mail i handle it via Tmail::mail if i use this code, the attachment i receive is visible only via …

---

## [Ruby Noob issue](https://www.ruby-forum.com/t/ruby-noob-issue/176134)

<div class="topic-metadata">

**Author:** [@fim32](https://www.ruby-forum.com/u/fim32)\
**Replies:** 5\
**Last updated:** [September 25, 2009, 9:26am UTC](https://www.ruby-forum.com/t/ruby-noob-issue/176134 "2009-09-25T09:26:46Z")

</div>

Hi I’m really new to Ruby as such it took me about an hour to register ^^’… That being said I am trying to figure out why this program I made keeps returning as “0” def f(x) return (5/9) \* (x-32) end x=1001 prin…

---

## [Get functions names with regex](https://www.ruby-forum.com/t/get-functions-names-with-regex/176138)

<div class="topic-metadata">

**Author:** [@ahmet](https://www.ruby-forum.com/u/ahmet)\
**Replies:** 5\
**Last updated:** [September 25, 2009, 8:39am UTC](https://www.ruby-forum.com/t/get-functions-names-with-regex/176138 "2009-09-25T08:39:58Z")

</div>

I have text file like this, str = “function ExecMain.GetApiErrorMessage(ApiErrCode :DWORD) :String; var Buf: array\[0…511\] of Char; MsgCnt :DWORD; begin function THandle.SetPrivilege(PrivilegeName: String; Enable: …

---

## [Rails log lines missing when executing the app in Glassfish GEM](https://www.ruby-forum.com/t/rails-log-lines-missing-when-executing-the-app-in-glassfish-gem/176058)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 2\
**Last updated:** [September 25, 2009, 7:11am UTC](https://www.ruby-forum.com/t/rails-log-lines-missing-when-executing-the-app-in-glassfish-gem/176058 "2009-09-25T07:11:33Z")

</div>

Hello, Perhaps I missed something or I’m completely out of the game. My problem is that my application gives the nice logging lines about called URLs, execution times etc. only when run with JRuby and Webrick. Examp…

---

## [Formatting XML with Nokogiri](https://www.ruby-forum.com/t/formatting-xml-with-nokogiri/176135)

<div class="topic-metadata">

**Author:** [@viatropos](https://www.ruby-forum.com/u/viatropos)\
**Replies:** 0\
**Last updated:** [September 25, 2009, 3:21am UTC](https://www.ruby-forum.com/t/formatting-xml-with-nokogiri/176135 "2009-09-25T03:21:24Z")

</div>

What’s the best/recommended way to format XML with nokogiri? I would like to be able to have all the nodes indented with a “\\t” instead of " " two spaces, and have max two attributes per line. Do I have to use regula…

---

## [Ruby Challenge Shift Subtitle is now live](https://www.ruby-forum.com/t/ruby-challenge-shift-subtitle-is-now-live/176133)

<div class="topic-metadata">

**Author:** [@indianguru](https://www.ruby-forum.com/u/indianguru)\
**Replies:** 0\
**Last updated:** [September 25, 2009, 2:55am UTC](https://www.ruby-forum.com/t/ruby-challenge-shift-subtitle-is-now-live/176133 "2009-09-25T02:55:45Z")

</div>

Announcement: The First Ruby P.ming Challenge for Newbies (Shift Subtitle) is now live. The problem has been set by Fabio Akita. Entry free, registration not required and a chance to win a prize. Hurry, only 10 days …

---

## [When to use $DEBUG and $VERBOSE](https://www.ruby-forum.com/t/when-to-use-debug-and-verbose/175950)

<div class="topic-metadata">

**Author:** [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Replies:** 2\
**Last updated:** [September 25, 2009, 2:20am UTC](https://www.ruby-forum.com/t/when-to-use-debug-and-verbose/175950 "2009-09-25T02:20:02Z")

</div>

Ok, so I have a bin script and like so many other’s use some common options such as --verbose and --debug. Generally I have been keeping these flags in an options hash, specific to my app. But I wondering if perhaps t…

---

## [Redefining hat operator for Proc](https://www.ruby-forum.com/t/redefining-hat-operator-for-proc/176114)

<div class="topic-metadata">

**Author:** [@bparanj](https://www.ruby-forum.com/u/bparanj)\
**Replies:** 4\
**Last updated:** [September 25, 2009, 1:50am UTC](https://www.ruby-forum.com/t/redefining-hat-operator-for-proc/176114 "2009-09-25T01:50:11Z")

</div>

Hello, I am developing a gem where I need to redefine the \<=\> operator for Proc. This operator shows up in the methods list when I print the output of methods call but I don’t see it in the list of private or protec…

---

## [Send browser images](https://www.ruby-forum.com/t/send-browser-images/176125)

<div class="topic-metadata">

**Author:** [@born\_in\_USSR](https://www.ruby-forum.com/u/born_in_USSR)\
**Replies:** 1\
**Last updated:** [September 25, 2009, 1:39am UTC](https://www.ruby-forum.com/t/send-browser-images/176125 "2009-09-25T01:39:59Z")

</div>

How can web-server written on Ruby, send \*.ico, \*.jpg, \*.bmp etc files to browser. I try: … server=TCPServer.new(80) session=server.accept request=session.gets str=nil File.open(page,“rb”) do |sd| if str==ni…

---

## [Help to position image in fxruby Main window](https://www.ruby-forum.com/t/help-to-position-image-in-fxruby-main-window/176124)

<div class="topic-metadata">

**Author:** [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Replies:** 0\
**Last updated:** [September 25, 2009, 1:01am UTC](https://www.ruby-forum.com/t/help-to-position-image-in-fxruby-main-window/176124 "2009-09-25T01:01:34Z")

</div>

Please suggest how chart4.rb can be modified, to position the 4 image in the four corners of the main window. Desired layout shown below. |------------------------| | chart1 | chart2 | |------------------------| …

---

## [Managing gems with Maven?](https://www.ruby-forum.com/t/managing-gems-with-maven/176098)

<div class="topic-metadata">

**Author:** [@Stuart\_Sierra](https://www.ruby-forum.com/u/Stuart_Sierra)\
**Replies:** 5\
**Last updated:** [September 25, 2009, 1:00am UTC](https://www.ruby-forum.com/t/managing-gems-with-maven/176098 "2009-09-25T01:00:59Z")

</div>

Is there a way I can manage gem dependencies with Maven, so that they are automatically downloaded, installed, and packaged in the final jar? Thanks, -SS To unsubscribe from this list, please visit: http://xircles…

---

## [Using xbuild to build ironruby](https://www.ruby-forum.com/t/using-xbuild-to-build-ironruby/176122)

<div class="topic-metadata">

**Author:** [@barby](https://www.ruby-forum.com/u/barby)\
**Replies:** 0\
**Last updated:** [September 24, 2009, 11:56pm UTC](https://www.ruby-forum.com/t/using-xbuild-to-build-ironruby/176122 "2009-09-24T23:56:00Z")

</div>

Hi You can build the plain ironruby repository with mono’s xbuild now. I know Jim was interested in that for the rake file. You need mono trunk though MONO\_IOMAP=case xbuild Ruby.sln /p:TreatWarningsAsErrors=false M…

---

## [Is there a But keyword in Cucumber?](https://www.ruby-forum.com/t/is-there-a-but-keyword-in-cucumber/176105)

<div class="topic-metadata">

**Author:** [@metanoize](https://www.ruby-forum.com/u/metanoize)\
**Replies:** 10\
**Last updated:** [September 24, 2009, 11:32pm UTC](https://www.ruby-forum.com/t/is-there-a-but-keyword-in-cucumber/176105 "2009-09-24T23:32:35Z")

</div>

I am using Cucumber and now I need to use a But keyword (if there is any) Scenario Outline: Find if the number if prime or not Given I have a number When I pass the to the prime service Then the service should disp…

---

## [Code Review: C11](https://www.ruby-forum.com/t/code-review-c11/176108)

<div class="topic-metadata">

**Author:** [@grujildo](https://www.ruby-forum.com/u/grujildo)\
**Replies:** 0\
**Last updated:** [September 24, 2009, 10:11pm UTC](https://www.ruby-forum.com/t/code-review-c11/176108 "2009-09-24T22:11:46Z")

</div>

tfpt review “/shelveset:C11;REDMOND\\tomat” DLR: Adds ToReverseArray to CollectionUtils. Ruby: Implements constant access caching. We use a single per-runtime constant access version (CAV) which increases each time a…

---

## [Re: Compiling Rails app/\*\*/\* to .class files](https://www.ruby-forum.com/t/re-compiling-rails-app-to-class-files/176103)

<div class="topic-metadata">

**Author:** [@superwick](https://www.ruby-forum.com/u/superwick)\
**Replies:** 0\
**Last updated:** [September 24, 2009, 9:20pm UTC](https://www.ruby-forum.com/t/re-compiling-rails-app-to-class-files/176103 "2009-09-24T21:20:49Z")

</div>

Charles Oliver N. wrote: ~/projects/jruby âž” jruby -e “load ‘./foo.class’” here I will file a bug for 1.1.5. I see the light now, and believe load should search for both .class and .rb when requested to load xxx.rb…

---

## [Daemonizing: What is the Community Using](https://www.ruby-forum.com/t/daemonizing-what-is-the-community-using/175852)

<div class="topic-metadata">

**Author:** [@sjames](https://www.ruby-forum.com/u/sjames)\
**Replies:** 12\
**Last updated:** [September 24, 2009, 9:18pm UTC](https://www.ruby-forum.com/t/daemonizing-what-is-the-community-using/175852 "2009-09-24T21:18:28Z")

</div>

Hi friends. Until recently I’ve been using Daemon kit on a Ruby on Rails project I’ve been developing for work. Namely I’m trying to monitor a Delayed Job queue. This has worked fine during development as I’ve not h…

---

## [Force enter in gets](https://www.ruby-forum.com/t/force-enter-in-gets/176093)

<div class="topic-metadata">

**Author:** [@jbaty](https://www.ruby-forum.com/u/jbaty)\
**Replies:** 1\
**Last updated:** [September 24, 2009, 9:10pm UTC](https://www.ruby-forum.com/t/force-enter-in-gets/176093 "2009-09-24T21:10:17Z")

</div>

Hi all, Let’s say I have a ruby script that gets some user input: name = gets How can I make it so after 10 seconds of no input (or even if they start typing, it’ll cut them off after 10 seconds) it will continue? In…

---

## [Accessing character code in Ruby 1.9.1](https://www.ruby-forum.com/t/accessing-character-code-in-ruby-1-9-1/176081)

<div class="topic-metadata">

**Author:** [@ThomasW](https://www.ruby-forum.com/u/ThomasW)\
**Replies:** 2\
**Last updated:** [September 24, 2009, 9:05pm UTC](https://www.ruby-forum.com/t/accessing-character-code-in-ruby-1-9-1/176081 "2009-09-24T21:05:36Z")

</div>

Hi all, I read from to the docs\[1\] that string\[index\] should do the following: “If passed a single Fixnum, returns the code of the character at that position.” This is working as documented with Ruby 1.8.6, but it i…

---

## [How do you limit the line length of the output commands? Where is pqueue library documented?](https://www.ruby-forum.com/t/how-do-you-limit-the-line-length-of-the-output-commands-where-is-pqueue-library-documented/176042)

<div class="topic-metadata">

**Author:** [@masonkessinger](https://www.ruby-forum.com/u/masonkessinger)\
**Replies:** 11\
**Last updated:** [September 24, 2009, 6:59pm UTC](https://www.ruby-forum.com/t/how-do-you-limit-the-line-length-of-the-output-commands-where-is-pqueue-library-documented/176042 "2009-09-24T18:59:44Z")

</div>

There must be an easy way to solve the problem of controlling the length of the output line, forcing the rest into a line break. In the puts code example below, I want to break between every 10 methods or just go to …

---

## [New to Ruby, New to Programming](https://www.ruby-forum.com/t/new-to-ruby-new-to-programming/176057)

<div class="topic-metadata">

**Author:** [@jonk](https://www.ruby-forum.com/u/jonk)\
**Replies:** 8\
**Last updated:** [September 24, 2009, 6:01pm UTC](https://www.ruby-forum.com/t/new-to-ruby-new-to-programming/176057 "2009-09-24T18:01:11Z")

</div>

I just started programming about a month ago. I’ve started learning Ruby, C++, and Java just to get a feel for languages. I’m really liking ruby but I’m getting bored of doing super basic programs.(No more Hello World…

---

## [Email regex](https://www.ruby-forum.com/t/email-regex/176073)

<div class="topic-metadata">

**Author:** [@sijo](https://www.ruby-forum.com/u/sijo)\
**Replies:** 7\
**Last updated:** [September 24, 2009, 5:36pm UTC](https://www.ruby-forum.com/t/email-regex/176073 "2009-09-24T17:36:00Z")

</div>

Hi I have a regular expression /^(\[^.@\\s,\]+)@((?:\[-a-z0-9\]+.)+\[a-z\]{2,})$/i This exactly fits my need except for one. But I have to pass this also removed\_email\_address@domain.invalid But Cannot. Please help…

---

## [Re: Fail to read YAML file?](https://www.ruby-forum.com/t/re-fail-to-read-yaml-file/176084)

<div class="topic-metadata">

**Author:** [@bluetrust](https://www.ruby-forum.com/u/bluetrust)\
**Replies:** 1\
**Last updated:** [September 24, 2009, 4:39pm UTC](https://www.ruby-forum.com/t/re-fail-to-read-yaml-file/176084 "2009-09-24T16:39:48Z")

</div>

OK, I fixed it. Please ignore. On Do 24/09/09 14:28 , Michael J. removed\_email\_address@domain.invalid wrote: from yaml:134:in \`load’ ---- Msg sent via @Mail - http://atmail.com/ To unsubscribe from this list, pleas…

---

## [Re: Fail to read YAML file?](https://www.ruby-forum.com/t/re-fail-to-read-yaml-file/197100)

<div class="topic-metadata">

**Author:** [@bluetrust](https://www.ruby-forum.com/u/bluetrust)\
**Replies:** 0\
**Last updated:** [September 24, 2009, 3:43pm UTC](https://www.ruby-forum.com/t/re-fail-to-read-yaml-file/197100 "2009-09-24T15:43:00Z")

</div>

OK, I fixed it. Please ignore. On Do 24/09/09 14:28 , Michael J. removed\_email\_address@domain.invalid wrote: from yaml:134:in \`load’ ---- Msg sent via @Mail - http://atmail.com/ To unsubscribe from this list, pleas…

---

## [Nice mention of Ruby by Coverity](https://www.ruby-forum.com/t/nice-mention-of-ruby-by-coverity/176032)

<div class="topic-metadata">

**Author:** [@John\_W\_Higgins](https://www.ruby-forum.com/u/John_W_Higgins)\
**Replies:** 2\
**Last updated:** [September 24, 2009, 3:19pm UTC](https://www.ruby-forum.com/t/nice-mention-of-ruby-by-coverity/176032 "2009-09-24T15:19:34Z")

</div>

Congrats to everyone that has been squashing bugs and fixing defects lately! Apparently your efforts are getting noticed. Coverity has ranked Ruby one of the top 4 open source projects in terms of clearing up any cod…

---

## [Fail to read YAML file?](https://www.ruby-forum.com/t/fail-to-read-yaml-file/176080)

<div class="topic-metadata">

**Author:** [@bluetrust](https://www.ruby-forum.com/u/bluetrust)\
**Replies:** 0\
**Last updated:** [September 24, 2009, 2:29pm UTC](https://www.ruby-forum.com/t/fail-to-read-yaml-file/176080 "2009-09-24T14:29:48Z")

</div>

Hi everybody, I have a standard yaml file, that I try to read in with JRuby 1.4.0dev. This fails with the following under windows: irb(main):001:0\> require ‘yaml’ =\> true irb(main):002:0\> config = YAML.load\_file ‘ma…

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

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