Forum: Ruby xml-simp

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2d8b8b3782611eae032f194a900db4ef?d=identicon&s=25 Vetrivel Vaithilingam (vetrivel)
on 2009-03-31 18:24
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
54404bcac0f45bf1c8e8b827cd9bb709?d=identicon&s=25 7stud -- (7stud)
on 2009-03-31 20:08
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
753dcb78b3a3651127665da4bed3c782?d=identicon&s=25 Brian Candler (candlerb)
on 2009-03-31 22:56
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.
134ea397777886d6f0aa992672a50eaa?d=identicon&s=25 Mark Thomas (Guest)
on 2009-04-01 14:50
(Received via mailing list)
On Mar 31, 4:55 pm, Brian Candler <b.cand...@pobox.com> wrote:
>
> > 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-Cucumber-0.001/)

-- Mark.
This topic is locked and can not be replied to.