plu / Pithub

Perl Github v3 API
http://metacpan.org/module/Pithub
Other
68 stars 36 forks source link

fix error in example #211

Closed plicease closed 4 years ago

plicease commented 4 years ago

The example in this POD doesn't work for me:

my $response = Pithub::Markdown->render(
    data => {
        text => "Hello world github/linguist#1 **cool**, and #1!",
        context => "github/gollum",
        mode => "gfm",
    },
);

# Note that response is NOT in JSON, so ->content will die
my $html = $response->raw_content;

gives:

$ perl example.pl 
Can't locate object method "render" via package "Pithub::Markdown" (perhaps you forgot to load "Pithub::Markdown"?) at example.pl line 1.

without a use Pithub::Markdown and gives

$ perl example.pl 
Can't use string ("Pithub::Markdown") as a HASH ref while "strict refs" in use at (eval 38) line 23.

without the ->new.

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 98.939% when pulling 45bf3ac9fbc74b1e3a02c4ee515efe636f37e6da on plicease:graham/example-error-1 into 8e2c64c990ad8edb70c611315dc36ea2b701a3be on plu:master.

oalders commented 4 years ago

Thanks @plicease!