# Ruby

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

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

---

## [\[ANN\] Ruby draft specification](https://www.ruby-forum.com/t/ann-ruby-draft-specification/179649)

<div class="topic-metadata">

**Author:** [@Shugo\_M](https://www.ruby-forum.com/u/Shugo_M)\
**Replies:** 6\
**Last updated:** [December 2, 2009, 5:45am UTC](https://www.ruby-forum.com/t/ann-ruby-draft-specification/179649 "2009-12-02T05:45:09Z")

</div>

Hello, The first version of the draft specification of Ruby has been released at the following site. http://ruby-std.netlab.jp/ The following is a messsage from Ikuo Nakata, who is the chairman of the IPA Ruby Stand…

---

## [Float Arithmetic: Return A Fixnum When Float == Fixnum](https://www.ruby-forum.com/t/float-arithmetic-return-a-fixnum-when-float-fixnum/179655)

<div class="topic-metadata">

**Author:** [@MaggotChild](https://www.ruby-forum.com/u/MaggotChild)\
**Replies:** 6\
**Last updated:** [December 2, 2009, 5:30am UTC](https://www.ruby-forum.com/t/float-arithmetic-return-a-fixnum-when-float-fixnum/179655 "2009-12-02T05:30:31Z")

</div>

j = 5/2.0 =\> 2.5 I’m fine with this j = 4/2.0 =\> 2.0 Useless precision -for me. I want 2! j == j.to\_i ? j.to\_i : j =\> 2 Is there a “better” way?

---

## [Hangman Help](https://www.ruby-forum.com/t/hangman-help/179693)

<div class="topic-metadata">

**Author:** [@jovijunki](https://www.ruby-forum.com/u/jovijunki)\
**Replies:** 1\
**Last updated:** [December 2, 2009, 5:10am UTC](https://www.ruby-forum.com/t/hangman-help/179693 "2009-12-02T05:10:37Z")

</div>

How do I print the dashes and letters to represent the word to be guessed. The letters guessed by the player are properly put into the respective arrays. Whatever I try to do I either get all dashes back or the whole…

---

## [Xdg 1.0](https://www.ruby-forum.com/t/xdg-1-0/179691)

<div class="topic-metadata">

**Author:** [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Replies:** 0\
**Last updated:** [December 2, 2009, 3:55am UTC](https://www.ruby-forum.com/t/xdg-1-0/179691 "2009-12-02T03:55:07Z")

</div>

I released a new version of XDG this evening. This is a significant release b/c it changes the API. Instead of: XDG.config\_dirs You now use: XDG.config.dirs or more directly: XDG::Config.dirs See http://rubyworks…

---

## [Code Review: NewSuper6](https://www.ruby-forum.com/t/code-review-newsuper6/179689)

<div class="topic-metadata">

**Author:** [@grujildo](https://www.ruby-forum.com/u/grujildo)\
**Replies:** 0\
**Last updated:** [December 2, 2009, 3:06am UTC](https://www.ruby-forum.com/t/code-review-newsuper6/179689 "2009-12-02T03:06:31Z")

</div>

tfpt review “/shelveset:NewSuper6;REDMOND\\tomat” Comment : Implements missing super-call features (super with implicit arguments in eval), fixes bugs, improves super site caching and removes helpers with “out” param…

---

## [Regexing a file's contents without reading the whole thing?](https://www.ruby-forum.com/t/regexing-a-files-contents-without-reading-the-whole-thing/179628)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 3\
**Last updated:** [December 2, 2009, 2:33am UTC](https://www.ruby-forum.com/t/regexing-a-files-contents-without-reading-the-whole-thing/179628 "2009-12-02T02:33:45Z")

</div>

I see that it is possible currently to parse through a file without reading the whole thing into RAM, a la a = File.open(‘a’, ‘r’) a.lines{|line| if line =~ /some regex/ … end } But what if I can to do something …

---

## [MySQL connection extremely slow to respond after firewall disconnect](https://www.ruby-forum.com/t/mysql-connection-extremely-slow-to-respond-after-firewall-disconnect/179576)

<div class="topic-metadata">

**Author:** [@Mark\_Westling](https://www.ruby-forum.com/u/Mark_Westling)\
**Replies:** 2\
**Last updated:** [December 2, 2009, 2:04am UTC](https://www.ruby-forum.com/t/mysql-connection-extremely-slow-to-respond-after-firewall-disconnect/179576 "2009-12-02T02:04:30Z")

</div>

I’m running into a problem with a RoR application (using glassfish v3 gem) that seems to be related to a firewall disconnecting inactive MySQL connections. For the first request after a long period of inactivity, gla…

---

## [Why\_sandbox 1.9 support](https://www.ruby-forum.com/t/why-sandbox-1-9-support/179683)

<div class="topic-metadata">

**Author:** [@andrew\_mcelroy](https://www.ruby-forum.com/u/andrew_mcelroy)\
**Replies:** 0\
**Last updated:** [December 1, 2009, 9:18pm UTC](https://www.ruby-forum.com/t/why-sandbox-1-9-support/179683 "2009-12-01T21:18:20Z")

</div>

Greetings, I have begun the process of taking why’s freaky freaky sandbox code and updating the c extensions in it to compile for ruby 1.9.1. It appears, looking through Google cache that why apparently had started w…

---

## [Class variables, instance variables, singleton; Ruby v. C++](https://www.ruby-forum.com/t/class-variables-instance-variables-singleton-ruby-v-c/179542)

<div class="topic-metadata">

**Author:** [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Replies:** 30\
**Last updated:** [December 1, 2009, 7:52pm UTC](https://www.ruby-forum.com/t/class-variables-instance-variables-singleton-ruby-v-c/179542 "2009-12-01T19:52:52Z")

</div>

Newb here coming from C++ Ok, I think I know what a class variable is. It is similar to a static variable in a class in C++. Rght? An instance variable is apart of an instantiated class, right? What’s a singleton? …

---

## [Problem trying to get a constant with correct scope](https://www.ruby-forum.com/t/problem-trying-to-get-a-constant-with-correct-scope/179632)

<div class="topic-metadata">

**Author:** [@alexandremutel](https://www.ruby-forum.com/u/alexandremutel)\
**Replies:** 10\
**Last updated:** [December 1, 2009, 7:32pm UTC](https://www.ruby-forum.com/t/problem-trying-to-get-a-constant-with-correct-scope/179632 "2009-12-01T19:32:45Z")

</div>

I’m trying to get a constant inside a class (but i have to do it outside the declaration) module A class B end class C end end How to get constant B from inside C but executed from outside first declaration? Af…

---

## [ANN: Sequel 3.7.0 Released](https://www.ruby-forum.com/t/ann-sequel-3-7-0-released/179678)

<div class="topic-metadata">

**Author:** [@nerdmaster](https://www.ruby-forum.com/u/nerdmaster)\
**Replies:** 3\
**Last updated:** [December 1, 2009, 6:43pm UTC](https://www.ruby-forum.com/t/ann-sequel-3-7-0-released/179678 "2009-12-01T18:43:15Z")

</div>

Sequel is a lightweight database access toolkit for Ruby. Sequel provides thread safety, connection pooling and a concise DSL for constructing database queries and table schemas. Sequel also includes a lightweight but…

---

## [How to use "eval" to create method parameters?](https://www.ruby-forum.com/t/how-to-use-eval-to-create-method-parameters/179660)

<div class="topic-metadata">

**Author:** [@ISSSSaki\_Baz\_C](https://www.ruby-forum.com/u/ISSSSaki_Baz_C)\
**Replies:** 3\
**Last updated:** [December 1, 2009, 4:58pm UTC](https://www.ruby-forum.com/t/how-to-use-eval-to-create-method-parameters/179660 "2009-12-01T16:58:27Z")

</div>

Hi, let’s imagine a method “my\_method()” whic allows any number of parameters. And I need to create those parameters list in the following way: lalalala = false if lalalala params = “:user, ‘alice’, 1456” else par…

---

## [\[ANN\] Trinidad 0.7.0 allows to run several Rails application into a single Tomcat container](https://www.ruby-forum.com/t/ann-trinidad-0-7-0-allows-to-run-several-rails-application-into-a-single-tomcat-container/179671)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 0\
**Last updated:** [December 1, 2009, 4:50pm UTC](https://www.ruby-forum.com/t/ann-trinidad-0-7-0-allows-to-run-several-rails-application-into-a-single-tomcat-container/179671 "2009-12-01T16:50:15Z")

</div>

Trinidad is a library that allows to run Rails and Rack compatible applications within a single Tomcat container without use war files. I don’t usually write this kind of mails but someone in the #jruby channel told …

---

## [Could you please teach a canonical style for writing the IronRuby hosting code](https://www.ruby-forum.com/t/could-you-please-teach-a-canonical-style-for-writing-the-ironruby-hosting-code/179583)

<div class="topic-metadata">

**Author:** [@SSSBSOS7SbSHS1SsSSS](https://www.ruby-forum.com/u/SSSBSOS7SbSHS1SsSSS)\
**Replies:** 3\
**Last updated:** [December 1, 2009, 3:44pm UTC](https://www.ruby-forum.com/t/could-you-please-teach-a-canonical-style-for-writing-the-ironruby-hosting-code/179583 "2009-12-01T15:44:42Z")

</div>

Hello, I’m kenichi hashimoto. I’m a Japanese. I don’t write english well. Now I have a question about a canonical style for writing the IronRuby hosting code. \[BACKGROUND\] Now, I’m tring to host the IronRuby 1.0RC o…

---

## [One more regular expression, please](https://www.ruby-forum.com/t/one-more-regular-expression-please/179640)

<div class="topic-metadata">

**Author:** [@j-merrill](https://www.ruby-forum.com/u/j-merrill)\
**Replies:** 7\
**Last updated:** [December 1, 2009, 2:47pm UTC](https://www.ruby-forum.com/t/one-more-regular-expression-please/179640 "2009-12-01T14:47:55Z")

</div>

Hi, I really can’t figure out how regular expressions work, and since I don’t use them frequently is easier to ask… I have the follwow string ++((100))++askjasdjksjdkasdkjk++((200))++skdjsjd I need a reg expression …

---

## [How do you get the tail end of a string?](https://www.ruby-forum.com/t/how-do-you-get-the-tail-end-of-a-string/178172)

<div class="topic-metadata">

**Author:** [@maz](https://www.ruby-forum.com/u/maz)\
**Replies:** 54\
**Last updated:** [December 1, 2009, 1:14pm UTC](https://www.ruby-forum.com/t/how-do-you-get-the-tail-end-of-a-string/178172 "2009-12-01T13:14:52Z")

</div>

I’m actually hoping this is an embarrassing question but how do you get the tail end of a string? All I’ve figured out is this: index = 4 string\[index, string.size - index\] ...but surely there's a better way. This …

---

## [Detect the path used to require a file?](https://www.ruby-forum.com/t/detect-the-path-used-to-require-a-file/179634)

<div class="topic-metadata">

**Author:** [@kuma](https://www.ruby-forum.com/u/kuma)\
**Replies:** 2\
**Last updated:** [December 1, 2009, 9:54am UTC](https://www.ruby-forum.com/t/detect-the-path-used-to-require-a-file/179634 "2009-12-01T09:54:42Z")

</div>

Hi all, I’m having a problem in which a file is being required twice, using slightly different paths, and I want to track down where this is happening. Is there a way I can print out the path used to require a given…

---

## [Pell's equation solver in Ruby](https://www.ruby-forum.com/t/pells-equation-solver-in-ruby/179654)

<div class="topic-metadata">

**Author:** [@Takeshi\_NISHIMATSU](https://www.ruby-forum.com/u/Takeshi_NISHIMATSU)\
**Replies:** 0\
**Last updated:** [December 1, 2009, 9:38am UTC](https://www.ruby-forum.com/t/pells-equation-solver-in-ruby/179654 "2009-12-01T09:38:19Z")

</div>

Here is my “Pell’s equation solver in Ruby”. Can you make it shorter or faster? $ time ruby pell.rb 1 2 3 2 3 2 1 4 5 9 4 : 998 984076901 31150410 999 102688615 3248924 1000 39480499 1248483 real 0m5.415s …

---

## [Testing rails application](https://www.ruby-forum.com/t/testing-rails-application/179647)

<div class="topic-metadata">

**Author:** [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Replies:** 1\
**Last updated:** [December 1, 2009, 9:09am UTC](https://www.ruby-forum.com/t/testing-rails-application/179647 "2009-12-01T09:09:16Z")

</div>

Hey champs, Actually i am doing testing of a ROR project… So what i need now is that is there any way/ways by which i cam dump the data of an sql table (lets suppose abc) into its yml file which is located in “test/f…

---

## [Oracle-oci8.2.0](https://www.ruby-forum.com/t/oracle-oci8-2-0/179609)

<div class="topic-metadata">

**Author:** [@vetrivel](https://www.ruby-forum.com/u/vetrivel)\
**Replies:** 4\
**Last updated:** [December 1, 2009, 6:48am UTC](https://www.ruby-forum.com/t/oracle-oci8-2-0/179609 "2009-12-01T06:48:19Z")

</div>

Problem in oci8.2.0.1.gem I installed oci8 using gem1.8 command . Then i required that file using oci8.But I got the error . require ‘oci8’ LoadError: /usr/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.7-x86-mswin32-60/ext/o…

---

## [Date class method \`once\` wraps original call in Array. Why?](https://www.ruby-forum.com/t/date-class-method-once-wraps-original-call-in-array-why/179590)

<div class="topic-metadata">

**Author:** [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Replies:** 1\
**Last updated:** [December 1, 2009, 5:07am UTC](https://www.ruby-forum.com/t/date-class-method-once-wraps-original-call-in-array-why/179590 "2009-12-01T05:07:51Z")

</div>

I’m reading the Pickaxe and on page 391, there is a code listing for the class method once from the Date module in Ruby: def once(\*ids) #:nodoc: for id in ids module\_eval \<\<-“end:” alias\_method :#{id.to\_i}, :#{id.to…

---

## [Undefined method class\_eval for ActiveRecord::ConnectionAdapters::JdbcAdapter](https://www.ruby-forum.com/t/undefined-method-class-eval-for-activerecord-jdbcadapter/179137)

<div class="topic-metadata">

**Author:** [@DhussaS\_Varun](https://www.ruby-forum.com/u/DhussaS_Varun)\
**Replies:** 3\
**Last updated:** [December 1, 2009, 3:43am UTC](https://www.ruby-forum.com/t/undefined-method-class-eval-for-activerecord-jdbcadapter/179137 "2009-12-01T03:43:03Z")

</div>

Hi, I am trying to port an application from c-Ruby to JRuby. I have an Oracle database backend and have added the JDBC driver jars to the lib dir of JRuby. Also, I have set the required connection parameters in datab…

---

## [Net::http](https://www.ruby-forum.com/t/net-http/179629)

<div class="topic-metadata">

**Author:** [@beny18241](https://www.ruby-forum.com/u/beny18241)\
**Replies:** 2\
**Last updated:** [December 1, 2009, 2:17am UTC](https://www.ruby-forum.com/t/net-http/179629 "2009-12-01T02:17:01Z")

</div>

Hi, I know how to print simple website – require ‘net/http’ Net::HTTP.get\_print ‘www.example.com’, ‘/index.html’ I wonder how to print output of searcher for example google? I mean for example print output from goo…

---

## [\[Backport #2416\] win32's flock](https://www.ruby-forum.com/t/backport-2416-win32s-flock/179639)

<div class="topic-metadata">

**Author:** [@Usaku\_NAKAMURA](https://www.ruby-forum.com/u/Usaku_NAKAMURA)\
**Replies:** 0\
**Last updated:** [December 1, 2009, 2:10am UTC](https://www.ruby-forum.com/t/backport-2416-win32s-flock/179639 "2009-12-01T02:10:34Z")

</div>

Backport #2416: win32’s flock http://redmine.ruby-lang.org/issues/show/2416 e$B5/I\<\<Te(B: Usaku NAKAMURA e$B%9%F!\<%?%9e(B: Assigned, e$BM%@hEYe(B: Normal e$BC4Ev\<Te(B: Yuki S. \[ruby-list:46578\] e$B$NKvHx$"$?$j$G\<($…

---

## [Gem for Mac HFS metadata?](https://www.ruby-forum.com/t/gem-for-mac-hfs-metadata/179635)

<div class="topic-metadata">

**Author:** [@fritza](https://www.ruby-forum.com/u/fritza)\
**Replies:** 1\
**Last updated:** [November 30, 2009, 11:12pm UTC](https://www.ruby-forum.com/t/gem-for-mac-hfs-metadata/179635 "2009-11-30T23:12:39Z")

</div>

Mac OS X’s native HFS file system attaches directory metadata to its files. The most notable are the “type” and “creator” codes which identify file types without resort to name extensions, and bind them to their prefe…

---

## [How does ActiveRecord do it?](https://www.ruby-forum.com/t/how-does-activerecord-do-it/179617)

<div class="topic-metadata">

**Author:** [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Replies:** 4\
**Last updated:** [November 30, 2009, 10:39pm UTC](https://www.ruby-forum.com/t/how-does-activerecord-do-it/179617 "2009-11-30T22:39:52Z")

</div>

I know it sounds like a Rails question … but it isn’t. Consider irb(main):001:0\> class X irb(main):002:1\> puts “Hi” irb(main):003:1\> end Hi =\> nil irb(main):004:0\> x = X.new =\> #\<X:0x42458ac\> The “Hi” is sent …

---

## [Request: jirb --1.9](https://www.ruby-forum.com/t/request-jirb-1-9/179551)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 5\
**Last updated:** [November 30, 2009, 10:32pm UTC](https://www.ruby-forum.com/t/request-jirb-1-9/179551 "2009-11-30T22:32:14Z")

</div>

C:\\dev\\ruby\\p2pwebclient\\documents\\writeup\\final\>jirb --1.9 c:/dev/ruby/downloads/jruby/lib/ruby/1.8/irb/init.rb:192:in parse\_opts': Unrecognized switch: --1.9 (IRB::UnrecognizedSwitch) from c:/dev/ruby/downloads/jruby…

---

## [What's the new hotness for packaging gems?](https://www.ruby-forum.com/t/whats-the-new-hotness-for-packaging-gems/179570)

<div class="topic-metadata">

**Author:** [@murfhy](https://www.ruby-forum.com/u/murfhy)\
**Replies:** 9\
**Last updated:** [November 30, 2009, 10:11pm UTC](https://www.ruby-forum.com/t/whats-the-new-hotness-for-packaging-gems/179570 "2009-11-30T22:11:10Z")

</div>

I’ve used ad hoc stuff for packaging most of my gems. Long ago there was hoe… is that still relevant? In this age of Gemcutter, what should I be using to generate my gemspecs/build my gems/etc?

---

## [Code Review: BugFixesZ3](https://www.ruby-forum.com/t/code-review-bugfixesz3/179630)

<div class="topic-metadata">

**Author:** [@grujildo](https://www.ruby-forum.com/u/grujildo)\
**Replies:** 0\
**Last updated:** [November 30, 2009, 9:41pm UTC](https://www.ruby-forum.com/t/code-review-bugfixesz3/179630 "2009-11-30T21:41:19Z")

</div>

tfpt review “/shelveset:BugFixesZ3;REDMOND\\tomat” DLR: Fixes http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=3183: OutAttribute on parameters whose type is not ByRef should be ignored. The attribute is onl…

---

## [Unsubscribe](https://www.ruby-forum.com/t/unsubscribe/179626)

<div class="topic-metadata">

**Author:** [@nbits](https://www.ruby-forum.com/u/nbits)\
**Replies:** 0\
**Last updated:** [November 30, 2009, 8:31pm UTC](https://www.ruby-forum.com/t/unsubscribe/179626 "2009-11-30T20:31:05Z")

</div>

Sent from my iPhone.

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

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