Patching file class

D

Daniel Völkerts

Hello,

I checked out the ruby cvs tree for me Windows Mobile issue. After I run=20
'nmake' I got a error for File.path(p) NoMethodError as this method is=20
called by a argument (the path I guess).

My ruby 1.8.4 installation only knows File.path without a parameter. I=20
know that I can 'patch' ruby classes and I wrote following:

class File
def path(p)
File.new(p).path
end
end

But where to put this fragement in? I don't find any file.rb or io.rb.

TIA,
--=20
Daniel V=F6lkerts
Protected by Anti Pesto.
 
D

Daniel Völkerts

In addition I saw that the method is implemented in Ruby 1.9. Is the cvs=20
version only compilable by the newest ruby snapshot? I'd like to use=20
my stable one-click-installer release.

Thanks,
--=20
Daniel V=F6lkerts
Protected by Anti Pesto.
 
C

Curt Hibbs

Hello,

I checked out the ruby cvs tree for me Windows Mobile issue. After I run
'nmake' I got a error for File.path(p) NoMethodError as this method is
called by a argument (the path I guess).

My ruby 1.8.4 installation only knows File.path without a parameter. I
know that I can 'patch' ruby classes and I wrote following:

class File
def path(p)
File.new(p).path
end
end

But where to put this fragement in? I don't find any file.rb or io.rb.

You can put this anywhere in your own application. Ruby's classes can
alwasy be reopened and modified -- even system classes.

Curt
 
N

nobu

Hi,

At Wed, 15 Mar 2006 18:35:32 +0900,
Daniel V=F6lkerts wrote in [ruby-talk:184238]:
In addition I saw that the method is implemented in Ruby 1.9. Is the cvs =
version only compilable by the newest ruby snapshot? I'd like to use=20
my stable one-click-installer release.

You have to use ruby_1_8 branch.

--=20
Nobu Nakada
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,270
Latest member
TopCryptoTwitterChannels_

Latest Threads

Top