Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get pod for modules #9

Merged
merged 3 commits into from May 31, 2014
Merged

Get pod for modules #9

merged 3 commits into from May 31, 2014

Conversation

reneeb
Copy link
Contributor

@reneeb reneeb commented May 29, 2014

...

use strict;
use warnings;
use Test::More tests => 5;
use Test::Fatal;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are any Test::Fatal methods being used here?

@mickeyn
Copy link
Contributor

mickeyn commented May 29, 2014

hi Renee,

we already support pod fetching (by type) through the module object:
my $pod = MetaCPAN::Client->new->module("Moo")->pod("html");

why was this needed? (i want to understand if there is something we missed)

cheers,
Mickey

@reneeb
Copy link
Contributor Author

reneeb commented May 29, 2014

Hi Mickey,

with the code you mentioned, an unnecessary request is done. And when you want the pod for the same module twice a second request is done.

Renee

@reneeb
Copy link
Contributor Author

reneeb commented May 29, 2014

@oalders you were right. I removed "use Test::Fatal"

@mickeyn
Copy link
Contributor

mickeyn commented May 29, 2014

according to your code, you will still issue a separate request for the same pod for each type.
I can't really see why someone will issue a second request for the same pod+type from the same app - is this a use case you have?
I'm still having hard time seeing the added value here.

@reneeb
Copy link
Contributor Author

reneeb commented May 29, 2014

yes, for different types you have to do seperate requests as there is no way to get them in one request.

I have a use case where I want the pod but not the other module information. So I'd like to avoid the extra request that is done when I have to write ->module( "modulename" ).

@oalders
Copy link
Member

oalders commented May 29, 2014

FWIW, when I'm building Pod for iCPAN, I have a similar use case. I already know everything I need to know about the modules -- I just need the Pod. This seems like an elegant way to solve it.

@oalders
Copy link
Member

oalders commented May 29, 2014

To expand on this, when I'm fetching Pod for everything in 02packages, the additional request would add a fair amount of overhead.

@mickeyn
Copy link
Contributor

mickeyn commented May 29, 2014

sure, saving on the module fetch is fair enough (i thought the argument was for fetching the pod twice).
I don't object to the PR, just wanted to understand it value better.
the reason I added pod as a method to the module object is part of a bigger effort to connect some dots and get info across the different objects (will probably force me to do some renaming there).
I'll try to release it during the weekend.
Renee - thanks for the contribution.
cheers,
Mickey

mickeyn added a commit that referenced this pull request May 31, 2014
@mickeyn mickeyn merged commit 415a73a into metacpan:master May 31, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants