[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

xml-simp

Vetrivel Vetrivel

3/31/2009 4:24:00 PM

I have dowunloaded the xml-simple-1.0.12.gem .

I used xml-simple to requie .
require 'xml-simple' But it doesn't work

Then I have given like this It works,
require 'xmlsimple'

My question is that,

How do i know it should be xmlsimple. But the gem file is
xml-simple-1.0.12.gem
--
Posted via http://www.ruby-....

3 Answers

7stud --

3/31/2009 6:08:00 PM

0

Vetrivel Vetrivel wrote:
> I have dowunloaded the xml-simple-1.0.12.gem .
>
> I used xml-simple to requie .
> require 'xml-simple' But it doesn't work
>
> Then I have given like this It works,
> require 'xmlsimple'
>
> My question is that,
>
> How do i know it should be xmlsimple. But the gem file is
> xml-simple-1.0.12.gem

What happens when you run this command:

$ gem list --local
--
Posted via http://www.ruby-....

Brian Candler

3/31/2009 8:56:00 PM

0

Vetrivel Vetrivel wrote:
> I have dowunloaded the xml-simple-1.0.12.gem .
>
> I used xml-simple to requie .
> require 'xml-simple' But it doesn't work
>
> Then I have given like this It works,
> require 'xmlsimple'
>
> My question is that,
>
> How do i know it should be xmlsimple.

In summary, you don't. Read the documentation/examples, or look at what
files the gem contains and make an educated guess as to the one which
you should require.
--
Posted via http://www.ruby-....

Mark Thomas

4/1/2009 12:46:00 PM

0

On Mar 31, 4:55 pm, Brian Candler <b.cand...@pobox.com> wrote:
> Vetrivel Vetrivel wrote:
> > I have dowunloaded the xml-simple-1.0.12.gem .
>
> > I used  xml-simple to requie .
> >                require 'xml-simple' But it doesn't work
>
> > Then I have given like this  It works,
> >            require 'xmlsimple'
>
> > My question is that,
>
> > How do i know it should be xmlsimple.
>
> In summary, you don't. Read the documentation/examples, or look at what
> files the gem contains and make an educated guess as to the one which
> you should require.

This seems to be one area (of many) where Perl's CPAN is superior. The
naming is consistent. The package xml-simple-x.xx will contain the
module XML::Simple. This will physically exist in the file XML/
Simple.pm. In your code you know to 'use XML::Simple;'

Of course, with Perl's austere naming conventions, you tend not to get
colorful package names like Cucumber, for better or worse. (Though I
just noticed a perl port of it with the module name Test::Cucumber
http://search.cpan.org/dist/Test-Cucum...)

-- Mark.