# Ruby

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

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

---

## [Need Help Creating Gems](https://www.ruby-forum.com/t/need-help-creating-gems/123803)

<div class="topic-metadata">

**Author:** [@roxah](https://www.ruby-forum.com/u/roxah)\
**Replies:** 2\
**Last updated:** [December 20, 2007, 8:57pm UTC](https://www.ruby-forum.com/t/need-help-creating-gems/123803 "2007-12-20T20:57:46Z")

</div>

Hello all, I’ve successfully created a RubyGem, but I do have one problem. I have a bin/ directory in my Gem, and I assumed any file in that directory would automatically get added to the bin/ directory of the locat…

---

## [Best compiled language for extending Ruby](https://www.ruby-forum.com/t/best-compiled-language-for-extending-ruby/123488)

<div class="topic-metadata">

**Author:** [@sharkie](https://www.ruby-forum.com/u/sharkie)\
**Replies:** 25\
**Last updated:** [December 20, 2007, 8:48pm UTC](https://www.ruby-forum.com/t/best-compiled-language-for-extending-ruby/123488 "2007-12-20T20:48:59Z")

</div>

I want to write my core logics in a compiled language for 1) performance and 2) protecting my source code – in case I will be selling my product to a customer. What would be the most natural-supported-easy-fast langua…

---

## [PGCon 2008 - call for papers](https://www.ruby-forum.com/t/pgcon-2008-call-for-papers/123805)

<div class="topic-metadata">

**Author:** [@Dan\_Langille](https://www.ruby-forum.com/u/Dan_Langille)\
**Replies:** 0\
**Last updated:** [December 20, 2007, 8:17pm UTC](https://www.ruby-forum.com/t/pgcon-2008-call-for-papers/123805 "2007-12-20T20:17:16Z")

</div>

Hello folks, PGCon 2008 will be held 22-23 May 2008, in Ottawa at the University of Ottawa. It will be preceded by two days of tutorials on 20-21 May 2008. We are now requesting proposals for presentations. If you a…

---

## [Converting some autogenerated ruby code to C](https://www.ruby-forum.com/t/converting-some-autogenerated-ruby-code-to-c/100241)

<div class="topic-metadata">

**Author:** [@snowbird122](https://www.ruby-forum.com/u/snowbird122)\
**Replies:** 15\
**Last updated:** [December 20, 2007, 6:22pm UTC](https://www.ruby-forum.com/t/converting-some-autogenerated-ruby-code-to-c/100241 "2007-12-20T18:22:54Z")

</div>

One of the next things I want to do in my grammar package is to give it a performance boost by generating C code instead of ruby code. Right now the parsers I generate are a set of a few methods with giant expressions…

---

## [Slicing in ruby](https://www.ruby-forum.com/t/slicing-in-ruby/123721)

<div class="topic-metadata">

**Author:** [@cluettr](https://www.ruby-forum.com/u/cluettr)\
**Replies:** 8\
**Last updated:** [December 20, 2007, 5:56pm UTC](https://www.ruby-forum.com/t/slicing-in-ruby/123721 "2007-12-20T17:56:40Z")

</div>

Is there a way to slice an array like in perl? For example, what’s the ruby equivalent to doing this: $ echo $(seq 1 10) | tee /dev/stderr | perl -lane 'print join(" – ", @F\[1,2,3,8,2,2\]) ’ 1 2 3 4 5 6 7 8 9 10 2 –…

---

## [Inheritance question](https://www.ruby-forum.com/t/inheritance-question/123727)

<div class="topic-metadata">

**Author:** [@Terence\_L](https://www.ruby-forum.com/u/Terence_L)\
**Replies:** 4\
**Last updated:** [December 20, 2007, 5:30pm UTC](https://www.ruby-forum.com/t/inheritance-question/123727 "2007-12-20T17:30:51Z")

</div>

Hello list, Two things: I’ve got a question regarding inheritance and abstract base classes that I’m hoping somebody can give me some help with. I’m trying to make some socket-based stuff work based on the descri…

---

## [Why my re works like this?](https://www.ruby-forum.com/t/why-my-re-works-like-this/123783)

<div class="topic-metadata">

**Author:** [@Magicloud\_Wang](https://www.ruby-forum.com/u/Magicloud_Wang)\
**Replies:** 0\
**Last updated:** [December 20, 2007, 4:30pm UTC](https://www.ruby-forum.com/t/why-my-re-works-like-this/123783 "2007-12-20T16:30:27Z")

</div>

Dear, I have text like below, and re is as below. The result is as below. Why the first result do not have the line with number ‘1’? It should like: \["/dev/hda", “gpt”, " 1 17.4kB 64.0MB 64.0MB ext3 boot \\n…

---

## [DSN-less connection](https://www.ruby-forum.com/t/dsn-less-connection/123525)

<div class="topic-metadata">

**Author:** [@tcblues](https://www.ruby-forum.com/u/tcblues)\
**Replies:** 1\
**Last updated:** [December 20, 2007, 3:43pm UTC](https://www.ruby-forum.com/t/dsn-less-connection/123525 "2007-12-20T15:43:36Z")

</div>

Hi, I want to connect to a SQL Server or Orcale without a DSN configuration, is it possible in Ruby??

---

## [SWIG function problem](https://www.ruby-forum.com/t/swig-function-problem/123318)

<div class="topic-metadata">

**Author:** [@fla](https://www.ruby-forum.com/u/fla)\
**Replies:** 2\
**Last updated:** [December 20, 2007, 3:36pm UTC](https://www.ruby-forum.com/t/swig-function-problem/123318 "2007-12-20T15:36:51Z")

</div>

Hello, I have following Ruby code: class Random def initialize(init, im=139968, ia=3877, ic=29573) @last = init @im = im @ia = ia @ic = ic end def next(max) (max \* (@last = (@last \* @ia + @ic) % @im)) / @im en…

---

## [Monkey patching a private method?](https://www.ruby-forum.com/t/monkey-patching-a-private-method/123698)

<div class="topic-metadata">

**Author:** [@weyus](https://www.ruby-forum.com/u/weyus)\
**Replies:** 5\
**Last updated:** [December 20, 2007, 2:21pm UTC](https://www.ruby-forum.com/t/monkey-patching-a-private-method/123698 "2007-12-20T14:21:27Z")

</div>

I have found an issue with a method in a library that I’m using. I would like to modify this method via a monkey patch, but it is a private method, and I’m not seeming to get my patch to work. Can the following be do…

---

## [Libxml SaxParser Problem](https://www.ruby-forum.com/t/libxml-saxparser-problem/123644)

<div class="topic-metadata">

**Author:** [@funkdoobiest](https://www.ruby-forum.com/u/funkdoobiest)\
**Replies:** 2\
**Last updated:** [December 20, 2007, 1:30pm UTC](https://www.ruby-forum.com/t/libxml-saxparser-problem/123644 "2007-12-20T13:30:32Z")

</div>

Hi, i’ve installed libxml-ruby (0.5.2.0) and want to test the SaxParser. So I found following example: #!/usr/bin/env ruby require ‘rubygems’ require ‘xml/libxml’ start = Time.now ARGV.each {|filename| counts = H…

---

## [Packet 0.1.2 Released](https://www.ruby-forum.com/t/packet-0-1-2-released/123767)

<div class="topic-metadata">

**Author:** [@gnufied](https://www.ruby-forum.com/u/gnufied)\
**Replies:** 0\
**Last updated:** [December 20, 2007, 1:22pm UTC](https://www.ruby-forum.com/t/packet-0-1-2-released/123767 "2007-12-20T13:22:55Z")

</div>

Hi Folks, I am pleased to announce a new release of “Packet”, A pure ruby library for Event Driven Network Programming. Packet is a pure ruby library for writing network applications in Ruby. It follows Evented Model…

---

## [Checking results](https://www.ruby-forum.com/t/checking-results/123759)

<div class="topic-metadata">

**Author:** [@ruby\_tl](https://www.ruby-forum.com/u/ruby_tl)\
**Replies:** 0\
**Last updated:** [December 20, 2007, 11:58am UTC](https://www.ruby-forum.com/t/checking-results/123759 "2007-12-20T11:58:17Z")

</div>

Hi I am having difficulty in passing the folowing class method, that takes three argument. Basically I need the method to display the right data after doing all the check ups. This is the method. def self.search\_by\_…

---

## [String#\[\] behaviour](https://www.ruby-forum.com/t/string-behaviour/123534)

<div class="topic-metadata">

**Author:** [@DNNX](https://www.ruby-forum.com/u/DNNX)\
**Replies:** 13\
**Last updated:** [December 20, 2007, 11:30am UTC](https://www.ruby-forum.com/t/string-behaviour/123534 "2007-12-20T11:30:52Z")

</div>

‘asd’\[0…10\] returns ‘asd’ while ‘asd’\[-10…-1\] returns nil. As far as I understand, such behaviour completely satisfies ruby documentation (class String - RDoc Documentation), but it seems inconsistent to me. Any thou…

---

## [Trunk failing to build on Win32](https://www.ruby-forum.com/t/trunk-failing-to-build-on-win32/123738)

<div class="topic-metadata">

**Author:** [@Robert\_Hucik](https://www.ruby-forum.com/u/Robert_Hucik)\
**Replies:** 1\
**Last updated:** [December 20, 2007, 11:20am UTC](https://www.ruby-forum.com/t/trunk-failing-to-build-on-win32/123738 "2007-12-20T11:20:17Z")

</div>

Hello, I can successfully build Trunk on Linux and OSX but am having a very tough time building on Win32. I have tried with VS6, VS8 and I am stuck at the exact same error on both versions. I have installed Cygwin …

---

## [ANN: Sequel 0.4.4.2 Released](https://www.ruby-forum.com/t/ann-sequel-0-4-4-2-released/123741)

<div class="topic-metadata">

**Author:** [@ciconia](https://www.ruby-forum.com/u/ciconia)\
**Replies:** 0\
**Last updated:** [December 20, 2007, 8:13am UTC](https://www.ruby-forum.com/t/ann-sequel-0-4-4-2-released/123741 "2007-12-20T08:13:15Z")

</div>

Sequel version 0.4.4.2 has just been released. Sequel is a lightweight database access and ORM library for Ruby. Sequel provides thread safety, connection pooling and a simple and expressive API for constructing datab…

---

## [Is this the right ng](https://www.ruby-forum.com/t/is-this-the-right-ng/123626)

<div class="topic-metadata">

**Author:** [@rabarama](https://www.ruby-forum.com/u/rabarama)\
**Replies:** 2\
**Last updated:** [December 20, 2007, 7:38am UTC](https://www.ruby-forum.com/t/is-this-the-right-ng/123626 "2007-12-20T07:38:44Z")

</div>

I’m now starting to use ruby on rails to develop web applications. Is this the right ng for rails? thanks

---

## [URI.parse not like pipes (|) in url?](https://www.ruby-forum.com/t/uri-parse-not-like-pipes-in-url/123736)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [December 20, 2007, 6:51am UTC](https://www.ruby-forum.com/t/uri-parse-not-like-pipes-in-url/123736 "2007-12-20T06:51:58Z")

</div>

URI.parse(“http://chart.apis.google.com/chart? cht=lc&chs=200x30&chd=t:-1,53.9,53.9,40.0,38.6,34.3,32.5,31.0,30.1,26.7,24.8,23.1,21.7,11.5,10.9,10.1,5.7,3.7,2.1,0.0,9.5,100.0,98.3,95.8,91.8,85.0,83.8,81.8,66.5,59.7,56.7…

---

## [System ( ) call but suppressing =\>true](https://www.ruby-forum.com/t/system-call-but-suppressing-true/123601)

<div class="topic-metadata">

**Author:** [@jackster](https://www.ruby-forum.com/u/jackster)\
**Replies:** 5\
**Last updated:** [December 20, 2007, 4:43am UTC](https://www.ruby-forum.com/t/system-call-but-suppressing-true/123601 "2007-12-20T04:43:26Z")

</div>

I have a Perl script that takes a command line argument that I’m trying call from a Ruby (in Rails). The Perl script needs an IP address on the command line and runs as follows: /usr/bin/router.pl 172.21.1.1 The fol…

---

## [Not reusing current app instance](https://www.ruby-forum.com/t/not-reusing-current-app-instance/123734)

<div class="topic-metadata">

**Author:** [@Junkone](https://www.ruby-forum.com/u/Junkone)\
**Replies:** 0\
**Last updated:** [December 20, 2007, 4:00am UTC](https://www.ruby-forum.com/t/not-reusing-current-app-instance/123734 "2007-12-20T04:00:44Z")

</div>

Hello when i have the amibroker application runnign and then start a ruby script like following amibroker = WIN32OLE.new (“Broker.Application”) , it reuses the instance that is already open. how do i force it to ope…

---

## [Comments in REXML](https://www.ruby-forum.com/t/comments-in-rexml/123715)

<div class="topic-metadata">

**Author:** [@Jari\_W](https://www.ruby-forum.com/u/Jari_W)\
**Replies:** 1\
**Last updated:** [December 20, 2007, 3:10am UTC](https://www.ruby-forum.com/t/comments-in-rexml/123715 "2007-12-20T03:10:26Z")

</div>

How do I add a XML comment between 2 element nodes in REXML? I’ve read the documentation over and over, but I just can’t find out… Best regards, Jari W.

---

## [Ruby 1.9 trunk NKF and KCONV Encoding:ASCII-8BIT](https://www.ruby-forum.com/t/ruby-1-9-trunk-nkf-and-kconv-encoding-ascii-8bit/122052)

<div class="topic-metadata">

**Author:** [@WATANABE\_Tetsuya](https://www.ruby-forum.com/u/WATANABE_Tetsuya)\
**Replies:** 5\
**Last updated:** [December 20, 2007, 2:40am UTC](https://www.ruby-forum.com/t/ruby-1-9-trunk-nkf-and-kconv-encoding-ascii-8bit/122052 "2007-12-20T02:40:02Z")

</div>

e$BEOJUE/Li$G$9!#e(B nkf e$B$de(B kconv e$B$GJ8;zNs$N4A;z%3!\<%I$rJQ49$9$k$He(B Encoding:ASCII-8BIT e$B$K$J$C$F$$$^$9!#6/@)E\*$Ke(B String#force\_encoding e$B$9$l$P$$$$$N$G$9$,!“4A;z%3!\<%I$NJQ49$N$H$-$Ke(B encoding e$…

---

## [Command-set 0.8.3 Released](https://www.ruby-forum.com/t/command-set-0-8-3-released/123729)

<div class="topic-metadata">

**Author:** [@Judson\_L](https://www.ruby-forum.com/u/Judson_L)\
**Replies:** 0\
**Last updated:** [December 20, 2007, 2:38am UTC](https://www.ruby-forum.com/t/command-set-0-8-3-released/123729 "2007-12-20T02:38:52Z")

</div>

command-set version 0.8.3 has been released! CommandSet is a interactive program framework. Its focus is a DSL for defining commands, much like Rake or RSpec. The actual interpreter is left as an open question, alt…

---

## [Halcyon 0.3.7](https://www.ruby-forum.com/t/halcyon-0-3-7/123376)

<div class="topic-metadata">

**Author:** [@maraby](https://www.ruby-forum.com/u/maraby)\
**Replies:** 2\
**Last updated:** [December 20, 2007, 2:20am UTC](https://www.ruby-forum.com/t/halcyon-0-3-7/123376 "2007-12-20T02:20:43Z")

</div>

= Halcyon == JSON Server App Framework Halcyon is a JSON Web App Server Framework built on Rack for speed and light weight. For more information, read the RDocs: http://halcyon.rubyforge.org/doc/ === Announcement I…

---

## [Re: Programmer Ping-Pong (#150)](https://www.ruby-forum.com/t/re-programmer-ping-pong-150/229151)

<div class="topic-metadata">

**Author:** [@jameskelly](https://www.ruby-forum.com/u/jameskelly)\
**Replies:** 2\
**Last updated:** [December 20, 2007, 2:02am UTC](https://www.ruby-forum.com/t/re-programmer-ping-pong-150/229151 "2007-12-20T02:02:36Z")

</div>

I just realized that it might be a good idea to change my test to make each accept an options hash rather than ordered arguments, since my change and my new test will cause each to accept two keyword arguments. That i…

---

## [DataMapper 0.2.5 Release](https://www.ruby-forum.com/t/datamapper-0-2-5-release/123725)

<div class="topic-metadata">

**Author:** [@sams](https://www.ruby-forum.com/u/sams)\
**Replies:** 0\
**Last updated:** [December 20, 2007, 1:45am UTC](https://www.ruby-forum.com/t/datamapper-0-2-5-release/123725 "2007-12-20T01:45:39Z")

</div>

Notes: Bug-fix release. Some minor API changes and enhancements (MyModel#\[\] only accepts a primary key now, not an options hash). database.get (equiv to AR’s find\_by\_id) is approximately 25% faster than previous. N…

---

## [Interrupt in \*](https://www.ruby-forum.com/t/interrupt-in/123635)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 2\
**Last updated:** [December 20, 2007, 12:58am UTC](https://www.ruby-forum.com/t/interrupt-in/123635 "2007-12-20T00:58:18Z")

</div>

e$B0J2\<$N$h$&$K$7$F!"e(B\* e$B$N4V$Ke(B ^C e$B$G3d$j9~$s$@8e!"e(B e$B$9$Y$F$N%\*%V%8%’%/%H$re(B p e$B$7$F$\_$k$H!"0\[\>o=\*N;$7$^$9!#e(B % ./ruby -e ‘n = 10\*\*100000 begin n \* n rescue Interrupt p $! end ObjectSpace.eac…

---

## [Hpricot syntax different from Xpath?](https://www.ruby-forum.com/t/hpricot-syntax-different-from-xpath/123584)

<div class="topic-metadata">

**Author:** [@Celine](https://www.ruby-forum.com/u/Celine)\
**Replies:** 13\
**Last updated:** [December 20, 2007, 12:26am UTC](https://www.ruby-forum.com/t/hpricot-syntax-different-from-xpath/123584 "2007-12-20T00:26:05Z")

</div>

Hi all I’m trying to parse a page with Hpricot in order to retrieve a value. I use Xpather (a firefox extension) in order to get the path of this value. But when I use this path with Hpricot, it doesn’t work. I have …

---

## [Database-like Algorithmic Problem](https://www.ruby-forum.com/t/database-like-algorithmic-problem/123547)

<div class="topic-metadata">

**Author:** [@polypus](https://www.ruby-forum.com/u/polypus)\
**Replies:** 8\
**Last updated:** [December 20, 2007, 12:01am UTC](https://www.ruby-forum.com/t/database-like-algorithmic-problem/123547 "2007-12-20T00:01:30Z")

</div>

hi all, ok here’s the scoop. i have a collection of hashes all with an arbitrary number of symbolic keys pointing to arbitrary objects. i have a template hash also containing symbol keys pointing to ‘matching objects’…

---

## [Basic date/time question](https://www.ruby-forum.com/t/basic-date-time-question/123711)

<div class="topic-metadata">

**Author:** [@silvertab](https://www.ruby-forum.com/u/silvertab)\
**Replies:** 4\
**Last updated:** [December 19, 2007, 11:27pm UTC](https://www.ruby-forum.com/t/basic-date-time-question/123711 "2007-12-19T23:27:31Z")

</div>

I’m trying to calculate a period of time; basically each month is divided in 2 periods, from the 1st of the month to the 15th is period1, and from the 16th to the last day of the month is period2… Now my problem is th…

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

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