# Ruby

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

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

---

## [Lightweight intelligent http proxy in jruby](https://www.ruby-forum.com/t/lightweight-intelligent-http-proxy-in-jruby/158908)

<div class="topic-metadata">

**Author:** [@snacktime](https://www.ruby-forum.com/u/snacktime)\
**Replies:** 2\
**Last updated:** [January 29, 2009, 8:18pm UTC](https://www.ruby-forum.com/t/lightweight-intelligent-http-proxy-in-jruby/158908 "2009-01-29T20:18:04Z")

</div>

So I’m working on a fairly simple http service that basically provides a different api and intelligent routing front end to backend solr master/slave instances. Jruby seems ideal as I can take advantage of java threa…

---

## [MiniTest / Test::Unit](https://www.ruby-forum.com/t/minitest-test-unit/158839)

<div class="topic-metadata">

**Author:** [@noagenda](https://www.ruby-forum.com/u/noagenda)\
**Replies:** 2\
**Last updated:** [January 29, 2009, 7:28pm UTC](https://www.ruby-forum.com/t/minitest-test-unit/158839 "2009-01-29T19:28:52Z")

</div>

I’m struggling to understand the combinations in which MiniTest and Test::Unit can be used. This is my understanding so far… Test::Unit Available as a standard library (‘test/unit’) in Ruby versions before 1.9.1. Av…

---

## [The RSpec Book is now in beta](https://www.ruby-forum.com/t/the-rspec-book-is-now-in-beta/158939)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 4\
**Last updated:** [January 29, 2009, 5:44pm UTC](https://www.ruby-forum.com/t/the-rspec-book-is-now-in-beta/158939 "2009-01-29T17:44:01Z")

</div>

I’m pleased to announce the beta release of the Pragmatic Bookshelf’s The RSpec Book: Behaviour Driven Development with RSpec, Cucumber and Friends! It’s been a long time coming, and there’s still a lot of work to do …

---

## [Add randomize method to array?](https://www.ruby-forum.com/t/add-randomize-method-to-array/158941)

<div class="topic-metadata">

**Author:** [@bartb](https://www.ruby-forum.com/u/bartb)\
**Replies:** 4\
**Last updated:** [January 29, 2009, 5:04pm UTC](https://www.ruby-forum.com/t/add-randomize-method-to-array/158941 "2009-01-29T17:04:52Z")

</div>

Perhaps a silly question. What is the best way to add a randomize method to array? I know that this code will properly randomize an array: a.sort\_by{ rand } but I wonder how I can know add this to the array class. I …

---

## [Getting LoadError when using ruby and gem](https://www.ruby-forum.com/t/getting-loaderror-when-using-ruby-and-gem/158902)

<div class="topic-metadata">

**Author:** [@balavrscse](https://www.ruby-forum.com/u/balavrscse)\
**Replies:** 1\
**Last updated:** [January 29, 2009, 2:58pm UTC](https://www.ruby-forum.com/t/getting-loaderror-when-using-ruby-and-gem/158902 "2009-01-29T14:58:17Z")

</div>

I m seeing below error when I m trying to run one of the application. \[ppok@xx23 HH\]$ uname -a Linux xx23.iky.knobb 2.6.18-92.el5 #1 SMP Tue Apr 29 13:16:12 EDT 2008 i686 i686 i386 GNU/Linux \[ppok@xx23 HH\]\]$ ruby --v…

---

## [Error with regular expression inside eval block](https://www.ruby-forum.com/t/error-with-regular-expression-inside-eval-block/158877)

<div class="topic-metadata">

**Author:** [@barunio](https://www.ruby-forum.com/u/barunio)\
**Replies:** 4\
**Last updated:** [January 29, 2009, 1:59pm UTC](https://www.ruby-forum.com/t/error-with-regular-expression-inside-eval-block/158877 "2009-01-29T13:59:01Z")

</div>

I’m seeing strange behavior with Ruby 1.8 when I try to evaluate a regular expression inside an eval block. Consider the following: puts ‘1’ =~ /^\[\\d\]+$/ outputs “0” to the terminal eval %Q{‘1’ =~ /^\[\\d\]+$/} o…

---

## [Check for two strings](https://www.ruby-forum.com/t/check-for-two-strings/158917)

<div class="topic-metadata">

**Author:** [@newb](https://www.ruby-forum.com/u/newb)\
**Replies:** 2\
**Last updated:** [January 29, 2009, 1:09pm UTC](https://www.ruby-forum.com/t/check-for-two-strings/158917 "2009-01-29T13:09:32Z")

</div>

Is this possible to check for two strings. i want to check whether these two params exits i want to proceed the process i get two strings through form search\_string\_1 = params\[:first\_name\] search \_string\_2 = params\[…

---

## [Yield vs. return](https://www.ruby-forum.com/t/yield-vs-return/158857)

<div class="topic-metadata">

**Author:** [@klochner](https://www.ruby-forum.com/u/klochner)\
**Replies:** 5\
**Last updated:** [January 29, 2009, 9:34am UTC](https://www.ruby-forum.com/t/yield-vs-return/158857 "2009-01-29T09:34:21Z")

</div>

I couldn’t find any meaty discussions on this topic, so maybe it’s worth a post. Does it make sense to use yield at the end of a function, where you’re essentially using yield to replace a return value? For example: …

---

## [Rubygems and ~/.gem](https://www.ruby-forum.com/t/rubygems-and-gem/158899)

<div class="topic-metadata">

**Author:** [@mifi](https://www.ruby-forum.com/u/mifi)\
**Replies:** 1\
**Last updated:** [January 29, 2009, 6:31am UTC](https://www.ruby-forum.com/t/rubygems-and-gem/158899 "2009-01-29T06:31:45Z")

</div>

I’ve been very happy to see the latest improvments in rubygems regarding installation of both 1.9.1 and 1.8.x gems in my home directory, but there are still a few rough edges. I have not found any configuration to dis…

---

## [Studying the object model](https://www.ruby-forum.com/t/studying-the-object-model/158874)

<div class="topic-metadata">

**Author:** [@alby](https://www.ruby-forum.com/u/alby)\
**Replies:** 4\
**Last updated:** [January 29, 2009, 6:14am UTC](https://www.ruby-forum.com/t/studying-the-object-model/158874 "2009-01-29T06:14:12Z")

</div>

I’m looking for some study aid. I want to understand Ruby’s object model better. Is there some tool that takes some object as input and shows its inheritance chain, it’s instance and class variables, the singleton cl…

---

## [Database.yml file using JRuby](https://www.ruby-forum.com/t/database-yml-file-using-jruby/158895)

<div class="topic-metadata">

**Author:** [@Joseph\_A](https://www.ruby-forum.com/u/Joseph_A)\
**Replies:** 4\
**Last updated:** [January 29, 2009, 6:06am UTC](https://www.ruby-forum.com/t/database-yml-file-using-jruby/158895 "2009-01-29T06:06:00Z")

</div>

Just wondering what people do with their database.yml files in their Rails projects when using JRuby? Typically I put mine together like this: development: adapter: \<%= RUBY\_PLATFORM =~ /java/ ? ‘jdbc’ : ‘’ %\>mysql …

---

## [Bitwise question](https://www.ruby-forum.com/t/bitwise-question/158866)

<div class="topic-metadata">

**Author:** [@bfsog](https://www.ruby-forum.com/u/bfsog)\
**Replies:** 13\
**Last updated:** [January 29, 2009, 6:01am UTC](https://www.ruby-forum.com/t/bitwise-question/158866 "2009-01-29T06:01:53Z")

</div>

I’m working on a project that has a bitmap of permissions and I need to find out if a user has access. Given permissions bit mask of 0001C0200F02000000000 where each bit represents a specific permission And a request…

---

## [Funny Videos](https://www.ruby-forum.com/t/funny-videos/158893)

<div class="topic-metadata">

**Author:** [@mleczko](https://www.ruby-forum.com/u/mleczko)\
**Replies:** 0\
**Last updated:** [January 29, 2009, 5:15am UTC](https://www.ruby-forum.com/t/funny-videos/158893 "2009-01-29T05:15:37Z")

</div>

Free videos, humor, comedy, features to upload, share, rate and watch videos, comment on your favorites, www.cheezyclips.com

---

## [Search for string in folder names](https://www.ruby-forum.com/t/search-for-string-in-folder-names/158891)

<div class="topic-metadata">

**Author:** [@newb](https://www.ruby-forum.com/u/newb)\
**Replies:** 2\
**Last updated:** [January 29, 2009, 5:10am UTC](https://www.ruby-forum.com/t/search-for-string-in-folder-names/158891 "2009-01-29T05:10:21Z")

</div>

Hi … I will be getting some string through params\[:first\_name\].and i want to get that what are all the folders names contain that string. For example I have folders names like below each one is folder name remove…

---

## [Change Gempath at Runtime](https://www.ruby-forum.com/t/change-gempath-at-runtime/158887)

<div class="topic-metadata">

**Author:** [@michaelb](https://www.ruby-forum.com/u/michaelb)\
**Replies:** 2\
**Last updated:** [January 29, 2009, 2:57am UTC](https://www.ruby-forum.com/t/change-gempath-at-runtime/158887 "2009-01-29T02:57:44Z")

</div>

Hello, I have a problem with my host. I have several gems installed through cPanel and even directly using the ‘gem’ command, but my Ruby scripts can not locate them because apparently the Gem path is not correctly s…

---

## [Converting binary image file to bmp file using RMagick2.0](https://www.ruby-forum.com/t/converting-binary-image-file-to-bmp-file-using-rmagick2-0/158140)

<div class="topic-metadata">

**Author:** [@kamaljeetsinghsaini](https://www.ruby-forum.com/u/kamaljeetsinghsaini)\
**Replies:** 17\
**Last updated:** [January 29, 2009, 2:45am UTC](https://www.ruby-forum.com/t/converting-binary-image-file-to-bmp-file-using-rmagick2-0/158140 "2009-01-29T02:45:29Z")

</div>

We are trying to convert “image1.txt” file which is a binary file to “image1.bmp” file usng Ruby + RMagick2.0 but not able to get the required output that is “Menu.bmp”. Following the attached code that we have reache…

---

## [Rdoc\_chm 2.3.0 Released](https://www.ruby-forum.com/t/rdoc-chm-2-3-0-released/158886)

<div class="topic-metadata">

**Author:** [@miracleofmagick](https://www.ruby-forum.com/u/miracleofmagick)\
**Replies:** 0\
**Last updated:** [January 29, 2009, 1:53am UTC](https://www.ruby-forum.com/t/rdoc-chm-2-3-0-released/158886 "2009-01-29T01:53:09Z")

</div>

rdoc\_chm version 2.3.0 has been released! \<Project Page: http://rubyforge.org/projects/rdoc\> \<Documentation: http://rdoc.rubyforge.org/rdoc\_chm\> An unmaintained Microsoft Compiled HTML Help generator for RDoc. Change…

---

## [Rdoc\_html\_templates 2.3.0 Released](https://www.ruby-forum.com/t/rdoc-html-templates-2-3-0-released/158884)

<div class="topic-metadata">

**Author:** [@miracleofmagick](https://www.ruby-forum.com/u/miracleofmagick)\
**Replies:** 0\
**Last updated:** [January 29, 2009, 1:52am UTC](https://www.ruby-forum.com/t/rdoc-html-templates-2-3-0-released/158884 "2009-01-29T01:52:34Z")

</div>

rdoc\_html\_templates version 2.3.0 has been released! \<Project Page: http://rubyforge.org/projects/rdoc\> \<Documentation: http://rdoc.rubyforge.org/rdoc\_html\_templates\> Unmaintained templates for RDoc’s HTML generator. …

---

## [Rdoc 2.3.0 Released](https://www.ruby-forum.com/t/rdoc-2-3-0-released/158885)

<div class="topic-metadata">

**Author:** [@miracleofmagick](https://www.ruby-forum.com/u/miracleofmagick)\
**Replies:** 0\
**Last updated:** [January 29, 2009, 1:51am UTC](https://www.ruby-forum.com/t/rdoc-2-3-0-released/158885 "2009-01-29T01:51:24Z")

</div>

rdoc version 2.3.0 has been released! \<Project Page: http://rubyforge.org/projects/rdoc/\> \<Documentation: http://rdoc.rubyforge.org/\> RDoc is an application that produces documentation for one or more Ruby source fi…

---

## [JRuby-loaded JAR cannot access included JAR](https://www.ruby-forum.com/t/jruby-loaded-jar-cannot-access-included-jar/158882)

<div class="topic-metadata">

**Author:** [@k-risma](https://www.ruby-forum.com/u/k-risma)\
**Replies:** 0\
**Last updated:** [January 29, 2009, 1:38am UTC](https://www.ruby-forum.com/t/jruby-loaded-jar-cannot-access-included-jar/158882 "2009-01-29T01:38:32Z")

</div>

Hello, I’ve got a serious problem with JRuby. There is a program called SISSy in a sissy.jar that needs access to Java’s rt.jar. On a Mac, rt.jar is split up into classes.jar and ui.jar. These jar’s are already refe…

---

## [JRuby client for RabbitMQ](https://www.ruby-forum.com/t/jruby-client-for-rabbitmq/158880)

<div class="topic-metadata">

**Author:** [@ilan](https://www.ruby-forum.com/u/ilan)\
**Replies:** 1\
**Last updated:** [January 29, 2009, 1:31am UTC](https://www.ruby-forum.com/t/jruby-client-for-rabbitmq/158880 "2009-01-29T01:31:30Z")

</div>

My coworker Jerry wrote a client for the Erlang based RabbitMQ for JRuby. There’s a very specific use case why we needed this and couldn’t go with any of the other MQs … I just don’t remember what it is. At any rate…

---

## [Sys-proctable 0.8.0](https://www.ruby-forum.com/t/sys-proctable-0-8-0/158870)

<div class="topic-metadata">

**Author:** [@danielb](https://www.ruby-forum.com/u/danielb)\
**Replies:** 0\
**Last updated:** [January 28, 2009, 10:39pm UTC](https://www.ruby-forum.com/t/sys-proctable-0-8-0/158870 "2009-01-28T22:39:48Z")

</div>

Hi everyone, I’m happy to announce the release of sys-proctable 0.8.0. The sys-proctable library is a Ruby interface for getting at process table information. There are a lot of changes, but here are the highlights: …

---

## [\[annonce\] ffi-glpk extension demonstrator for jruby](https://www.ruby-forum.com/t/annonce-ffi-glpk-extension-demonstrator-for-jruby/158776)

<div class="topic-metadata">

**Author:** [@Diamantini\_Maurice](https://www.ruby-forum.com/u/Diamantini_Maurice)\
**Replies:** 2\
**Last updated:** [January 28, 2009, 10:26pm UTC](https://www.ruby-forum.com/t/annonce-ffi-glpk-extension-demonstrator-for-jruby/158776 "2009-01-28T22:26:55Z")

</div>

Bonjour à tous, I’m trying to test a new extension provide with jruby which allows to write a binding for a C library directly in ruby without writing a C line of code. This (ffi) extension is now part of the standar…

---

## [Keep getting "Missing these required gems" error but gems are installed](https://www.ruby-forum.com/t/keep-getting-missing-these-required-gems-error-but-gems-are-installed/157145)

<div class="topic-metadata">

**Author:** [@jeet](https://www.ruby-forum.com/u/jeet)\
**Replies:** 1\
**Last updated:** [January 28, 2009, 9:11pm UTC](https://www.ruby-forum.com/t/keep-getting-missing-these-required-gems-error-but-gems-are-installed/157145 "2009-01-28T21:11:08Z")

</div>

I just switched from jruby 1.1.3 to jruby 1.1.6 and I keep getting the error “Missing these required gems:” even after I have run the the command “jruby -S rake gems:install” and the all the needed config.gem entries …

---

## [\[annonce\] ffi-glpk extension demonstrator for jruby](https://www.ruby-forum.com/t/annonce-ffi-glpk-extension-demonstrator-for-jruby/158858)

<div class="topic-metadata">

**Author:** [@Diamantini\_Maurice](https://www.ruby-forum.com/u/Diamantini_Maurice)\
**Replies:** 0\
**Last updated:** [January 28, 2009, 9:08pm UTC](https://www.ruby-forum.com/t/annonce-ffi-glpk-extension-demonstrator-for-jruby/158858 "2009-01-28T21:08:07Z")

</div>

Le 27 janv. 09 à 22:24, Yaron Kretchmer a écrit : Maurice- Will that work with Ruby MRI as well? Thanks Yaron I should (or will)! But ffi is an edge extension and some low level API still evolve. I try it with …

---

## [MiniTest & Test::Unit::TestResult in Ruby 1.9.1](https://www.ruby-forum.com/t/minitest-test-testresult-in-ruby-1-9-1/158835)

<div class="topic-metadata">

**Author:** [@noagenda](https://www.ruby-forum.com/u/noagenda)\
**Replies:** 3\
**Last updated:** [January 28, 2009, 9:00pm UTC](https://www.ruby-forum.com/t/minitest-test-testresult-in-ruby-1-9-1/158835 "2009-01-28T21:00:26Z")

</div>

It looks like Test::Unit::TestResult \[1\] has disappeared in Ruby 1.9.1. Is this correct? In fact, it looks like requiring ‘test/unit’ now just gets you a thin wrapper around MiniTest. Is this correct? In Mocha’s ac…

---

## [Jruby error in installation](https://www.ruby-forum.com/t/jruby-error-in-installation/157873)

<div class="topic-metadata">

**Author:** [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Replies:** 1\
**Last updated:** [January 28, 2009, 8:49pm UTC](https://www.ruby-forum.com/t/jruby-error-in-installation/157873 "2009-01-28T20:49:47Z")

</div>

Hello! I am on Mac OS 10.5 (Leopard). All I have done is this; I downloaded jruby-bin-1.1.6.tar, untarred it to JRuby-1.1.6, and then went into …/JRuby-1.1.6/bin/ and ran ./jruby -v Both with and without -v gives thi…

---

## [Defining an ActiveRecord class within a method of another class](https://www.ruby-forum.com/t/defining-an-activerecord-class-within-a-method-of-another-class/158823)

<div class="topic-metadata">

**Author:** [@glenn](https://www.ruby-forum.com/u/glenn)\
**Replies:** 4\
**Last updated:** [January 28, 2009, 8:09pm UTC](https://www.ruby-forum.com/t/defining-an-activerecord-class-within-a-method-of-another-class/158823 "2009-01-28T20:09:23Z")

</div>

Hi, I want to create a class and define a subclass of ActiveRecord within that class, like this: class Results def initialize(db) class db \< ActiveRecord::Base end end end r1 = Results.new(‘DM’) r2 = Results.ne…

---

## [Super User Can't Change UID?](https://www.ruby-forum.com/t/super-user-cant-change-uid/158788)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 13\
**Last updated:** [January 28, 2009, 8:09pm UTC](https://www.ruby-forum.com/t/super-user-cant-change-uid/158788 "2009-01-28T20:09:04Z")

</div>

Why would the super user not be able to switch UID’s? $ sudo ruby -r etc -e ‘Process.uid = Etc.getpwnam(“james”).uid’ Password: -e:1:in \`uid=’: Operation not permitted (Errno::EPERM) from -e:1 Tips of TFM I should g…

---

## [Scope resolution operator](https://www.ruby-forum.com/t/scope-resolution-operator/158570)

<div class="topic-metadata">

**Author:** [@dewie](https://www.ruby-forum.com/u/dewie)\
**Replies:** 4\
**Last updated:** [January 28, 2009, 8:07pm UTC](https://www.ruby-forum.com/t/scope-resolution-operator/158570 "2009-01-28T20:07:54Z")

</div>

(The code I will demonstrate is Rails-based, but the question is Ruby-based.) I’m familiar with the following: ActiveRecord::Base Basically says, look inside ActiveRecord for a class or module named Base. But what …

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

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