# Ruby

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

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

---

## [Word Wrapping at n characters](https://www.ruby-forum.com/t/word-wrapping-at-n-characters/175392)

<div class="topic-metadata">

**Author:** [@quik77](https://www.ruby-forum.com/u/quik77)\
**Replies:** 3\
**Last updated:** [September 12, 2009, 8:47pm UTC](https://www.ruby-forum.com/t/word-wrapping-at-n-characters/175392 "2009-09-12T20:47:05Z")

</div>

Right now I basically use this code for word wrapping: def word\_wrap(line\_width = 80) self.gsub(/(.{1,#{line\_width}})(\\s+|$)/, “\\1\\n”) end Is anyone using a better solution? This method should be robust enough to do…

---

## [\[Bug #2074\] json $B$N(B j $B$d(B jj $B$O(B module\_function $B$K$9$k$Y$-!)(B](https://www.ruby-forum.com/t/bug-2074-json-b-n-b-j-b-d-b-jj-b-o-b-module-function-b-k-9-k-y-b/175400)

<div class="topic-metadata">

**Author:** [@Yui\_NARUSE](https://www.ruby-forum.com/u/Yui_NARUSE)\
**Replies:** 0\
**Last updated:** [September 12, 2009, 7:39pm UTC](https://www.ruby-forum.com/t/bug-2074-json-b-n-b-j-b-d-b-jj-b-o-b-module-function-b-k-9-k-y-b/175400 "2009-09-12T19:39:42Z")

</div>

e$B%A%1%C%He(B #2074 e$B$,99?7$5$l$^$7$?!#e(B (by Yui NARUSE) Target version 1.9.2e$B$K%;%C%He(B je$B$de(Bjje$B$,JQ?t$J$I$GKd$^$C$F$$$F$b8F$Y$k$H$$$&%a%j%C%H$O$"$j$^$9$M!#e(B e$B$I$A$i$K$7$F$b!"e(BRubye$BA4BN$H$7$FJ}…

---

## [Ù‡ÙˆØ§Ø´ Ø´Ø±ÙƒØ© Ø§Ù„Ø¥ØªØµØ§Ù„Ø§Øª ÙˆÙ…ÙˆØ¨Ø§ÙŠÙ„ ÙŠ .. Ø£Ø®Ø± Ø§Ù„ÙØ¶Ø§ÙŠØ­](https://www.ruby-forum.com/t/u-u-o-o-o-o-u-o-o-u-o-o-o-o-u-o-o-u-u-u-o-o-usu-us-o-o-o-o-u-u-o-o-uso/175388)

<div class="topic-metadata">

**Author:** [@Beliveit2009](https://www.ruby-forum.com/u/Beliveit2009)\
**Replies:** 0\
**Last updated:** [September 12, 2009, 1:52pm UTC](https://www.ruby-forum.com/t/u-u-o-o-o-o-u-o-o-u-o-o-o-o-u-o-o-u-u-u-o-o-usu-us-o-o-o-o-u-u-o-o-uso/175388 "2009-09-12T13:52:39Z")

</div>

åæÇÔ ÔÑßÉ ÇáÅÊÕÇáÇÊ æãæÈÇíáí … ÃÎÑ ÇáÝÖÇíÍ …

---

## [Win32api hook](https://www.ruby-forum.com/t/win32api-hook/175384)

<div class="topic-metadata">

**Author:** [@romte09](https://www.ruby-forum.com/u/romte09)\
**Replies:** 2\
**Last updated:** [September 12, 2009, 1:19pm UTC](https://www.ruby-forum.com/t/win32api-hook/175384 "2009-09-12T13:19:49Z")

</div>

So i just got into win32api stuff and i would like to make a (c++)dll to join in a process. I got some code here but i dont know much about win32api & params require ‘win32api’ hook = Win32API.new(‘user32’,‘SetWindo…

---

## [RSS::Maker and non-permalink guids](https://www.ruby-forum.com/t/rss-maker-and-non-permalink-guids/175354)

<div class="topic-metadata">

**Author:** [@sjmadsen](https://www.ruby-forum.com/u/sjmadsen)\
**Replies:** 1\
**Last updated:** [September 12, 2009, 3:18am UTC](https://www.ruby-forum.com/t/rss-maker-and-non-permalink-guids/175354 "2009-09-12T03:18:48Z")

</div>

I am using RSS::Maker to produce an RSS 2.0 feed. The items in this feed are a mix, some having guids that are permalinks and others that are not. It appears that the resulting feed is incorrect when generating an ite…

---

## [How Are Variables Kept Independent of Each Other Yet Pass Values?](https://www.ruby-forum.com/t/how-are-variables-kept-independent-of-each-other-yet-pass-values/175239)

<div class="topic-metadata">

**Author:** [@masonkessinger](https://www.ruby-forum.com/u/masonkessinger)\
**Replies:** 13\
**Last updated:** [September 12, 2009, 2:51am UTC](https://www.ruby-forum.com/t/how-are-variables-kept-independent-of-each-other-yet-pass-values/175239 "2009-09-12T02:51:17Z")

</div>

Somewhere in the several books I’ve been learning Ruby from there was the note that when you create a new variable and assign it a value from another variable that you really haven’t created an independent variable a…

---

## [Ruby + COM + OLEGEN](https://www.ruby-forum.com/t/ruby-com-olegen/175285)

<div class="topic-metadata">

**Author:** [@beer](https://www.ruby-forum.com/u/beer)\
**Replies:** 4\
**Last updated:** [September 11, 2009, 11:59pm UTC](https://www.ruby-forum.com/t/ruby-com-olegen/175285 "2009-09-11T23:59:48Z")

</div>

Hello. I have this TLB, and when I run OLEGEN (\\doc\\ruby\\ruby-1.8.6\\sample\\win32ole) I obtain a file that is either incomplete or I’m missing something. It only generates only one class and 5 modules. If so, how can …

---

## [Populating a hash from an array using inject](https://www.ruby-forum.com/t/populating-a-hash-from-an-array-using-inject/175314)

<div class="topic-metadata">

**Author:** [@Glenn\_J](https://www.ruby-forum.com/u/Glenn_J)\
**Replies:** 11\
**Last updated:** [September 11, 2009, 11:25pm UTC](https://www.ruby-forum.com/t/populating-a-hash-from-an-array-using-inject/175314 "2009-09-11T23:25:23Z")

</div>

I was looking at this problem on Stack Overflow (this one: The question is how to “convert” an array of objects into a hash. Consider this code: require 'pp' p RUBY\_VERSION Product = Struct.new(:name, :category) pro…

---

## [JRubyConf 2009, immediately after RubyConf!](https://www.ruby-forum.com/t/jrubyconf-2009-immediately-after-rubyconf/175373)

<div class="topic-metadata">

**Author:** [@headius](https://www.ruby-forum.com/u/headius)\
**Replies:** 1\
**Last updated:** [September 11, 2009, 10:40pm UTC](https://www.ruby-forum.com/t/jrubyconf-2009-immediately-after-rubyconf/175373 "2009-09-11T22:40:11Z")

</div>

It’s our great pleasure to announce the first-ever JRubyConf! It will be hosted at the same venue and immediately after RubyConf, so you can plan a single trip (or just come to JRubyConf, if you like!) And best of all…

---

## [Compiling ruby.h with precompiled headers](https://www.ruby-forum.com/t/compiling-ruby-h-with-precompiled-headers/175360)

<div class="topic-metadata">

**Author:** [@geotavros](https://www.ruby-forum.com/u/geotavros)\
**Replies:** 0\
**Last updated:** [September 11, 2009, 7:46pm UTC](https://www.ruby-forum.com/t/compiling-ruby-h-with-precompiled-headers/175360 "2009-09-11T19:46:10Z")

</div>

Hi, I’m trying to use Ruby in my C++ project. My project uses precompiled headers, but when I try to include ruby.h header in it I get errors in win32.h files that lie in RUBY\_INCLUDE folder. Here is error: …ruby\\lib…

---

## [Fwd: \[redmine4ruby-lang:253\] \[Bug #1914\] ruby-1.9.1-p243 failed to build from source on aix 5.3 wit](https://www.ruby-forum.com/t/fwd-redmine4ruby-lang-253-bug-1914-ruby-1-9-1-p243-failed-to-build-from-source-on-aix-5-3-wit/173444)

<div class="topic-metadata">

**Author:** [@Yugui](https://www.ruby-forum.com/u/Yugui)\
**Replies:** 11\
**Last updated:** [September 11, 2009, 5:35pm UTC](https://www.ruby-forum.com/t/fwd-redmine4ruby-lang-253-bug-1914-ruby-1-9-1-p243-failed-to-build-from-source-on-aix-5-3-wit/173444 "2009-09-11T17:35:12Z")

</div>

Redminee$B4IM}MQ%W%m%8%'%/%H$KJs9p$5$l$F$7$^$C$?$N$GE\>Aw$7$^$9!#e(B ---------- e$BE\>Aw%a%C%;!\<%8e(B ---------- From: Joel S. removed\_email\_address@domain.invalid e$BF|IUe(B: 2009/08/09 7:55 e$B7oL\>e(B: \[redmine4ruby-…

---

## [Rubyscript instead of javascript](https://www.ruby-forum.com/t/rubyscript-instead-of-javascript/174988)

<div class="topic-metadata">

**Author:** [@ther](https://www.ruby-forum.com/u/ther)\
**Replies:** 29\
**Last updated:** [September 11, 2009, 5:30pm UTC](https://www.ruby-forum.com/t/rubyscript-instead-of-javascript/174988 "2009-09-11T17:30:30Z")

</div>

It is just a thought. And I wouldn’t know anything about possible problems implementing this, but wouldn’t be nice if rubyscript could be executed inside of browser just like javascript does. by TheR

---

## [Ri\_cal 0.8.2 Released](https://www.ruby-forum.com/t/ri-cal-0-8-2-released/175351)

<div class="topic-metadata">

**Author:** [@rykkers](https://www.ruby-forum.com/u/rykkers)\
**Replies:** 0\
**Last updated:** [September 11, 2009, 4:55pm UTC](https://www.ruby-forum.com/t/ri-cal-0-8-2-released/175351 "2009-09-11T16:55:58Z")

</div>

NOTE: This version was released on github some days ago. I’d held off releasing it on RubyForge because right now the gitosis server on RubyForge is broken. I was waiting for TC to fix it because I didn’t want the …

---

## [Joker -- Wildcards for Ruby](https://www.ruby-forum.com/t/joker-wildcards-for-ruby/175215)

<div class="topic-metadata">

**Author:** [@fstroehle](https://www.ruby-forum.com/u/fstroehle)\
**Replies:** 7\
**Last updated:** [September 11, 2009, 4:18pm UTC](https://www.ruby-forum.com/t/joker-wildcards-for-ruby/175215 "2009-09-11T16:18:31Z")

</div>

Hi folks, I’m proudly presenting: Joker http://karottenreibe.github.com/joker Joker is a Wildcard implementation for Ruby. Features Behaves much like Regexp \* and ? as wildcard characters \\ for escaping \\a matc…

---

## [No such file to load -- sqlite3](https://www.ruby-forum.com/t/no-such-file-to-load-sqlite3/175337)

<div class="topic-metadata">

**Author:** [@polunochnik](https://www.ruby-forum.com/u/polunochnik)\
**Replies:** 2\
**Last updated:** [September 11, 2009, 3:18pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-sqlite3/175337 "2009-09-11T15:18:29Z")

</div>

Hi. I’ve just installed the sqlite3-ruby gem, but when I require it, I’m getting the load error. gem list … sqlite3-ruby (1.2.5) … ruby -e “require ‘sqlite3’” … no such file to load – sqlite3 (LoadError) … Wha…

---

## [Changing Xml version in sinatra](https://www.ruby-forum.com/t/changing-xml-version-in-sinatra/175342)

<div class="topic-metadata">

**Author:** [@virendra](https://www.ruby-forum.com/u/virendra)\
**Replies:** 1\
**Last updated:** [September 11, 2009, 2:36pm UTC](https://www.ruby-forum.com/t/changing-xml-version-in-sinatra/175342 "2009-09-11T14:36:03Z")

</div>

hello to all I have been working on sinatra for quite while now and i found it as great as Rails I recently constructed a sintra application that return result in Xml format all i wanted to know how do i change the…

---

## [Test #884 fail](https://www.ruby-forum.com/t/test-884-fail/175329)

<div class="topic-metadata">

**Author:** [@KISHIMOTOS\_Makoto](https://www.ruby-forum.com/u/KISHIMOTOS_Makoto)\
**Replies:** 0\
**Last updated:** [September 11, 2009, 11:41am UTC](https://www.ruby-forum.com/t/test-884-fail/175329 "2009-09-11T11:41:01Z")

</div>

e$B$-$7$b$H$G$9e(B e$B\<j85$N4D6-!Je(BAMD64 FreeBSD8 Beta3e$B!K$G!"e(Btrunke$B!Je(BRev: 24847e$B!K$,e(B make test e$B$G$R$H$D\<:GT$7$^$9e(B #884 test\_thread.rb:191:in \`\<top (required)\>’: begin 100.times do |i| begin …

---

## [Ruby, rmagick and .Net](https://www.ruby-forum.com/t/ruby-rmagick-and-net/175327)

<div class="topic-metadata">

**Author:** [@bex3000](https://www.ruby-forum.com/u/bex3000)\
**Replies:** 0\
**Last updated:** [September 11, 2009, 10:49am UTC](https://www.ruby-forum.com/t/ruby-rmagick-and-net/175327 "2009-09-11T10:49:10Z")

</div>

Hey folks, I’ve been looking into possible solutions to a .Net project using the RubyConnector over at SapphireSteel and I have got it working with the ruby using rmagick functionality. My worry is that this will all …

---

## [Is URI.decode() broken?](https://www.ruby-forum.com/t/is-uri-decode-broken/160308)

<div class="topic-metadata">

**Author:** [@MOROHASHI\_Kyosuke](https://www.ruby-forum.com/u/MOROHASHI_Kyosuke)\
**Replies:** 38\
**Last updated:** [September 11, 2009, 10:39am UTC](https://www.ruby-forum.com/t/is-uri-decode-broken/160308 "2009-09-11T10:39:32Z")

</div>

e$B$b$m$O$7$G$9!#$$$D$b$@$OC$K$J$C$F$$j$^$9!#e(B Ruby 1.9.1p0e$B$G!“e(BURI.decode()e$B$,$&$^$/F0$+$J$$$h$&$G$9!#e(B e$B0lJ8;z$:$D%G%3!\<%I$5$l$k$?$ae(B(?)e$B!”%^%k%A%P%$%HJ8;z$rI|85$G$-$F$$$^$;$s!#e(B $ ruby19 -Ku -rur…

---

## [String.each\[1,2,3,4,5\]](https://www.ruby-forum.com/t/string-each-1-2-3-4-5/175241)

<div class="topic-metadata">

**Author:** [@i8igmac](https://www.ruby-forum.com/u/i8igmac)\
**Replies:** 10\
**Last updated:** [September 11, 2009, 9:08am UTC](https://www.ruby-forum.com/t/string-each-1-2-3-4-5/175241 "2009-09-11T09:08:49Z")

</div>

this is making me mad, i cant figure out how to brake a string down into individual strings string = “hello my name is bigmac” string.each\[1,2,3,4,5,6\] puts string\[1\] #‘hello’ puts string\[2\] #‘my’ puts string\[3\] #‘…

---

## [Can not catch PTY::ChildExited exception](https://www.ruby-forum.com/t/can-not-catch-pty-childexited-exception/175162)

<div class="topic-metadata">

**Author:** [@denisb](https://www.ruby-forum.com/u/denisb)\
**Replies:** 8\
**Last updated:** [September 11, 2009, 7:55am UTC](https://www.ruby-forum.com/t/can-not-catch-pty-childexited-exception/175162 "2009-09-11T07:55:30Z")

</div>

Hi guys! I have problem that I can not catch PTY::ChildExited exception. Here is the code: require ‘pty’ cmd = “/home3/cman/work/product/integrator/test/syb2/OCS-15\_0/bin/isql -Uuser2 -Puser2 -Scman2” begin pipe\_r…

---

## [Regex: multiline](https://www.ruby-forum.com/t/regex-multiline/175243)

<div class="topic-metadata">

**Author:** [@ahmet](https://www.ruby-forum.com/u/ahmet)\
**Replies:** 7\
**Last updated:** [September 11, 2009, 4:47am UTC](https://www.ruby-forum.com/t/regex-multiline/175243 "2009-09-11T04:47:42Z")

</div>

Hello, I am trying regex samples on this page Learning to Use Regular Expressions. My problem is, how can I grep multiline with regex? This is my example; … \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*…

---

## [Whatâ€™ s the best general implementation of custom #hash methods?](https://www.ruby-forum.com/t/whata-s-the-best-general-implementation-of-custom-hash-methods/175293)

<div class="topic-metadata">

**Author:** [@Shot\_SPiotr\_S.S](https://www.ruby-forum.com/u/Shot_SPiotr_S.S)\
**Replies:** 5\
**Last updated:** [September 11, 2009, 2:16am UTC](https://www.ruby-forum.com/t/whata-s-the-best-general-implementation-of-custom-hash-methods/175293 "2009-09-11T02:16:41Z")

</div>

Hello, ruby-talk. Whatâ€™s the best (fast, yet with relatively few cases when equal hashes are generated for non-eql objects) way to implement a hash method? Is XOR-ing the hashes of an objectâ€™s instance variables (…

---

## [Generating PDF's from scratch Using Ruby](https://www.ruby-forum.com/t/generating-pdfs-from-scratch-using-ruby/175308)

<div class="topic-metadata">

**Author:** [@crystal](https://www.ruby-forum.com/u/crystal)\
**Replies:** 1\
**Last updated:** [September 11, 2009, 12:38am UTC](https://www.ruby-forum.com/t/generating-pdfs-from-scratch-using-ruby/175308 "2009-09-11T00:38:20Z")

</div>

Can anyone give me any help on doing this I am new to Ruby/Rails. I need to Generate and be able to print out these reports.

---

## [September Phoenix Ruby User Group Meeting (9/14)](https://www.ruby-forum.com/t/september-phoenix-ruby-user-group-meeting-9-14/175307)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 0\
**Last updated:** [September 11, 2009, 12:04am UTC](https://www.ruby-forum.com/t/september-phoenix-ruby-user-group-meeting-9-14/175307 "2009-09-11T00:04:58Z")

</div>

September Phoenix Ruby U. Group Meeting When: Monday, September 14, 2009 6:30pm door open. Laptop power and WiFi available. 7:00pm Showtime! 8:30pm Migrate to Four Peaks Brewery Topic: Ruby on the Google App Engin…

---

## [Require "snmp" error in script](https://www.ruby-forum.com/t/require-snmp-error-in-script/122254)

<div class="topic-metadata">

**Author:** [@jackster](https://www.ruby-forum.com/u/jackster)\
**Replies:** 3\
**Last updated:** [September 10, 2009, 10:30pm UTC](https://www.ruby-forum.com/t/require-snmp-error-in-script/122254 "2009-09-10T22:30:33Z")

</div>

I am trying to require “snmp” in a basic script to poll some networking devices and I’m getting the following error: ./snmp.rb:4: uninitialized constant SNMP (NameError) from ./snmp.rb:3:in \`require’ from ./snmp.rb:3 …

---

## [Error using 'gem install' how do you reset path?](https://www.ruby-forum.com/t/error-using-gem-install-how-do-you-reset-path/175289)

<div class="topic-metadata">

**Author:** [@mmcolli00](https://www.ruby-forum.com/u/mmcolli00)\
**Replies:** 6\
**Last updated:** [September 10, 2009, 9:14pm UTC](https://www.ruby-forum.com/t/error-using-gem-install-how-do-you-reset-path/175289 "2009-09-10T21:14:09Z")

</div>

quick question I believe that I lost my path for using the command gem install. @hen I attempt to install a gem, I get the following error while using ‘gem install json’ (and other gems). Error (Errno:ENOENT) No such…

---

## [Hash value inconsistencies](https://www.ruby-forum.com/t/hash-value-inconsistencies/128216)

<div class="topic-metadata">

**Author:** [@timperrett](https://www.ruby-forum.com/u/timperrett)\
**Replies:** 6\
**Last updated:** [September 10, 2009, 8:48pm UTC](https://www.ruby-forum.com/t/hash-value-inconsistencies/128216 "2009-09-10T20:48:18Z")

</div>

ruby -e “puts ‘test’.hash” Should this output the same integer value on all platforms where Ruby can run? Windows ruby --version #=\> ruby 1.8.6 (2007-03-13 patchlevel 0) \[i386- mswin32\] ruby -e “puts ‘test’.has…

---

## [Timeout for watir wait?](https://www.ruby-forum.com/t/timeout-for-watir-wait/175246)

<div class="topic-metadata">

**Author:** [@paragadosm](https://www.ruby-forum.com/u/paragadosm)\
**Replies:** 2\
**Last updated:** [September 10, 2009, 6:58pm UTC](https://www.ruby-forum.com/t/timeout-for-watir-wait/175246 "2009-09-10T18:58:48Z")

</div>

I’m currently using Ruby 1.8.5, Rubygems 0.9.2, Watir 1.5.2 I’m doing a standard login on a page using the .click method on the Login button. I’d like to throw an exception or failure message back if it takes more th…

---

## [What licensing info is needed in code headers?](https://www.ruby-forum.com/t/what-licensing-info-is-needed-in-code-headers/174820)

<div class="topic-metadata">

**Author:** [@Shot\_SPiotr\_S.S](https://www.ruby-forum.com/u/Shot_SPiotr_S.S)\
**Replies:** 9\
**Last updated:** [September 10, 2009, 5:44pm UTC](https://www.ruby-forum.com/t/what-licensing-info-is-needed-in-code-headers/174820 "2009-09-10T17:44:26Z")

</div>

Disclaimer: I know that some of you live in jurisdictions that do not allow you to give legal adivce, and Iâ€™m not seeking it â€“ Iâ€™m merely asking for a good practice. :slight\_smile: I like my code as clean as pos…

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

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