Coming from Perl question

B

Brian Hicks

I'm looking to switch from perl to something more object oriented. I'm
trying to decide between ruby and python, but I'm having some issues
with some aspects of ruby. The language looks great to me, but I am
interested in how it is extended (for things like network programming,
oracle connectivity, extra fancy date manipulation, things like that).
rubyforge seems to be the central location for these things, but it
isn't entirely obvious how to get things installed properly or in a
"standard" way, and if I did manage to get them installed, it's not
obvious how to use them.

I guess I was hoping for CPAN for ruby (I'm sure that's come up a few
billion times here). Or at least some sort of page like this:

http://www.python.org/doc/faq/library/

that tells how to find out the information i'm looking for. Can anyone
help out a newbie?

Thanks!

Brian
 
K

khaines

Strangely enough not at all!

Search the archives. This is indeed a recurring topic.

However, in a nutshell, for the OP:

The majority of projects these days are hosted at Rubyforge.
The majority also have listings at RAA (http://raa.ruby-lang.org).

These are non-identical majorities with a lot of overlap, so when hunting
for something, it's a good idea to search both places.

A more or less standard package distribution format is the RubyGem.
Read all about it here:

http://docs.rubygems.org/

Once you have gems installed in your Ruby installation, you can do
something like this:

gem install mime-types

RTM for details on everything else you can do.


Kirk Haines
 
S

snacktime

I'm looking to switch from perl to something more object oriented. I'm
trying to decide between ruby and python, but I'm having some issues
with some aspects of ruby. The language looks great to me, but I am
interested in how it is extended (for things like network programming,
oracle connectivity, extra fancy date manipulation, things like that).
rubyforge seems to be the central location for these things, but it
isn't entirely obvious how to get things installed properly or in a
"standard" way, and if I did manage to get them installed, it's not
obvious how to use them.

I found ruby fairly intuitive coming from a mostly perl background.
network programming is pretty easy. Database connectivity is pretty
good, although I haven't used the oracle adaptors. There is ruby-dbi
which is similar to perl dbi. The one thing I do miss is Date::Manip.
Nothing like it in ruby that I have found. Ruby regular expressions
aren't quite as powerful as perl's, but more then adequate. I do like
all the little methods in ruby that make doing the simple stuff easy,
like string.ljust, etc.. Some stuff takes a while to get used to
though, like the fact that everything is an object. Variable
assignment has it's quirks that have caught me a few times.

For things on rubyforge you can usually just 'gem install packagename'
from your local server and it will grab it from rubyforge and install
it. Stuff on raa you have to pull down and run 'ruby setup.rb'
yourself.

I've written a couple of decent sized apps in python and a ton of perl
code over the years, but the more i use ruby the more I like it.
 
B

Brian Hicks

Robert said:
54 times in 6 months, whatever you say.

I guess OP felt better with my reply, but obviously you did not!

Sorry

I was mostly just looking for the most up to date anyway, so both
answers are appreciated. ;)

I had actually found raa.ruby-lang.org, so finding the modules looks to
be not THAT difficult, but finding usage info for them could be
problematic.

For example, I'm interested in sending an email with ruby. So I go to
raa.ruby-lang.org and look through "libraries" and find RubyMail. The
description says, "lightweight mail library containing various mail
utility classes and modules". It sounds like it might do what I want.
From this: http://raa.ruby-lang.org/project/rubymail/ I can see links to
download the module, see changes, the project homepage on rubyforge, and
the author's email address. No usage info.

Ok, so I'll go to the homepage. It's here:
http://rubyforge.org/projects/rubymail/. Again, I can see the
requirements/dependencies, a changelog, and I can download the module.
There's even a forum here, but it's empty. Still no usage help. I could
ask on the forum, but that seems inefficient.

What's the easiest way to figure out what this "RubyMail" does and how
to use it?
 
W

William Crawford

Brian said:
What's the easiest way to figure out what this "RubyMail" does and how
to use it?

I'm new to Ruby, too, but I've already come across this question on my
own learning. My solution was to simply open up the source code and
look through it. If it's commented even halfway well, it'll be very
obvious what everything does.

I know this isn't nearly as easy as a proper set of examples, but it's
usually enough to get started and quite often enough to do what you
need.
 
B

Brian Hicks

William said:
I'm new to Ruby, too, but I've already come across this question on my
own learning. My solution was to simply open up the source code and
look through it. If it's commented even halfway well, it'll be very
obvious what everything does.

Man, I was hoping it wouldn't come to that, since you'd have to download
and possibly install a module before deciding if it's something you even
need.

However, I just noticed here:

http://www.ruby-doc.org/docs/ProgrammingRuby/

That there are plenty of useful modules for networking (including
smtp!). There's even a date class in the standard library! I should be
able to build any modules I'm missing from those building blocks without
too much trouble.

Neat!

Brian
 
A

Austin Ziegler

Strangely enough not at all!

Not recently, especially since the introduction of RubyGems and
their hosting on RubyForge, but in the past, it was quite common to hear
people say something like "we need something like CPAN".

-austin
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top