# Ruby

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

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

---

## [Does jruby support annotions yet?](https://www.ruby-forum.com/t/does-jruby-support-annotions-yet/171300)

<div class="topic-metadata">

**Author:** [@dalton](https://www.ruby-forum.com/u/dalton)\
**Replies:** 2\
**Last updated:** [July 1, 2009, 1:52am UTC](https://www.ruby-forum.com/t/does-jruby-support-annotions-yet/171300 "2009-07-01T01:52:50Z")

</div>

Hi all, according to the article of Nick about jruby and annotations, I asked myself whether jruby is supporting annotations now. (Adding Annotations to JRuby Using Ruby – Charles Oliver Nutter – Java, Ruby, and JVM g…

---

## [Error installing gem](https://www.ruby-forum.com/t/error-installing-gem/171339)

<div class="topic-metadata">

**Author:** [@nabusman](https://www.ruby-forum.com/u/nabusman)\
**Replies:** 6\
**Last updated:** [July 1, 2009, 12:45am UTC](https://www.ruby-forum.com/t/error-installing-gem/171339 "2009-07-01T00:45:01Z")

</div>

Here is the paste from Terminal: Nabs$ gem install mysql WARNING: Installing to ~/.gem since /Library/Ruby/Gems/1.8 and /usr/bin aren’t both writable. WARNING: You don’t have /Users/Nabs/.gem/ruby/1.8/bin in your P…

---

## [Dynamically creating class methods](https://www.ruby-forum.com/t/dynamically-creating-class-methods/171351)

<div class="topic-metadata">

**Author:** [@sshaikh](https://www.ruby-forum.com/u/sshaikh)\
**Replies:** 1\
**Last updated:** [June 30, 2009, 11:44pm UTC](https://www.ruby-forum.com/t/dynamically-creating-class-methods/171351 "2009-06-30T23:44:12Z")

</div>

I want to create a class method which allows us to create further class methods, so something like: class Test class \<\< self def create\_method(name, proc) self.class.send(:define\_method, name, proc) end end end p…

---

## [Loading java native extensions](https://www.ruby-forum.com/t/loading-java-native-extensions/171348)

<div class="topic-metadata">

**Author:** [@Timothy\_Hanson](https://www.ruby-forum.com/u/Timothy_Hanson)\
**Replies:** 0\
**Last updated:** [June 30, 2009, 10:45pm UTC](https://www.ruby-forum.com/t/loading-java-native-extensions/171348 "2009-06-30T22:45:37Z")

</div>

How does one load a dll from JRuby? I have Java wrapper classes (generated by SWIG) that wrap C++ code. Before referencing the Java classes, I need to load the DLL. I tried the following: irb(main):001:0\> java.lang.Sy…

---

## [MySQL to SQlite data movement](https://www.ruby-forum.com/t/mysql-to-sqlite-data-movement/171299)

<div class="topic-metadata">

**Author:** [@gigg](https://www.ruby-forum.com/u/gigg)\
**Replies:** 4\
**Last updated:** [June 30, 2009, 10:36pm UTC](https://www.ruby-forum.com/t/mysql-to-sqlite-data-movement/171299 "2009-06-30T22:36:32Z")

</div>

Hi, I hope someone can help. I am new to ruby and struggling with a hash and some database connections. What I need to do is copy data from table in a mysql database (2 columns), into a sqlite database (2 columns). I …

---

## [Ruby Best Practices now in print!](https://www.ruby-forum.com/t/ruby-best-practices-now-in-print/196979)

<div class="topic-metadata">

**Author:** [@naething](https://www.ruby-forum.com/u/naething)\
**Replies:** 1\
**Last updated:** [June 30, 2009, 10:17pm UTC](https://www.ruby-forum.com/t/ruby-best-practices-now-in-print/196979 "2009-06-30T22:17:28Z")

</div>

Hi folks, If you haven’t already heard, my book “Ruby Best Practices” is now available in print! The whole manuscript will be made freely available under a creative commons license in March 2010, but now is the time …

---

## [Table Record on Sqlite3 DB Not Saving Updates](https://www.ruby-forum.com/t/table-record-on-sqlite3-db-not-saving-updates/171317)

<div class="topic-metadata">

**Author:** [@Rachel\_N](https://www.ruby-forum.com/u/Rachel_N)\
**Replies:** 1\
**Last updated:** [June 30, 2009, 10:05pm UTC](https://www.ruby-forum.com/t/table-record-on-sqlite3-db-not-saving-updates/171317 "2009-06-30T22:05:23Z")

</div>

Does anyone have an idea of why the record for wsc\_sort\_order does not keep the value when I try to set it equal to 2 through console? Per below? I am stumped also - when first creating the record I had a value for …

---

## [: Hirb 0.2.2 with pager, menu and vertical table](https://www.ruby-forum.com/t/hirb-0-2-2-with-pager-menu-and-vertical-table/171340)

<div class="topic-metadata">

**Author:** [@ghorner](https://www.ruby-forum.com/u/ghorner)\
**Replies:** 0\
**Last updated:** [June 30, 2009, 8:40pm UTC](https://www.ruby-forum.com/t/hirb-0-2-2-with-pager-menu-and-vertical-table/171340 "2009-06-30T20:40:49Z")

</div>

I just released Hirb 0.2.2. You can install with: gem install cldwalker-hirb --sources http://gems.github.com or gem install hirb I’ve written about some of the latest features here: == New Features from 0.2.0 to 0…

---

## [Declined: IronRuby Pair debugging](https://www.ruby-forum.com/t/declined-ironruby-pair-debugging/171338)

<div class="topic-metadata">

**Author:** [@jballanc](https://www.ruby-forum.com/u/jballanc)\
**Replies:** 0\
**Last updated:** [June 30, 2009, 8:26pm UTC](https://www.ruby-forum.com/t/declined-ironruby-pair-debugging/171338 "2009-06-30T20:26:46Z")

</div>

Hey Shri, I am OOF for the rest of the week starting tomorrow. Can we try again next Thr?

---

## [Should a gem set $KCODE in ruby 1.8 for others?](https://www.ruby-forum.com/t/should-a-gem-set-kcode-in-ruby-1-8-for-others/171336)

<div class="topic-metadata">

**Author:** [@ghorner](https://www.ruby-forum.com/u/ghorner)\
**Replies:** 0\
**Last updated:** [June 30, 2009, 8:25pm UTC](https://www.ruby-forum.com/t/should-a-gem-set-kcode-in-ruby-1-8-for-others/171336 "2009-06-30T20:25:35Z")

</div>

Hi, I recently got a request to make my gem utf-8 friendly: since my gem involves calculating string lengths. For ruby 1.8 I need to use jcode’s jlength() to calculate this correctly but I’ll need to set $KCODE in o…

---

## [IronRuby Pair debugging](https://www.ruby-forum.com/t/ironruby-pair-debugging/171335)

<div class="topic-metadata">

**Author:** [@Shri\_B](https://www.ruby-forum.com/u/Shri_B)\
**Replies:** 0\
**Last updated:** [June 30, 2009, 8:16pm UTC](https://www.ruby-forum.com/t/ironruby-pair-debugging/171335 "2009-06-30T20:16:13Z")

</div>

When: Thursday, July 02, 2009 8:30 AM-11:00 AM (GMT-08:00) Pacific Time (US & Canada). Where: LiveMeeting and MSN Messenger Note: The GMT offset above does not reflect daylight saving time adjustments. ~~~~~~~~~ Ra…

---

## [Servolux 0.5.0](https://www.ruby-forum.com/t/servolux-0-5-0/171334)

<div class="topic-metadata">

**Author:** [@timperrett](https://www.ruby-forum.com/u/timperrett)\
**Replies:** 0\
**Last updated:** [June 30, 2009, 8:00pm UTC](https://www.ruby-forum.com/t/servolux-0-5-0/171334 "2009-06-30T20:00:24Z")

</div>

Serv-O-Lux version 0.5.0 by Tim P. GitHub - TwP/servolux: Threads : Servers : Forks : Daemons == DESCRIPTION Serv-O-Lux is a collection of Ruby classes that are useful for daemon and process management, and for wri…

---

## [How to interrupt unit tests if a library is not present](https://www.ruby-forum.com/t/how-to-interrupt-unit-tests-if-a-library-is-not-present/171261)

<div class="topic-metadata">

**Author:** [@Diana\_J](https://www.ruby-forum.com/u/Diana_J)\
**Replies:** 6\
**Last updated:** [June 30, 2009, 7:46pm UTC](https://www.ruby-forum.com/t/how-to-interrupt-unit-tests-if-a-library-is-not-present/171261 "2009-06-30T19:46:19Z")

</div>

Hi all, I am developing support for PhyloXML in BioRuby as Google Summer of Code project. I have a question about unit testing. My code depends on libxml-ruby library (other parts of BioRuby does not). So I want to …

---

## [Security Fix json-1.1.7 for json\_pure and json gems](https://www.ruby-forum.com/t/security-fix-json-1-1-7-for-json-pure-and-json-gems/171328)

<div class="topic-metadata">

**Author:** [@Florian\_F](https://www.ruby-forum.com/u/Florian_F)\
**Replies:** 0\
**Last updated:** [June 30, 2009, 7:19pm UTC](https://www.ruby-forum.com/t/security-fix-json-1-1-7-for-json-pure-and-json-gems/171328 "2009-06-30T19:19:20Z")

</div>

Synopsis Security Fix Release json-1.1.7 for json\_pure and json gems. Description The JSON::Pure::Parser contains a vulnerability that may lead to catastrophic backtracking in one of its regular expressions. This vu…

---

## [Attr\_writers within blocks](https://www.ruby-forum.com/t/attr-writers-within-blocks/171268)

<div class="topic-metadata">

**Author:** [@Wijnand\_W](https://www.ruby-forum.com/u/Wijnand_W)\
**Replies:** 13\
**Last updated:** [June 30, 2009, 7:03pm UTC](https://www.ruby-forum.com/t/attr-writers-within-blocks/171268 "2009-06-30T19:03:29Z")

</div>

Hi all, It seems writer methods don’t work within blocks, the names are resolved to new local variable names I guess. It is funny however the reader method does seem to work fine. Is it possible to make it work anywa…

---

## [Private method - Fixnum (NoMethodError)](https://www.ruby-forum.com/t/private-method-fixnum-nomethoderror/170447)

<div class="topic-metadata">

**Author:** [@koko](https://www.ruby-forum.com/u/koko)\
**Replies:** 4\
**Last updated:** [June 30, 2009, 5:14pm UTC](https://www.ruby-forum.com/t/private-method-fixnum-nomethoderror/170447 "2009-06-30T17:14:03Z")

</div>

Dear All, I can’t find the error in my code. Can you explain me "private method Fixnum (NoMethodError)"? Many thanks in advance, koko def subtotal(qty = 1) return nil if self.to\_f \<= 0 || qty.to\_f \<= 0 self.to\_f …

---

## [\[ANN\] RubyInstaller: Building installers story and news](https://www.ruby-forum.com/t/ann-rubyinstaller-building-installers-story-and-news/171210)

<div class="topic-metadata">

**Author:** [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Replies:** 5\
**Last updated:** [June 30, 2009, 2:53pm UTC](https://www.ruby-forum.com/t/ann-rubyinstaller-building-installers-story-and-news/171210 "2009-06-30T14:53:42Z")

</div>

Hey guys, Sometimes is good to be wrong. Back in 2008 I said that going MSI and WiX was going to be the best option from the “Administrative point of view” At the end, I ended neglecting the XML files that WiX uses o…

---

## [TK Directory question](https://www.ruby-forum.com/t/tk-directory-question/171260)

<div class="topic-metadata">

**Author:** [@rubyman](https://www.ruby-forum.com/u/rubyman)\
**Replies:** 2\
**Last updated:** [June 30, 2009, 1:34pm UTC](https://www.ruby-forum.com/t/tk-directory-question/171260 "2009-06-30T13:34:39Z")

</div>

Hello, I am working on a GUI that allows the user to select a file to work on. I am using Tk.getOpenFile to do this. I would like the application to ‘remember’ the file path from the last time they selected a file, so …

---

## [Parallelizing a ruby task](https://www.ruby-forum.com/t/parallelizing-a-ruby-task/171271)

<div class="topic-metadata">

**Author:** [@markthomas](https://www.ruby-forum.com/u/markthomas)\
**Replies:** 6\
**Last updated:** [June 30, 2009, 1:15pm UTC](https://www.ruby-forum.com/t/parallelizing-a-ruby-task/171271 "2009-06-30T13:15:52Z")

</div>

I have a long-running batch job that I would like to speed up. Currently it uses only one CPU and the server I have in mind for this has 16 cores, and I want to take advantage of them. I’m thinking one of three possib…

---

## [Rendering pdf](https://www.ruby-forum.com/t/rendering-pdf/169294)

<div class="topic-metadata">

**Author:** [@twittwit](https://www.ruby-forum.com/u/twittwit)\
**Replies:** 3\
**Last updated:** [June 30, 2009, 12:43pm UTC](https://www.ruby-forum.com/t/rendering-pdf/169294 "2009-06-30T12:43:56Z")

</div>

hello all, i am new to ruby ( like two hours new! ) but i do know other languages. I LOVE RUBY! anyway, i want to code something to render my website into pdf. i have seen these railscasts : they are super good b…

---

## [Strings to int conversion](https://www.ruby-forum.com/t/strings-to-int-conversion/171139)

<div class="topic-metadata">

**Author:** [@woodzer](https://www.ruby-forum.com/u/woodzer)\
**Replies:** 8\
**Last updated:** [June 30, 2009, 11:23am UTC](https://www.ruby-forum.com/t/strings-to-int-conversion/171139 "2009-06-30T11:23:08Z")

</div>

s = “1234” \[0…1\] p s #\> “12” p s.to\_i #\> 12 s = s\[1\] p s #\> 50 p s.to\_i #\> 50 I can see the reason for this happening, but I don’t want it to happen. So how do I make it return 2 instead of 50?

---

## [Locking a process](https://www.ruby-forum.com/t/locking-a-process/171285)

<div class="topic-metadata">

**Author:** [@judge](https://www.ruby-forum.com/u/judge)\
**Replies:** 5\
**Last updated:** [June 30, 2009, 10:46am UTC](https://www.ruby-forum.com/t/locking-a-process/171285 "2009-06-30T10:46:53Z")

</div>

I am in the process of developing a few scripts that: pull images off a CF card on my laptop move the images to a server rename the images on the server according to the EXIF info I figure that for 2 & 3, the easiest …

---

## [Running RubyGems tests with JRuby](https://www.ruby-forum.com/t/running-rubygems-tests-with-jruby/171308)

<div class="topic-metadata">

**Author:** [@jspencer78](https://www.ruby-forum.com/u/jspencer78)\
**Replies:** 0\
**Last updated:** [June 30, 2009, 10:30am UTC](https://www.ruby-forum.com/t/running-rubygems-tests-with-jruby/171308 "2009-06-30T10:30:52Z")

</div>

(originally posted to dev, but might be more useful on user) Using JRuby 1.3.1 to run the RubyGems 1.3.1 test suite, I get an exception midway but no visible exception message. I used this to run the tests, just to …

---

## [Bluecloth 2.0.4](https://www.ruby-forum.com/t/bluecloth-2-0-4/171288)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [June 30, 2009, 7:04am UTC](https://www.ruby-forum.com/t/bluecloth-2-0-4/171288 "2009-06-30T07:04:48Z")

</div>

Version 2.0.4 of bluecloth has been released. BlueCloth is a Ruby implementation of \[Markdown\]\[1\], a text-to-HTML conversion tool for web writers. To quote from the project page: Markdown allows you to write using an …

---

## [Need Advice Help On Parsing A File](https://www.ruby-forum.com/t/need-advice-help-on-parsing-a-file/171184)

<div class="topic-metadata">

**Author:** [@mrmaster](https://www.ruby-forum.com/u/mrmaster)\
**Replies:** 9\
**Last updated:** [June 30, 2009, 6:56am UTC](https://www.ruby-forum.com/t/need-advice-help-on-parsing-a-file/171184 "2009-06-30T06:56:01Z")

</div>

Hello, I’m creating an application that will parse mbox files, extract the data, and put it into a db. I have a couple of problems. For those of you who are not familiar with mbox files, just think of one text file t…

---

## [Cannot find in documentation anymore what tl is in Timeout::timeout(to) do |tl|](https://www.ruby-forum.com/t/cannot-find-in-documentation-anymore-what-tl-is-in-timeout-timeout-to-do-tl/171290)

<div class="topic-metadata">

**Author:** [@Xeno\_C](https://www.ruby-forum.com/u/Xeno_C)\
**Replies:** 1\
**Last updated:** [June 30, 2009, 4:46am UTC](https://www.ruby-forum.com/t/cannot-find-in-documentation-anymore-what-tl-is-in-timeout-timeout-to-do-tl/171290 "2009-06-30T04:46:54Z")

</div>

begin Timeout::timeout(OverallTimeout) do |tl| # Until I find out what this is, Forget it… # No doc on tl anymore! #puts “tl: #{tl}” probe\_threads.each { |t| t.join } puts “done” end rescue Timeout::Error =\> eo …

---

## [Caller usage and getting a full trace after a rescue on general Exception](https://www.ruby-forum.com/t/caller-usage-and-getting-a-full-trace-after-a-rescue-on-general-exception/171282)

<div class="topic-metadata">

**Author:** [@Xeno\_C](https://www.ruby-forum.com/u/Xeno_C)\
**Replies:** 2\
**Last updated:** [June 30, 2009, 4:13am UTC](https://www.ruby-forum.com/t/caller-usage-and-getting-a-full-trace-after-a-rescue-on-general-exception/171282 "2009-06-30T04:13:02Z")

</div>

Say, I’m having a difficult problem getting a complete trace/stack dump. I’ve got a place where I do a rescue Exception for anything, and I get the darn raise string, but not a trace back to the line where it occurre…

---

## [Ri\_cal 0.7.0 Released](https://www.ruby-forum.com/t/ri-cal-0-7-0-released/171289)

<div class="topic-metadata">

**Author:** [@rykkers](https://www.ruby-forum.com/u/rykkers)\
**Replies:** 0\
**Last updated:** [June 30, 2009, 3:50am UTC](https://www.ruby-forum.com/t/ri-cal-0-7-0-released/171289 "2009-06-30T03:50:49Z")

</div>

Subject: \[ANN\] ri\_cal 0.7.0 Released ri\_cal version 0.7.0 has been released! http://ri-cal.rubyforge.org/ A new Ruby implementation of RFC2445 iCalendar. The existing Ruby iCalendar libraries (e.g. icalendar, vpi…

---

## [SetWindowPos() usage with win32api](https://www.ruby-forum.com/t/setwindowpos-usage-with-win32api/171284)

<div class="topic-metadata">

**Author:** [@dreamwave](https://www.ruby-forum.com/u/dreamwave)\
**Replies:** 0\
**Last updated:** [June 30, 2009, 1:13am UTC](https://www.ruby-forum.com/t/setwindowpos-usage-with-win32api/171284 "2009-06-30T01:13:57Z")

</div>

All I really want to accomplish is pulling the active window to the front, and keep it there. What would be the best way to achieve this using perhaps: SetWindowPos() or SetForegroundWindow() Any other suggestions …

---

## [String Buffering Issue](https://www.ruby-forum.com/t/string-buffering-issue/171276)

<div class="topic-metadata">

**Author:** [@tjholowaychuk](https://www.ruby-forum.com/u/tjholowaychuk)\
**Replies:** 2\
**Last updated:** [June 30, 2009, 12:01am UTC](https://www.ruby-forum.com/t/string-buffering-issue/171276 "2009-06-30T00:01:06Z")

</div>

This is an example snippet from a library im working on example.rb · GitHub I need to be able to ‘buffer’ or collect the results without yielding an object to any number of nested blocks. I know this can be done with …

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

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