[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Package, a future replacement for setup.rb and mkmf.rb

acharlieblue

6/5/2005 2:39:00 AM

Jim Freeze wrote:
> * Christian Neukirchen <chneukirchen@gmail.com> [2005-06-05 07:59:15 +0900]:
>
> > In Ruby, this would maybe look like that:
> >
> > require 'package'
> >
> > setup {
> > name "Distutils"
> > version "0.1.1"
> > description "Python Module Distribution Utilities"
> > author "Greg Ward"
> > author_email "gward@python.net"
> > url "http://www.python.org/sigs/distutils-...
> >
> > packages ['distutils', 'distutils/command']
> > }
>
> If you have #name(arg) do the same thing as #name=(arg), how
> does one get access to the instance variable?

That isn't too hard to implement.

def variable(*args)
@variable = args.first unless args.empty?
@variable
end

Now we can be even more like Smalltalk!

Seriously, though, I think a Hash would both make more sense there (if
I understand correctly what it's doing) and be more Ruby-like than
hacking the setter syntax in a block. Though I guess maybe people don't
like typing equals signs. I don't know.