Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Ruby (http://www.velocityreviews.com/forums/f66-ruby.html)
-   -   Coming from Perl question (http://www.velocityreviews.com/forums/t832551-coming-from-perl-question.html)

Brian Hicks 08-17-2006 08:31 PM

Coming from Perl question
 
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

--
Posted via http://www.ruby-forum.com/.


khaines@enigo.com 08-17-2006 08:53 PM

Re: Coming from Perl question
 
On Fri, 18 Aug 2006, Robert Dober wrote:

>> I guess I was hoping for CPAN for ruby (I'm sure that's come up a few
>> billion times here).

>
>
> 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



snacktime 08-17-2006 09:37 PM

Re: Coming from Perl question
 
On 8/17/06, Brian Hicks <bwhicks@aep.com> wrote:
> 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.


Brian Hicks 08-18-2006 02:24 PM

Re: Coming from Perl question
 
Robert Dober wrote:
> On 8/17/06, khaines@enigo.com <khaines@enigo.com> wrote:
>>
>> On Fri, 18 Aug 2006, Robert Dober wrote:
>>

> 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?

--
Posted via http://www.ruby-forum.com/.


William Crawford 08-18-2006 02:40 PM

Re: Coming from Perl question
 
Brian Hicks wrote:
> 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.


--
Posted via http://www.ruby-forum.com/.


Brian Hicks 08-18-2006 04:48 PM

Re: Coming from Perl question
 
William Crawford wrote:

> 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

--
Posted via http://www.ruby-forum.com/.


Austin Ziegler 08-18-2006 06:22 PM

Re: Coming from Perl question
 
On 8/17/06, Robert Dober <robert.dober@gmail.com> wrote:
> On 8/17/06, Brian Hicks <bwhicks@aep.com> wrote:
>> I guess I was hoping for CPAN for ruby (I'm sure that's come up a few
>> billion times here).

> 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
--
Austin Ziegler * halostatue@gmail.com * http://www.halostatue.ca/
* austin@halostatue.ca * http://www.halostatue.ca/feed/
* austin@zieglers.ca



All times are GMT. The time now is 05:11 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.