# Ruby

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

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

---

## [Got a range from an array, but looking for other ways of doing it](https://www.ruby-forum.com/t/got-a-range-from-an-array-but-looking-for-other-ways-of-doing-it/115951)

<div class="topic-metadata">

**Author:** [@simonsaid](https://www.ruby-forum.com/u/simonsaid)\
**Replies:** 6\
**Last updated:** [October 1, 2007, 3:25pm UTC](https://www.ruby-forum.com/t/got-a-range-from-an-array-but-looking-for-other-ways-of-doing-it/115951 "2007-10-01T15:25:29Z")

</div>

a is an array. I’m trying to chop the first and last third off. or, choose only the middle third. can be a rough third. a.length # 4808 range = a.length \* 0.3 #…

---

## [Regexpression: scanning a special charachters //?](https://www.ruby-forum.com/t/regexpression-scanning-a-special-charachters/115992)

<div class="topic-metadata">

**Author:** [@kazaam](https://www.ruby-forum.com/u/kazaam)\
**Replies:** 4\
**Last updated:** [October 1, 2007, 3:20pm UTC](https://www.ruby-forum.com/t/regexpression-scanning-a-special-charachters/115992 "2007-10-01T15:20:12Z")

</div>

Hi again, I need to parse a line like this here: myoverlook://thatstrue@blablabla I need at the end just thatstrue. So I wrote for the beginning: result = overlook.scan(/myoverlook://(.+?)\\n/m) Of course this d…

---

## [Connecting to sql server with dbi?](https://www.ruby-forum.com/t/connecting-to-sql-server-with-dbi/115998)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [October 1, 2007, 2:45pm UTC](https://www.ruby-forum.com/t/connecting-to-sql-server-with-dbi/115998 "2007-10-01T14:45:37Z")

</div>

I’m trying to figure out how to connect to sql server (2005 i think) this program here, at first used to show the defaukt stuff, ODBC I think. DBI.available\_drivers.each do |drv| puts drv DBI.data\_sources(drv).each …

---

## [Class Data is already defined](https://www.ruby-forum.com/t/class-data-is-already-defined/115991)

<div class="topic-metadata">

**Author:** [@rjst](https://www.ruby-forum.com/u/rjst)\
**Replies:** 1\
**Last updated:** [October 1, 2007, 2:25pm UTC](https://www.ruby-forum.com/t/class-data-is-already-defined/115991 "2007-10-01T14:25:06Z")

</div>

Hi, We had a module named Data in our application. After I updated to trunk today, I noticed that a class named Data is already defined. So this code : module Data end causes : :1: Data is not a module (TypeError)…

---

## [Unit testing: example p. 156 pickaxe2](https://www.ruby-forum.com/t/unit-testing-example-p-156-pickaxe2/115869)

<div class="topic-metadata">

**Author:** [@7stud](https://www.ruby-forum.com/u/7stud)\
**Replies:** 2\
**Last updated:** [October 1, 2007, 11:40am UTC](https://www.ruby-forum.com/t/unit-testing-example-p-156-pickaxe2/115869 "2007-10-01T11:40:21Z")

</div>

How do you make this example fail: require “test/unit” class TestsWhichFail \< Test::Unit::TestCase def test\_reading assert\_not\_nil(ARGF.read, “Read next line of input”) end end I tried specifying an empty file on …

---

## [iCal (ics) parser in Ruby](https://www.ruby-forum.com/t/ical-ics-parser-in-ruby/115868)

<div class="topic-metadata">

**Author:** [@Une\_BSSSSvS\_ue](https://www.ruby-forum.com/u/Une_BSSSSvS_ue)\
**Replies:** 8\
**Last updated:** [October 1, 2007, 10:50am UTC](https://www.ruby-forum.com/t/ical-ics-parser-in-ruby/115868 "2007-10-01T10:50:39Z")

</div>

does exists an iCalendar (ics extension) exists un ruby ? i do have to translate dose files into csv… any advice appreciated.

---

## [Gtk not work](https://www.ruby-forum.com/t/gtk-not-work/115982)

<div class="topic-metadata">

**Author:** [@mokkai](https://www.ruby-forum.com/u/mokkai)\
**Replies:** 3\
**Last updated:** [October 1, 2007, 10:31am UTC](https://www.ruby-forum.com/t/gtk-not-work/115982 "2007-10-01T10:31:59Z")

</div>

my os --\> ubuntu 7.04 my ruby–\> ruby 1.8.5 (2006-08-25) \[i486-linux\] recently i download “ruby-gtk2-0.16.0” and install it in terminal… mani@user-UBUNTU704:~$ vim welcome.rb require “gtk2” include Gtk def quick\_me…

---

## [Bindings/wrapper: how to?](https://www.ruby-forum.com/t/bindings-wrapper-how-to/115973)

<div class="topic-metadata">

**Author:** [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Replies:** 4\
**Last updated:** [October 1, 2007, 6:35am UTC](https://www.ruby-forum.com/t/bindings-wrapper-how-to/115973 "2007-10-01T06:35:26Z")

</div>

Any tips or resources for creating a wrapper or bindings in Ruby to an existing C library? How does one go about this correctly?

---

## [How to handle cookie with ruby](https://www.ruby-forum.com/t/how-to-handle-cookie-with-ruby/115918)

<div class="topic-metadata">

**Author:** [@leondu](https://www.ruby-forum.com/u/leondu)\
**Replies:** 2\
**Last updated:** [October 1, 2007, 5:51am UTC](https://www.ruby-forum.com/t/how-to-handle-cookie-with-ruby/115918 "2007-10-01T05:51:38Z")

</div>

Hi all, I dont know how to handle cookie with ruby. the problem is I want to fetch content from a website which need login first. I use the http.post to do the login and seemed works well, but when I went to the ind…

---

## [Passing a .NET object to the RubyEngine](https://www.ruby-forum.com/t/passing-a-net-object-to-the-rubyengine/115760)

<div class="topic-metadata">

**Author:** [@technomancy](https://www.ruby-forum.com/u/technomancy)\
**Replies:** 14\
**Last updated:** [October 1, 2007, 4:23am UTC](https://www.ruby-forum.com/t/passing-a-net-object-to-the-rubyengine/115760 "2007-10-01T04:23:55Z")

</div>

Hi All, I posted some code for calling IronRuby code I found in the mailing list onto the wiki. http://ironruby.rubyforge.org/wiki/wiki.pl?ExecutingIronRubyFromCSharp RubyEngine re = RubyEngine.CurrentEngine; string…

---

## [Mms2r 1.1.10 Released](https://www.ruby-forum.com/t/mms2r-1-1-10-released/115968)

<div class="topic-metadata">

**Author:** [@mike-moscow](https://www.ruby-forum.com/u/mike-moscow)\
**Replies:** 0\
**Last updated:** [October 1, 2007, 3:44am UTC](https://www.ruby-forum.com/t/mms2r-1-1-10-released/115968 "2007-10-01T03:44:05Z")

</div>

mms2r version 1.1.10 has been released! http://mms2r.rubyforge.org/ DESCRIPTION: MMS2R is a library that decodes the parts of an MMS message to disk while stripping out advertising injected by the cellphone carrier…

---

## [Ruby on OpenMoko / Neo1973](https://www.ruby-forum.com/t/ruby-on-openmoko-neo1973/115937)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 2\
**Last updated:** [October 1, 2007, 2:39am UTC](https://www.ruby-forum.com/t/ruby-on-openmoko-neo1973/115937 "2007-10-01T02:39:37Z")

</div>

FYI, I ported Ruby, as well as the gtk2 and glade2 bindings to my Neo1973 phone running the OpenMoko platform which is in turn based on the OpenEmbedded platform. So this is ruby running on arm-linux-gnueabi. Info a…

---

## [Math problem](https://www.ruby-forum.com/t/math-problem/115895)

<div class="topic-metadata">

**Author:** [@Dimitri\_Krassovski](https://www.ruby-forum.com/u/Dimitri_Krassovski)\
**Replies:** 6\
**Last updated:** [October 1, 2007, 1:24am UTC](https://www.ruby-forum.com/t/math-problem/115895 "2007-10-01T01:24:11Z")

</div>

I’m totally new to jRuby, but i found a really weird thing while testing some of my apps. In jirb: irb(main):001:0\> (2…10).map { |x| \[ 10.1\*x, x\]} =\> \[\[20.2, 2\], \[30.299999999999997, 3\], \[40.4, 4\], \[50.5, 5\], \[60.59…

---

## [Detecting number ranges](https://www.ruby-forum.com/t/detecting-number-ranges/115555)

<div class="topic-metadata">

**Author:** [@jay-levitt](https://www.ruby-forum.com/u/jay-levitt)\
**Replies:** 16\
**Last updated:** [October 1, 2007, 12:50am UTC](https://www.ruby-forum.com/t/detecting-number-ranges/115555 "2007-10-01T00:50:51Z")

</div>

I had to write a script this evening to take an unsorted input file of the form: database 1 is on server 3 database 8 is on server 7 … and output it in the form: server 3 handles database 1 through 7 server 7 han…

---

## [Json install problem](https://www.ruby-forum.com/t/json-install-problem/115691)

<div class="topic-metadata">

**Author:** [@gsofhon](https://www.ruby-forum.com/u/gsofhon)\
**Replies:** 1\
**Last updated:** [September 30, 2007, 11:19pm UTC](https://www.ruby-forum.com/t/json-install-problem/115691 "2007-09-30T23:19:59Z")

</div>

i need to install json in jruby under fedora 7. but json need mkmf.rb, which is not avaliable in jruby. i learnt that from the jruby mail list achieve. i guess the installation under windows may works if i choose the …

---

## [Subclassing Thread?](https://www.ruby-forum.com/t/subclassing-thread/115913)

<div class="topic-metadata">

**Author:** [@sgware](https://www.ruby-forum.com/u/sgware)\
**Replies:** 7\
**Last updated:** [September 30, 2007, 7:14pm UTC](https://www.ruby-forum.com/t/subclassing-thread/115913 "2007-09-30T19:14:18Z")

</div>

Is it possible to launch a Ruby thread without passing a block to Thread.new? Those familiar with threading in Java will know that you can write a class that is a subclass of Thread, and then put the thread’s code int…

---

## [Regular Expression newbie question about upper & lower case](https://www.ruby-forum.com/t/regular-expression-newbie-question-about-upper-lower-case/115941)

<div class="topic-metadata">

**Author:** [@wpvanpaassen](https://www.ruby-forum.com/u/wpvanpaassen)\
**Replies:** 5\
**Last updated:** [September 30, 2007, 7:01pm UTC](https://www.ruby-forum.com/t/regular-expression-newbie-question-about-upper-lower-case/115941 "2007-09-30T19:01:10Z")

</div>

I want to check for both upper & lower case answers when a user keys in a response to a question, but I haven’t been able to find an example of the syntax. What I’m looking for is something like this: If $ans = \[Yy\]\*…

---

## [Newbie needs help getting user input](https://www.ruby-forum.com/t/newbie-needs-help-getting-user-input/115902)

<div class="topic-metadata">

**Author:** [@wpvanpaassen](https://www.ruby-forum.com/u/wpvanpaassen)\
**Replies:** 13\
**Last updated:** [September 30, 2007, 6:27pm UTC](https://www.ruby-forum.com/t/newbie-needs-help-getting-user-input/115902 "2007-09-30T18:27:16Z")

</div>

I’m trying to learn Ruby and trying to convert a Perl program at the same time. I need to prompt a user to enter a number to select a processing option. In Perl, I did it this way: print STDERR "Enter option: "; c…

---

## [m17n$B$NA4KF$K4X$9$k2?$+(B](https://www.ruby-forum.com/t/m17n-b-na4kf-k4x-9-k2-b/115916)

<div class="topic-metadata">

**Author:** [@Masayoshi\_T](https://www.ruby-forum.com/u/Masayoshi_T)\
**Replies:** 1\
**Last updated:** [September 30, 2007, 6:14pm UTC](https://www.ruby-forum.com/t/m17n-b-na4kf-k4x-9-k2-b/115916 "2007-09-30T18:14:15Z")

</div>

e$B9b66@,5A$G$9!#e(B m17nQuestions http://pub.cozmixng.org/~the-rwiki/rw-cgi.rb?cmd=view;name=m17nQuestions e$B$NKAF,$K!"e(B m17n e$B$NA4KF$,J,$+$i$J$$$1$l$I!"$^$:$I$3$r8+$l$P$$$$$N$+$Je(B? \* matz: 2007e$BG/e(B9e$B7…

---

## [Using JRuby with AR Migrations standalone](https://www.ruby-forum.com/t/using-jruby-with-ar-migrations-standalone/115915)

<div class="topic-metadata">

**Author:** [@Abdullah\_J](https://www.ruby-forum.com/u/Abdullah_J)\
**Replies:** 2\
**Last updated:** [September 30, 2007, 5:52pm UTC](https://www.ruby-forum.com/t/using-jruby-with-ar-migrations-standalone/115915 "2007-09-30T17:52:36Z")

</div>

Hi All, I have a couple questions regarding JRuby and ActiveRecord migrations, I’d like to introduce Ruby to a Java-based project for managing database migrations initially, so here they are: 1- Is it possible to pac…

---

## [XML in Ruby syntax](https://www.ruby-forum.com/t/xml-in-ruby-syntax/115930)

<div class="topic-metadata">

**Author:** [@Trans](https://www.ruby-forum.com/u/Trans)\
**Replies:** 2\
**Last updated:** [September 30, 2007, 5:11pm UTC](https://www.ruby-forum.com/t/xml-in-ruby-syntax/115930 "2007-09-30T17:11:34Z")

</div>

Recently I saw an announcement for an XML/HTML builder lib that embedded the XML directly in Ruby code. What was it? I can’t seem to find it now. Thanks, T.

---

## [How to use RSS2 parser to parse tags with colon?](https://www.ruby-forum.com/t/how-to-use-rss2-parser-to-parse-tags-with-colon/115933)

<div class="topic-metadata">

**Author:** [@Mister\_Yu](https://www.ruby-forum.com/u/Mister_Yu)\
**Replies:** 0\
**Last updated:** [September 30, 2007, 4:01pm UTC](https://www.ruby-forum.com/t/how-to-use-rss2-parser-to-parse-tags-with-colon/115933 "2007-09-30T16:01:17Z")

</div>

Hello all, I am trying to user the RSS2 parser to parse the weather feed from weatherBug. i know how to parse the tags without colon, it just as easy as: “result.channel.title” but how to i parse something with a co…

---

## [Newbi needs help installing Rubygems in XP](https://www.ruby-forum.com/t/newbi-needs-help-installing-rubygems-in-xp/115903)

<div class="topic-metadata">

**Author:** [@wpvanpaassen](https://www.ruby-forum.com/u/wpvanpaassen)\
**Replies:** 2\
**Last updated:** [September 30, 2007, 3:43pm UTC](https://www.ruby-forum.com/t/newbi-needs-help-installing-rubygems-in-xp/115903 "2007-09-30T15:43:09Z")

</div>

I need to install Rubygems on my Windows XP Pro machine. Can anyone point me to some directions on how to do it? Thanks, PETERV

---

## [Ironruby.net and www.ironruby.net](https://www.ruby-forum.com/t/ironruby-net-and-www-ironruby-net/115929)

<div class="topic-metadata">

**Author:** [@Aaron\_Junod](https://www.ruby-forum.com/u/Aaron_Junod)\
**Replies:** 0\
**Last updated:** [September 30, 2007, 2:53pm UTC](https://www.ruby-forum.com/t/ironruby-net-and-www-ironruby-net/115929 "2007-09-30T14:53:21Z")

</div>

http://ironruby.net goes to a godaddy hosting page for me instead of the page at http://www.ironruby.net. Just noticed it as I was preparing a post. Thanks Aaron

---

## [How to see Ruby error when called from PHP](https://www.ruby-forum.com/t/how-to-see-ruby-error-when-called-from-php/115926)

<div class="topic-metadata">

**Author:** [@mark](https://www.ruby-forum.com/u/mark)\
**Replies:** 0\
**Last updated:** [September 30, 2007, 1:16pm UTC](https://www.ruby-forum.com/t/how-to-see-ruby-error-when-called-from-php/115926 "2007-09-30T13:16:40Z")

</div>

I’m not seeing an error message when I call my Ruby script from PHP with $s = sprintf(“ruby /Users/mark/scripts/myscript.rb \> /Users/mark/scripts/myscript.log &”); system($s); I see print statements from my script in…

---

## [Iconv hangs while converting chinese UTF-8 to ascii, please help](https://www.ruby-forum.com/t/iconv-hangs-while-converting-chinese-utf-8-to-ascii-please-help/115871)

<div class="topic-metadata">

**Author:** [@Mister\_Yu](https://www.ruby-forum.com/u/Mister_Yu)\
**Replies:** 2\
**Last updated:** [September 30, 2007, 12:36pm UTC](https://www.ruby-forum.com/t/iconv-hangs-while-converting-chinese-utf-8-to-ascii-please-help/115871 "2007-09-30T12:36:12Z")

</div>

hello all, i am a rails developer. i ran into this problem when i m using permalink\_fu to generating permalink field. it runs perfectly when the field is purely english characters, but when it tries to convert a field…

---

## [OLE Object - combo box problem](https://www.ruby-forum.com/t/ole-object-combo-box-problem/115856)

<div class="topic-metadata">

**Author:** [@mihai](https://www.ruby-forum.com/u/mihai)\
**Replies:** 10\
**Last updated:** [September 30, 2007, 12:21pm UTC](https://www.ruby-forum.com/t/ole-object-combo-box-problem/115856 "2007-09-30T12:21:35Z")

</div>

\-i want to add to an excel worksheet a meniu accessing from a combo box but i have problems insering data in the combo box -in the vba i have combo.additem “opt1” -in ruby i cant use additem item (unknown property or …

---

## [SEGV: Fiber.new{ callcc{|c| @c = c } }.resume](https://www.ruby-forum.com/t/segv-fiber-new-callcc-c-c-c-resume/115911)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 0\
**Last updated:** [September 30, 2007, 8:49am UTC](https://www.ruby-forum.com/t/segv-fiber-new-callcc-c-c-c-resume/115911 "2007-09-30T08:49:17Z")

</div>

e$B0J2\<$N$h$&$K$9$k$He(B SEGV e$B$7$^$9!#e(B % ./ruby -rcontinuation -e ‘Fiber.new{ callcc{|c| @c = c } }.resume’ zsh: segmentation fault ./ruby -rcontinuation -e ‘Fiber.new{ callcc{|c| @c = c } }.resume’ % ./ruby -…

---

## [Exit status of ruby -v](https://www.ruby-forum.com/t/exit-status-of-ruby-v/115907)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 0\
**Last updated:** [September 30, 2007, 6:07am UTC](https://www.ruby-forum.com/t/exit-status-of-ruby-v/115907 "2007-09-30T06:07:24Z")

</div>

ruby -v e$B$H$7$?$H$-$Ne(B exit status e$B$,e(B 1 e$B$K$J$C$F$^$9!#e(B % ./ruby -v ruby 1.9.0 (2007-09-30 patchlevel 0) \[i686-linux\] zsh: exit 1 ./ruby -v % echo $? 1

---

## [Hosting APIs walkthrough document](https://www.ruby-forum.com/t/hosting-apis-walkthrough-document/115906)

<div class="topic-metadata">

**Author:** [@Shri\_B](https://www.ruby-forum.com/u/Shri_B)\
**Replies:** 0\
**Last updated:** [September 30, 2007, 5:25am UTC](https://www.ruby-forum.com/t/hosting-apis-walkthrough-document/115906 "2007-09-30T05:25:20Z")

</div>

http://compilerlab.members.winisp.net/hosting-tour.doc has a good walk through of the hosting APIs in IPy 2.0. It may be a little out of sync with the current sources, but its still a very good source of information. …

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

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