# Ruby

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

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

---

## [Interacting with other programs](https://www.ruby-forum.com/t/interacting-with-other-programs/193768)

<div class="topic-metadata">

**Author:** [@braas](https://www.ruby-forum.com/u/braas)\
**Replies:** 1\
**Last updated:** [August 24, 2010, 3:22pm UTC](https://www.ruby-forum.com/t/interacting-with-other-programs/193768 "2010-08-24T15:22:33Z")

</div>

Is it possible to make some kind of program hook in ruby, so I can have the program in question send it’s calls to my ruby script first, and then have ruby forward them to the program? If so, please throw me a link wh…

---

## [Rail3 and rake](https://www.ruby-forum.com/t/rail3-and-rake/193793)

<div class="topic-metadata">

**Author:** [@msan](https://www.ruby-forum.com/u/msan)\
**Replies:** 2\
**Last updated:** [August 24, 2010, 1:42pm UTC](https://www.ruby-forum.com/t/rail3-and-rake/193793 "2010-08-24T13:42:25Z")

</div>

I’m trying rails 3. I’ve installed postgres jdbc adapter, run jruby -S rails new myapp -m http://jruby.org/rails3.rb and it’s ok. Then jruby -S rake -T and I have this error: Could not find gem ‘jdbc-sqlite3 (\>= 0, r…

---

## [Assert "foo"!= "foo"\[3,1\]...revisited](https://www.ruby-forum.com/t/assert-foo-foo-3-1-revisited/193721)

<div class="topic-metadata">

**Author:** [@timr](https://www.ruby-forum.com/u/timr)\
**Replies:** 6\
**Last updated:** [August 24, 2010, 1:21pm UTC](https://www.ruby-forum.com/t/assert-foo-foo-3-1-revisited/193721 "2010-08-24T13:21:20Z")

</div>

consider the following irb session; “foo”\[0\] =\> “f” “foo”\[1\] =\> “o” “foo”\[2\] =\> “o” “foo”\[3\] =\> nil “foo”\[4\] =\> nil “foo”\[0,3\] =\> “foo” “foo”\[1,3\] =\> “oo” “foo”\[2,3\] =\> “o” #note the fo…

---

## [Rails3, jruby and jdbc](https://www.ruby-forum.com/t/rails3-jruby-and-jdbc/193792)

<div class="topic-metadata">

**Author:** [@msan](https://www.ruby-forum.com/u/msan)\
**Replies:** 0\
**Last updated:** [August 24, 2010, 1:03pm UTC](https://www.ruby-forum.com/t/rails3-jruby-and-jdbc/193792 "2010-08-24T13:03:11Z")

</div>

If I undestand well, to create a new application using jdbc drivers with rails 3 I need to launch jruby -S rails new myapp -m http://jruby.org/rails3.rb, as I read in http://jruby-extras.rubyforge.org/activerecord-jdb…

---

## [YAML::dump slow](https://www.ruby-forum.com/t/yaml-dump-slow/193669)

<div class="topic-metadata">

**Author:** [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Replies:** 8\
**Last updated:** [August 24, 2010, 10:09am UTC](https://www.ruby-forum.com/t/yaml-dump-slow/193669 "2010-08-24T10:09:53Z")

</div>

This is interesting and counterintuitive … I am creating a YAML file with about 200,000 entries. The YAML file “reflects” the data structure of a directory tree of a disk. All I have is directory names and subdire…

---

## [Looking for a file somewhere in a directory recursively](https://www.ruby-forum.com/t/looking-for-a-file-somewhere-in-a-directory-recursively/193730)

<div class="topic-metadata">

**Author:** [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Replies:** 5\
**Last updated:** [August 24, 2010, 9:13am UTC](https://www.ruby-forum.com/t/looking-for-a-file-somewhere-in-a-directory-recursively/193730 "2010-08-24T09:13:40Z")

</div>

Assume I have a file pattern temp\*.bat Assume I have a directory d:\\XXX and that I want to find all instances using Windows’ file matching mechanisms rather than than Ruby regular expressions or the functionality of…

---

## [CodeSnipr Learning can be simple!](https://www.ruby-forum.com/t/codesnipr-learning-can-be-simple/193687)

<div class="topic-metadata">

**Author:** [@bapi](https://www.ruby-forum.com/u/bapi)\
**Replies:** 1\
**Last updated:** [August 24, 2010, 6:48am UTC](https://www.ruby-forum.com/t/codesnipr-learning-can-be-simple/193687 "2010-08-24T06:48:04Z")

</div>

Hi, All the group members right at here, we people recently lunched a website CodeSnipr based on Computer language like (PHP, RUBBY, HTML, CSS, MYSQL, JQURY, IPHONE DEVELOPMENT, JAVASCRIPT, C++,.NET,XML,C# etc.). Cod…

---

## [(How) Can you run another ruby script, from a ruby script?](https://www.ruby-forum.com/t/how-can-you-run-another-ruby-script-from-a-ruby-script/193558)

<div class="topic-metadata">

**Author:** [@3lionz](https://www.ruby-forum.com/u/3lionz)\
**Replies:** 2\
**Last updated:** [August 24, 2010, 6:27am UTC](https://www.ruby-forum.com/t/how-can-you-run-another-ruby-script-from-a-ruby-script/193558 "2010-08-24T06:27:49Z")

</div>

Sorry for the newbie question, but Can you run another ruby script, from a ruby script? For example: #makes new .rb script f = File.open(‘test.rb’, ‘w+’) f.write(“puts ‘Hello world’ sleep 5 # seconds”) f.close #r…

---

## [Your thoughts on #memo?](https://www.ruby-forum.com/t/your-thoughts-on-memo/193733)

<div class="topic-metadata">

**Author:** [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Replies:** 7\
**Last updated:** [August 24, 2010, 3:52am UTC](https://www.ruby-forum.com/t/your-thoughts-on-memo/193733 "2010-08-24T03:52:19Z")

</div>

Like to get some thoughts on the following technique for memoization: Memoize a method. class MemoExample attr\_accessor :a def m memo{ @a } end end ex = MemoExample.new ex.a = 10 ex.m #=\> 10 ex.a = 20 ex.m #=\> 10 …

---

## [\[Feature #3649\] Array#sample, Array#shuffle, Array#shuffle! $B$G;HMQ$9$kMp?t@8@.4o$r;XDj$9$k$?$a$K%](https://www.ruby-forum.com/t/feature-3649-array-sample-array-shuffle-array-shuffle-b-g-hmq-9-kmp-t-8-4o-r-xdj-9-k-a-k/192634)

<div class="topic-metadata">

**Author:** [@Kenta\_M](https://www.ruby-forum.com/u/Kenta_M)\
**Replies:** 1\
**Last updated:** [August 24, 2010, 12:21am UTC](https://www.ruby-forum.com/t/feature-3649-array-sample-array-shuffle-array-shuffle-b-g-hmq-9-kmp-t-8-4o-r-xdj-9-k-a-k/192634 "2010-08-24T00:21:33Z")

</div>

Feature #3649: Array#sample, Array#shuffle, Array#shuffle! e$B$G;HMQ$9$kMp?t@8@.4o$r;XDj$9$k$?$a$K%\*%W%7%g%J%k0z?t$rDI2C$9$ke(B http://redmine.ruby-lang.org/issues/show/3649 e$B5/I\<\<Te(B: Kenta M. e$B%9%F!\<%?%9e(B: O…

---

## [Case and class](https://www.ruby-forum.com/t/case-and-class/193648)

<div class="topic-metadata">

**Author:** [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Replies:** 8\
**Last updated:** [August 24, 2010, 12:12am UTC](https://www.ruby-forum.com/t/case-and-class/193648 "2010-08-24T00:12:11Z")

</div>

Why does “YYY” get printed out here? class XXX end x = XXX.new case x.class when XXX puts “XXX” else puts “YYY” # surprise! end

---

## [JRuby Rcov and Rspec problem](https://www.ruby-forum.com/t/jruby-rcov-and-rspec-problem/193762)

<div class="topic-metadata">

**Author:** [@Benyi\_W](https://www.ruby-forum.com/u/Benyi_W)\
**Replies:** 0\
**Last updated:** [August 24, 2010, 12:02am UTC](https://www.ruby-forum.com/t/jruby-rcov-and-rspec-problem/193762 "2010-08-24T00:02:13Z")

</div>

When I run Rcov using JRuby, the Rcov report always includes some libraries. JRuby 1.5.1 rcov 0.9.8 rspec 1.3.0 ci\_reporter 1.6.2 Here is my Rake file. require ‘rake’ require ‘spec/rake/spectask’ require ‘ci/rep…

---

## [Oracle proc : ArgumentError (interning empty string)](https://www.ruby-forum.com/t/oracle-proc-argumenterror-interning-empty-string/193758)

<div class="topic-metadata">

**Author:** [@sharnel](https://www.ruby-forum.com/u/sharnel)\
**Replies:** 0\
**Last updated:** [August 23, 2010, 11:41pm UTC](https://www.ruby-forum.com/t/oracle-proc-argumenterror-interning-empty-string/193758 "2010-08-23T23:41:36Z")

</div>

Hi, I am trying to access oracle proc. Code as below : require “ruby-plsql” OracleConnection.establish\_connection “oracle\_#{RAILS\_ENV}” plsql.connection = OracleConnection.connection.raw\_connection.connection curs…

---

## [\[Bug #3703\] ChangeLog too big](https://www.ruby-forum.com/t/bug-3703-changelog-too-big/193416)

<div class="topic-metadata">

**Author:** [@Shyouhei\_U](https://www.ruby-forum.com/u/Shyouhei_U)\
**Replies:** 1\
**Last updated:** [August 23, 2010, 11:07pm UTC](https://www.ruby-forum.com/t/bug-3703-changelog-too-big/193416 "2010-08-23T23:07:47Z")

</div>

Bug #3703: ChangeLog too big. http://redmine.ruby-lang.org/issues/show/3703 e$B5/I\<\<Te(B: Shyouhei U. e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal e$B%+%F%4%je(B: doc ruby -v: ruby 1.9.3dev (2010-08-16 trunk 29000) …

---

## [Class initialization](https://www.ruby-forum.com/t/class-initialization/193728)

<div class="topic-metadata">

**Author:** [@swengineer](https://www.ruby-forum.com/u/swengineer)\
**Replies:** 6\
**Last updated:** [August 23, 2010, 10:50pm UTC](https://www.ruby-forum.com/t/class-initialization/193728 "2010-08-23T22:50:47Z")

</div>

This is an example similar to the one here: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/56755 class Foo def initialize @var = “var” end def to\_s “This is a customized string” end end var = Foo.…

---

## [=== is not a symmetric operator?](https://www.ruby-forum.com/t/is-not-a-symmetric-operator/193727)

<div class="topic-metadata">

**Author:** [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Replies:** 5\
**Last updated:** [August 23, 2010, 5:30pm UTC](https://www.ruby-forum.com/t/is-not-a-symmetric-operator/193727 "2010-08-23T17:30:28Z")

</div>

Is my understanding correct that === is not a symmetric operator? That, in fact, X === x and x === X mean different things? irb(main):001:0\> class X irb(main):002:1\> end =\> nil irb(main):003:0\> x = X.new =\> #\<…

---

## [Directory listing without . and](https://www.ruby-forum.com/t/directory-listing-without-and/193716)

<div class="topic-metadata">

**Author:** [@raj\_plays](https://www.ruby-forum.com/u/raj_plays)\
**Replies:** 10\
**Last updated:** [August 23, 2010, 5:12pm UTC](https://www.ruby-forum.com/t/directory-listing-without-and/193716 "2010-08-23T17:12:54Z")

</div>

Hi, How can I get an array of all legitimate sub directories in the current directory? path = “D:/Traffic” Dir.chdir(path) This gives 2 extra entries “.” and “…” Dir.open(stationDir).entries.reject{|f| File.file?(f…

---

## [\[Bug #3706\] dependency from version.o to version.h](https://www.ruby-forum.com/t/bug-3706-dependency-from-version-o-to-version-h/193466)

<div class="topic-metadata">

**Author:** [@Yuki\_S](https://www.ruby-forum.com/u/Yuki_S)\
**Replies:** 2\
**Last updated:** [August 23, 2010, 3:37pm UTC](https://www.ruby-forum.com/t/bug-3706-dependency-from-version-o-to-version-h/193466 "2010-08-23T15:37:26Z")

</div>

Bug #3706: dependency from version.o to version.h http://redmine.ruby-lang.org/issues/show/3706 e$B5/I\<\<Te(B: Yuki S. e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal e$B%+%F%4%je(B: build, Target version: 1.9.2 ruby -v…

---

## [Feature request: package jruby-openssl gem](https://www.ruby-forum.com/t/feature-request-package-jruby-openssl-gem/192808)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 15\
**Last updated:** [August 23, 2010, 3:32pm UTC](https://www.ruby-forum.com/t/feature-request-package-jruby-openssl-gem/192808 "2010-08-23T15:32:44Z")

</div>

Currently seeing the message “warning, you do not have the jruby-openssl gem installed” every time you use jruby to do a gem installation leaves a feeling of…hackishness. Suggestion: since ruby-debug, rake, et all, ar…

---

## [RubyInstaller 1.9.2-p0 released - Newer DevKit and instructions](https://www.ruby-forum.com/t/rubyinstaller-1-9-2-p0-released-newer-devkit-and-instructions/193653)

<div class="topic-metadata">

**Author:** [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Replies:** 7\
**Last updated:** [August 23, 2010, 3:29pm UTC](https://www.ruby-forum.com/t/rubyinstaller-1-9-2-p0-released-newer-devkit-and-instructions/193653 "2010-08-23T15:29:36Z")

</div>

Hello, I’m very pleased to announce the release of RubyInstaller packages for Ruby 1.9.2-p0. As usual, installer and 7z-packages are available at RubyInstaller website and RubyForge for download: http://rubyforge.…

---

## [When test just can't be automated](https://www.ruby-forum.com/t/when-test-just-cant-be-automated/193548)

<div class="topic-metadata">

**Author:** [@fourchette](https://www.ruby-forum.com/u/fourchette)\
**Replies:** 3\
**Last updated:** [August 23, 2010, 11:01am UTC](https://www.ruby-forum.com/t/when-test-just-cant-be-automated/193548 "2010-08-23T11:01:06Z")

</div>

hi there, i do hope i’m posting at the right place. I am supposed to test some sort of a network device let’s say. i want to do it with ruby unit testing framework. Basically you can send it commands using TCP/IP in …

---

## [Convert 125% into 1.25?](https://www.ruby-forum.com/t/convert-125-into-1-25/193656)

<div class="topic-metadata">

**Author:** [@luofeiyu](https://www.ruby-forum.com/u/luofeiyu)\
**Replies:** 8\
**Last updated:** [August 23, 2010, 9:23am UTC](https://www.ruby-forum.com/t/convert-125-into-1-25/193656 "2010-08-23T09:23:20Z")

</div>

irb(main):011:0\> format("%.2f",125) =\> “125.00” irb(main):012:0\> format("%.2f",125%) SyntaxError: compile error (irb):12: syntax error, unexpected ‘)’

---

## [Stripping whitespace while reading CSV](https://www.ruby-forum.com/t/stripping-whitespace-while-reading-csv/193645)

<div class="topic-metadata">

**Author:** [@fearless\_fool](https://www.ruby-forum.com/u/fearless_fool)\
**Replies:** 1\
**Last updated:** [August 23, 2010, 8:06am UTC](https://www.ruby-forum.com/t/stripping-whitespace-while-reading-csv/193645 "2010-08-23T08:06:24Z")

</div>

I’m perplexed over what ought to be a simple CSV question: can you ask CSV to strip whitespace from individual cells as it reads? The following works, but is it the approved idiom? CSV.parse(s).each {|row| row.each {…

---

## [Initializer script is interfering with rake db:migrate](https://www.ruby-forum.com/t/initializer-script-is-interfering-with-rake-db-migrate/193717)

<div class="topic-metadata">

**Author:** [@soderic](https://www.ruby-forum.com/u/soderic)\
**Replies:** 3\
**Last updated:** [August 23, 2010, 7:35am UTC](https://www.ruby-forum.com/t/initializer-script-is-interfering-with-rake-db-migrate/193717 "2010-08-23T07:35:04Z")

</div>

Hi all, I’m using an initializer script in config/intializers/my\_script.rb to initialize the database through an xml configuration file. I’m using JAXB to create the xml bindings and unmarshal the xml information. Ev…

---

## [\[Bug #3459\]\[Closed\] test\_regexp.rb Segmentation fault on x64-mswin64](https://www.ruby-forum.com/t/bug-3459-closed-test-regexp-rb-segmentation-fault-on-x64-mswin64/193715)

<div class="topic-metadata">

**Author:** [@Yui\_NARUSE](https://www.ruby-forum.com/u/Yui_NARUSE)\
**Replies:** 0\
**Last updated:** [August 23, 2010, 5:37am UTC](https://www.ruby-forum.com/t/bug-3459-closed-test-regexp-rb-segmentation-fault-on-x64-mswin64/193715 "2010-08-23T05:37:25Z")

</div>

e$B%A%1%C%He(B #3459 e$B$,99?7$5$l$^$7$?!#e(B (by Yui NARUSE) e$B%9%F!\<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B This issue was solved with changeset r29074. shintaro, thank you…

---

## [Extract domain name](https://www.ruby-forum.com/t/extract-domain-name/193587)

<div class="topic-metadata">

**Author:** [@cmcfab](https://www.ruby-forum.com/u/cmcfab)\
**Replies:** 5\
**Last updated:** [August 23, 2010, 5:36am UTC](https://www.ruby-forum.com/t/extract-domain-name/193587 "2010-08-23T05:36:15Z")

</div>

All, I have the same basic issue as discussed in this thread last year: http://groups.google.com/group/comp.lang.ruby/browse\_thread/thread/77cfd3250a633c7e/0430f50818a01ddd. Justin C. points out the greatest difficult…

---

## [Ocra chat list?; Ocra crashes; Subclassing String](https://www.ruby-forum.com/t/ocra-chat-list-ocra-crashes-subclassing-string/193684)

<div class="topic-metadata">

**Author:** [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Replies:** 4\
**Last updated:** [August 23, 2010, 3:49am UTC](https://www.ruby-forum.com/t/ocra-chat-list-ocra-crashes-subclassing-string/193684 "2010-08-23T03:49:44Z")

</div>

Is there an active OCRA chat list? When I use OCRA to create an executable, the executable crashes before the first puts is executed. I tentatively have isolated the problem to subclassing String. … class Path…

---

## [Module and protected/private functions](https://www.ruby-forum.com/t/module-and-protected-private-functions/193690)

<div class="topic-metadata">

**Author:** [@trapper](https://www.ruby-forum.com/u/trapper)\
**Replies:** 1\
**Last updated:** [August 23, 2010, 12:03am UTC](https://www.ruby-forum.com/t/module-and-protected-private-functions/193690 "2010-08-23T00:03:46Z")

</div>

Is it possible to declare parts of a module as private or protected to import these properties via mixin into classes?

---

## [YAML Bug - can't round-trip a hash value with leading newlines](https://www.ruby-forum.com/t/yaml-bug-cant-round-trip-a-hash-value-with-leading-newlines/193339)

<div class="topic-metadata">

**Author:** [@dasch](https://www.ruby-forum.com/u/dasch)\
**Replies:** 3\
**Last updated:** [August 22, 2010, 10:47pm UTC](https://www.ruby-forum.com/t/yaml-bug-cant-round-trip-a-hash-value-with-leading-newlines/193339 "2010-08-22T22:47:40Z")

</div>

YAML can’t round-trip the hash: {“default”=\>"\\r\\n Monkey \\r\\nX"}. Shouldn’t yaml use the escaped string format for any string that starts with whitespace, ie, yaml = “— \\ndefault: “\\r\\n Monkey \\r\\nX”” p YAML.load(y…

---

## [\[Bug #3734\] Float('0xf.fp') $B$,%(%i!\<$K$J$i$J$$(B](https://www.ruby-forum.com/t/bug-3734-float-0xf-fp-b-i-k-j-i-j-b/193700)

<div class="topic-metadata">

**Author:** [@tadayoshi\_funaba](https://www.ruby-forum.com/u/tadayoshi_funaba)\
**Replies:** 0\
**Last updated:** [August 22, 2010, 5:53pm UTC](https://www.ruby-forum.com/t/bug-3734-float-0xf-fp-b-i-k-j-i-j-b/193700 "2010-08-22T17:53:15Z")

</div>

Bug #3734: Float(‘0xf.fp’) e$B$,%(%i!\<$K$J$i$J$$e(B http://redmine.ruby-lang.org/issues/show/3734 e$B5/I\<\<Te(B: tadayoshi funaba e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal ruby -v: ruby 1.9.3dev (2010-08-22 trunk 2…

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

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