# Ruby

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

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

---

## [Advising JRuby code from AspectJ?](https://www.ruby-forum.com/t/advising-jruby-code-from-aspectj/106679)

<div class="topic-metadata">

**Author:** [@Susan\_D](https://www.ruby-forum.com/u/Susan_D)\
**Replies:** 1\
**Last updated:** [June 13, 2007, 7:54pm UTC](https://www.ruby-forum.com/t/advising-jruby-code-from-aspectj/106679 "2007-06-13T19:54:59Z")

</div>

We’re developing a RESTful web application, and we’re looking at running Rails under JRuby for many of our services. The front end is likely to be Java, as we’re kitbashing an existing OSS project into something that …

---

## [File.new and non-existent directories](https://www.ruby-forum.com/t/file-new-and-non-existent-directories/106736)

<div class="topic-metadata">

**Author:** [@studbucket](https://www.ruby-forum.com/u/studbucket)\
**Replies:** 4\
**Last updated:** [June 13, 2007, 7:41pm UTC](https://www.ruby-forum.com/t/file-new-and-non-existent-directories/106736 "2007-06-13T19:41:10Z")

</div>

Hi, I may be wrong, but after some testing it appears to me that when I attempt to create a new file using File.new in a directory that does not exist, instead of creating the directory, an exception is thrown instea…

---

## [Passing args from within method\_missing](https://www.ruby-forum.com/t/passing-args-from-within-method-missing/106716)

<div class="topic-metadata">

**Author:** [@Sharon\_P](https://www.ruby-forum.com/u/Sharon_P)\
**Replies:** 4\
**Last updated:** [June 13, 2007, 7:07pm UTC](https://www.ruby-forum.com/t/passing-args-from-within-method-missing/106716 "2007-06-13T19:07:52Z")

</div>

Hi, I have an hash of code blocks(procs?), @styles, and am trying to call these using method missing. Problem is, some take one argument, and others take two, and I can’t seem to pass args to them without if being pa…

---

## [Code refactoring advice](https://www.ruby-forum.com/t/code-refactoring-advice/106540)

<div class="topic-metadata">

**Author:** [@Nathan\_TSHoover](https://www.ruby-forum.com/u/Nathan_TSHoover)\
**Replies:** 4\
**Last updated:** [June 13, 2007, 5:24pm UTC](https://www.ruby-forum.com/t/code-refactoring-advice/106540 "2007-06-13T17:24:33Z")

</div>

I have some code written that basically looks like below. I want to design a Module, Method, Class, Whatever to make each xml component accessible by a method and the ability to set attribs, params, clear params, att…

---

## [Getting the last N bytes of a string:](https://www.ruby-forum.com/t/getting-the-last-n-bytes-of-a-string/105691)

<div class="topic-metadata">

**Author:** [@stickstone](https://www.ruby-forum.com/u/stickstone)\
**Replies:** 21\
**Last updated:** [June 13, 2007, 4:27pm UTC](https://www.ruby-forum.com/t/getting-the-last-n-bytes-of-a-string/105691 "2007-06-13T16:27:20Z")

</div>

What’s the simplest way to get only the last 10 bytes of a string? buf\[-10,10\] doesn’t work if buf is smaller than 10 bytes, as it returns nil. Is there anything simpler than buf\[-10,10\] || buf ? Thanks, Brian. P…

---

## [Rakefile question](https://www.ruby-forum.com/t/rakefile-question/106675)

<div class="topic-metadata">

**Author:** [@Magicloud\_M](https://www.ruby-forum.com/u/Magicloud_M)\
**Replies:** 1\
**Last updated:** [June 13, 2007, 4:19pm UTC](https://www.ruby-forum.com/t/rakefile-question/106675 "2007-06-13T16:19:06Z")

</div>

Dear all, Usually, I do dependent task like: task :son =\> \[:father\] do; end. Now I have a task, which depends on task A or task B (either is done is ok). How to do this? Thanks.

---

## [Unit testing idiom](https://www.ruby-forum.com/t/unit-testing-idiom/106689)

<div class="topic-metadata">

**Author:** [@regularfry](https://www.ruby-forum.com/u/regularfry)\
**Replies:** 1\
**Last updated:** [June 13, 2007, 4:09pm UTC](https://www.ruby-forum.com/t/unit-testing-idiom/106689 "2007-06-13T16:09:17Z")

</div>

Hi all, It’s always bothered me having code and unit tests in different places - keeping unit tests near the code they are testing has to be a good thing, right? Given the above, I stumbled on the following idiom: $…

---

## [JRuby 1.0 Released](https://www.ruby-forum.com/t/jruby-1-0-released/106430)

<div class="topic-metadata">

**Author:** [@Thomas\_E](https://www.ruby-forum.com/u/Thomas_E)\
**Replies:** 13\
**Last updated:** [June 13, 2007, 3:38pm UTC](https://www.ruby-forum.com/t/jruby-1-0-released/106430 "2007-06-13T15:38:11Z")

</div>

The JRuby community is pleased to announce the release of JRuby 1.0! Homepage: http://www.jruby.org/ Download: http://dist.codehaus.org/jruby/ JRuby 1.0 is a major milestone for our project. Our main goal for 1.0 ha…

---

## [Garden's Point Ruby.NET compiler 0.8 beta released](https://www.ruby-forum.com/t/gardens-point-ruby-net-compiler-0-8-beta-released/106701)

<div class="topic-metadata">

**Author:** [@leslieviljoen](https://www.ruby-forum.com/u/leslieviljoen)\
**Replies:** 0\
**Last updated:** [June 13, 2007, 1:32pm UTC](https://www.ruby-forum.com/t/gardens-point-ruby-net-compiler-0-8-beta-released/106701 "2007-06-13T13:32:50Z")

</div>

Hi All Since I see no mention of this on the list, below is the announcement I received from Dr. Wayne K… This version includes an Interop prototype, so you can compile a Ruby program to a DLL, include that DLL in a…

---

## [Has any one created a FaceBook app in Rails](https://www.ruby-forum.com/t/has-any-one-created-a-facebook-app-in-rails/106698)

<div class="topic-metadata">

**Author:** [@arjun\_ghosh](https://www.ruby-forum.com/u/arjun_ghosh)\
**Replies:** 0\
**Last updated:** [June 13, 2007, 12:46pm UTC](https://www.ruby-forum.com/t/has-any-one-created-a-facebook-app-in-rails/106698 "2007-06-13T12:46:43Z")

</div>

Hi, Has any one created a Face Book app in Rails? If yes can we get some pointer or link on information on How To. Thanks and Regards AG

---

## [Passing block to Proc#call](https://www.ruby-forum.com/t/passing-block-to-proc-call/106425)

<div class="topic-metadata">

**Author:** [@Erwin\_A](https://www.ruby-forum.com/u/Erwin_A)\
**Replies:** 12\
**Last updated:** [June 13, 2007, 11:52am UTC](https://www.ruby-forum.com/t/passing-block-to-proc-call/106425 "2007-06-13T11:52:43Z")

</div>

I’d like to do something like: x = lambda do |\*args| if args.size == 5 # call another block yield \*args.map{|x| x.gsub(/es$/, ‘’) } end end x.call(\*%w\[cats dogs ones twos threes\]) do |\*words| puts words.last # ou…

---

## [Quick sed replacemnt](https://www.ruby-forum.com/t/quick-sed-replacemnt/106653)

<div class="topic-metadata">

**Author:** [@yitzhakbg](https://www.ruby-forum.com/u/yitzhakbg)\
**Replies:** 13\
**Last updated:** [June 13, 2007, 10:11am UTC](https://www.ruby-forum.com/t/quick-sed-replacemnt/106653 "2007-06-13T10:11:22Z")

</div>

I need a quicky which I can’t do in sed and I did it very clumsily. I need to filter the following file, changing the class name’s first letter to upper case. For example, rewrite the file with the word “organizations…

---

## [How to use a ActiveScaffold to list a page not the first one](https://www.ruby-forum.com/t/how-to-use-a-activescaffold-to-list-a-page-not-the-first-one/106690)

<div class="topic-metadata">

**Author:** [@gao\_zhixin](https://www.ruby-forum.com/u/gao_zhixin)\
**Replies:** 0\
**Last updated:** [June 13, 2007, 10:07am UTC](https://www.ruby-forum.com/t/how-to-use-a-activescaffold-to-list-a-page-not-the-first-one/106690 "2007-06-13T10:07:20Z")

</div>

Now I use active scaffold to generate list page, but now I must use period\_call\_remote to timely refresh a partial render the active scaffold,but how I get and to pass the page parameter from this partial?

---

## [File.exists? ignores file extension on windows?](https://www.ruby-forum.com/t/file-exists-ignores-file-extension-on-windows/106647)

<div class="topic-metadata">

**Author:** [@hagus](https://www.ruby-forum.com/u/hagus)\
**Replies:** 8\
**Last updated:** [June 13, 2007, 9:01am UTC](https://www.ruby-forum.com/t/file-exists-ignores-file-extension-on-windows/106647 "2007-06-13T09:01:10Z")

</div>

I just wanted to check in with an issue I ran into last night. I was trying to unpack a zip file using the following code which appears to be the recommended way to extract using this library. ------------------------…

---

## [How to access response code with mechanize](https://www.ruby-forum.com/t/how-to-access-response-code-with-mechanize/106681)

<div class="topic-metadata">

**Author:** [@Todd\_ASJacobs](https://www.ruby-forum.com/u/Todd_ASJacobs)\
**Replies:** 2\
**Last updated:** [June 13, 2007, 8:28am UTC](https://www.ruby-forum.com/t/how-to-access-response-code-with-mechanize/106681 "2007-06-13T08:28:24Z")

</div>

I have a code segment which is intended to catch ResponseCodeError exceptions from the mechanize library: begin code rescue ResponseCodeError puts 'bad response code: ’ + $! end This doesn’t quite do what I need. W…

---

## [Extending Symbol with #to\_str effects Struct.new](https://www.ruby-forum.com/t/extending-symbol-with-to-str-effects-struct-new/106661)

<div class="topic-metadata">

**Author:** [@Trans](https://www.ruby-forum.com/u/Trans)\
**Replies:** 4\
**Last updated:** [June 13, 2007, 7:19am UTC](https://www.ruby-forum.com/t/extending-symbol-with-to-str-effects-struct-new/106661 "2007-06-13T07:19:19Z")

</div>

Not arguing either way a s to whether this makes sense or not (it’s had it’s lengthy discussions before). class Symbol def to\_str String(self) end end But it does cause this strangeness: Struct.new(:x) NameEr…

---

## [Fwd: ruby-mode](https://www.ruby-forum.com/t/fwd-ruby-mode/104174)

<div class="topic-metadata">

**Author:** [@Seiji\_Zenitani](https://www.ruby-forum.com/u/Seiji_Zenitani)\
**Replies:** 12\
**Last updated:** [June 13, 2007, 6:37am UTC](https://www.ruby-forum.com/t/fwd-ruby-mode/104174 "2007-06-13T06:37:15Z")

</div>

e$B$3$s$K$A$O!#e(B e$B$+$J$jA0!"e(Bruby-mode e$B$Ne(B emacs e$B\<}O?$K$D$$$Fe(B e$B$\*Ld$$9g$o$;$7$?A,C+$G$9!#!Je(B\[ruby-dev:27754\]e$B!Ke(B e$B$h$&$d$/e(B ruby-mode e$BDI2C$Ke(B OK e$B$,=P$^$7$?$N$Ge(B e$B$\<j?t$r$$+$1$…

---

## [Ruport Roundtable](https://www.ruby-forum.com/t/ruport-roundtable/150713)

<div class="topic-metadata">

**Author:** [@mikem836](https://www.ruby-forum.com/u/mikem836)\
**Replies:** 1\
**Last updated:** [June 13, 2007, 2:13am UTC](https://www.ruby-forum.com/t/ruport-roundtable/150713 "2007-06-13T02:13:56Z")

</div>

It’s been a few weeks now since the 1.0 release of Ruport and now that the dust has settled, it seems like a good time to have a roundtable discussion to see how things are going. We’re mainly hoping to get some feedb…

---

## [Ruby/smalltalk: method\_missing/doesNotUnderstand](https://www.ruby-forum.com/t/ruby-smalltalk-method-missing-doesnotunderstand/106477)

<div class="topic-metadata">

**Author:** [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Replies:** 3\
**Last updated:** [June 12, 2007, 11:55pm UTC](https://www.ruby-forum.com/t/ruby-smalltalk-method-missing-doesnotunderstand/106477 "2007-06-12T23:55:41Z")

</div>

Hi all - this is for the Smalltalkers and the people interested in Ruby’s genealogy, as it were. Is it fair for me to tell people that method\_missing is a Ruby translation of Smalltalk’s doesNotUnderstand? Or is it mo…

---

## [Using active support without rails](https://www.ruby-forum.com/t/using-active-support-without-rails/106648)

<div class="topic-metadata">

**Author:** [@nephish](https://www.ruby-forum.com/u/nephish)\
**Replies:** 2\
**Last updated:** [June 12, 2007, 10:24pm UTC](https://www.ruby-forum.com/t/using-active-support-without-rails/106648 "2007-06-12T22:24:28Z")

</div>

hello there all, a few weeks ago, i asked about how i may use active record in ruby scripts, now i want to be able to use some of the helpers from Active Support. how would i go about being able to access those class…

---

## [Stuck in a Redirect Loop While Crawling](https://www.ruby-forum.com/t/stuck-in-a-redirect-loop-while-crawling/106649)

<div class="topic-metadata">

**Author:** [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Replies:** 2\
**Last updated:** [June 12, 2007, 9:13pm UTC](https://www.ruby-forum.com/t/stuck-in-a-redirect-loop-while-crawling/106649 "2007-06-12T21:13:13Z")

</div>

Hello, I am writing a crawler in Ruby to crawl websites. One of the sites I crawl is very picky about headers so I am mimicking my FireFox browser as closely as possible. One of the GETs I make to this site results in …

---

## [Rdoc and ri under MacOSX - how to?](https://www.ruby-forum.com/t/rdoc-and-ri-under-macosx-how-to/106632)

<div class="topic-metadata">

**Author:** [@medips](https://www.ruby-forum.com/u/medips)\
**Replies:** 1\
**Last updated:** [June 12, 2007, 7:57pm UTC](https://www.ruby-forum.com/t/rdoc-and-ri-under-macosx-how-to/106632 "2007-06-12T19:57:39Z")

</div>

I’m a Ruby newbie under MacOSX 10.4.9. Ruby is working very well but and I cannot find how and where to install the documentation in order that rdoc and ri work. Yet from the Terminal I got the messages below. Any clu…

---

## [Mexican Blanket (#127)](https://www.ruby-forum.com/t/mexican-blanket-127/106318)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 15\
**Last updated:** [June 12, 2007, 6:40pm UTC](https://www.ruby-forum.com/t/mexican-blanket-127/106318 "2007-06-12T18:40:34Z")

</div>

The three rules of Ruby Q.: Please do not post any solutions or spoiler discussion for this quiz until 48 hours have passed from the time on this message. Support Ruby Q. by submitting ideas as often as you can: …

---

## [Self in method name](https://www.ruby-forum.com/t/self-in-method-name/106582)

<div class="topic-metadata">

**Author:** [@iskaldur](https://www.ruby-forum.com/u/iskaldur)\
**Replies:** 6\
**Last updated:** [June 12, 2007, 6:11pm UTC](https://www.ruby-forum.com/t/self-in-method-name/106582 "2007-06-12T18:11:10Z")

</div>

Is there any difference between using self in a method name, and not using it? For example, I’ve seen a lot something like class Foo def self.bar … end end Is this the same thing as class Foo def bar … end e…

---

## [Serious danger of being impressed](https://www.ruby-forum.com/t/serious-danger-of-being-impressed/106442)

<div class="topic-metadata">

**Author:** [@djmook](https://www.ruby-forum.com/u/djmook)\
**Replies:** 33\
**Last updated:** [June 12, 2007, 5:59pm UTC](https://www.ruby-forum.com/t/serious-danger-of-being-impressed/106442 "2007-06-12T17:59:07Z")

</div>

I’m mostly into Python, and decided to have a go at writing a little accounts package (in python on OS X). It worked in its primitive way, and I was looking to take it to the next level. I decided that sqlite was the …

---

## [Newbie: help on site design?](https://www.ruby-forum.com/t/newbie-help-on-site-design/106624)

<div class="topic-metadata">

**Author:** [@Fjordur](https://www.ruby-forum.com/u/Fjordur)\
**Replies:** 2\
**Last updated:** [June 12, 2007, 5:53pm UTC](https://www.ruby-forum.com/t/newbie-help-on-site-design/106624 "2007-06-12T17:53:05Z")

</div>

Hi, I’m learning RoR, been throught various tutorials on scaffolding, done the O’Reilly “Ruby on Rails” book by Tate and Hibbs. I’m planning to build a full web application with logins and sessions. Can you point me …

---

## [Benchmark segfault \]](https://www.ruby-forum.com/t/benchmark-segfault/106607)

<div class="topic-metadata">

**Author:** [@Michal\_S](https://www.ruby-forum.com/u/Michal_S)\
**Replies:** 6\
**Last updated:** [June 12, 2007, 5:52pm UTC](https://www.ruby-forum.com/t/benchmark-segfault/106607 "2007-06-12T17:52:04Z")

</div>

On 11/06/07, Robert K. removed\_email\_address@domain.invalid wrote: Benchmark::bmbm do |x| two-bang 1604.816667 1.350000 1606.166667 (963.803356) x.report(“zip”) { Hash\[ \*id\_list.zip(id\_list.collect {|e| e.obj…

---

## [Fastthread on x86\_64?](https://www.ruby-forum.com/t/fastthread-on-x86-64/106636)

<div class="topic-metadata">

**Author:** [@regularfry](https://www.ruby-forum.com/u/regularfry)\
**Replies:** 1\
**Last updated:** [June 12, 2007, 5:36pm UTC](https://www.ruby-forum.com/t/fastthread-on-x86-64/106636 "2007-06-12T17:36:02Z")

</div>

Is this a known-bad combination? I’m installing onto Debian Etch, and: $ ruby -v ruby 1.8.5 (2006-08-25) \[x86\_64-linux\] When I gem install fastthread, I get these: In file included from fastthread.c:12: /usr/lib/ru…

---

## [Assigning hash to attributes](https://www.ruby-forum.com/t/assigning-hash-to-attributes/106612)

<div class="topic-metadata">

**Author:** [@liberte](https://www.ruby-forum.com/u/liberte)\
**Replies:** 8\
**Last updated:** [June 12, 2007, 3:56pm UTC](https://www.ruby-forum.com/t/assigning-hash-to-attributes/106612 "2007-06-12T15:56:32Z")

</div>

Hi, as i mentioned before, i’m pretty new to ruby. So i’m trying to optimize my code and learn the advantages of this nice language :). What i’m trying this time is to pass a hash of parameters (passed by a HTML form…

---

## [\[1.9/trunk\] Bus error / abort trop with latest sources](https://www.ruby-forum.com/t/1-9-trunk-bus-error-abort-trop-with-latest-sources/105070)

<div class="topic-metadata">

**Author:** [@keltia](https://www.ruby-forum.com/u/keltia)\
**Replies:** 5\
**Last updated:** [June 12, 2007, 3:29pm UTC](https://www.ruby-forum.com/t/1-9-trunk-bus-error-abort-trop-with-latest-sources/105070 "2007-06-12T15:29:09Z")

</div>

Hello, I’m compiling Ruby 1.9 from the SVN tree, latest changeset is 12384 on OS X/PPC 10.4.9. It fails during compilation with the following message: … gcc -O -pipe -pipe -fno-common -L. main.o libruby-static…

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

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