Skip to content

Commit

Permalink
Test at Windows with AppVeyor
Browse files Browse the repository at this point in the history
  • Loading branch information
nichtich committed May 10, 2018
1 parent 5b1c014 commit d3ce5a5
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 9 deletions.
18 changes: 18 additions & 0 deletions .appveyor.yml
@@ -0,0 +1,18 @@
cache:
- C:\strawberry

install:
- if not exist "C:\strawberry" choco install strawberryperl -y
- set PATH=C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PATH%
- cd %APPVEYOR_BUILD_FOLDER%
- cpanm --quiet --installdeps --with-develop --notest .

build_script:
- perl Build.Pl
- perl Build

test_script:
- perl Build test # test without Pandoc
- cinst -y pandoc
- perl Build test # test again with Pandoc

1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -4,6 +4,7 @@ sudo: required
dist: trusty # includes pandoc 1.12.2.1

perl:
- "5.26"
- "5.24"
- "5.22"
- "5.20"
Expand Down
9 changes: 7 additions & 2 deletions lib/Pod/Pandoc.pm
Expand Up @@ -20,7 +20,8 @@ Pod::Pandoc - process Plain Old Documentation format with Pandoc
# STATUS
[![Build Status](https://travis-ci.org/nichtich/Pod-Pandoc.svg)](https://travis-ci.org/nichtich/Pod-Pandoc)
[![Unix Build Status](https://travis-ci.org/nichtich/Pod-Pandoc.svg)](https://travis-ci.org/nichtich/Pod-Pandoc)
[![Windows Build status](https://ci.appveyor.com/api/projects/status/lfskwt20v0ofj5ix?svg=true)](https://ci.appveyor.com/project/nichtich/pod-pandoc)
[![Coverage Status](https://coveralls.io/repos/nichtich/Pod-Pandoc/badge.svg)](https://coveralls.io/r/nichtich/Pod-Pandoc)
[![Kwalitee Score](http://cpants.cpanauthors.org/dist/Pod-Pandoc.png)](http://cpants.cpanauthors.org/dist/Pod-Pandoc)
[![Code Climate Issue Count](https://codeclimate.com/github/nichtich/Pod-Pandoc/badges/issue_count.svg)](https://codeclimate.com/github/nichtich/Pod-Pandoc)
Expand Down Expand Up @@ -97,7 +98,7 @@ L<http://pod-pandoc.rtfd.io/en/latest/Pod-Pandoc.html>.
=head1 SEE ALSO
This module is basde on the wrapper module L<Pandoc> to execute pandoc from Perl
This module is based on the wrapper module L<Pandoc> to execute pandoc from Perl
and on the module L<Pandoc::Elements> for pandoc document processing.
This module makes obsolete several specialized C<Pod::Simple::...> modules such
Expand All @@ -113,6 +114,10 @@ L<Pod::HtmlTree>.
Jakob Voß E<lt>jakob.voss@gbv.deE<gt>
=head1 CONTRIBUTORS
Benct Philip Jonsson
=head1 COPYRIGHT AND LICENSE
Copyright 2017- Jakob Voß
Expand Down
12 changes: 5 additions & 7 deletions lib/Pod/Simple/Pandoc.pm
Expand Up @@ -6,6 +6,7 @@ use 5.010;
our $VERSION = '0.346.0';

use Pod::Simple::SimpleTree;
use Pod::Perldoc;
use Pandoc::Elements;
use Pandoc::Filter::HeaderIdentifiers;
use Pod::Pandoc::Modules;
Expand Down Expand Up @@ -73,12 +74,9 @@ sub parse_file {
sub parse_module {
my ( $self, $name ) = @_;

# map module name to name
run3 [ 'perldoc', '-lm', $name ], undef, \$name;
croak $? if $?;
chomp $name;
my ($file) = Pod::Perldoc->new->grand_search_init([$name]);

$self->parse_file($name);
$self->parse_file($file);
}

sub parse_string {
Expand Down Expand Up @@ -134,7 +132,7 @@ sub parse_and_merge {
sub is_perl_file {
my $file = shift;
return 1 if $file =~ /\.(pm|pod)$/;
if ( -x $file ) {
if ( -f $file ) {
open( my $fh, '<', $file ) or return;
return 1 if $fh and ( <$fh> // '' ) =~ /^#!.*perl/;
}
Expand Down Expand Up @@ -467,7 +465,7 @@ C<subtitle>.
=head2 parse_module( $module )
Reads Pod from a module given by name such as C<"Pod::Pandoc">.
Reads Pod from a module given by name such as C<"Pod::Pandoc"> or by URL.
=head2 parse_string( $string )
Expand Down
3 changes: 3 additions & 0 deletions t/pod-simple-pandoc-parse-modules.t
@@ -1,8 +1,11 @@
use strict;
use Test::More;
use Pod::Simple::Pandoc;
use Pandoc;
use Test::Output;

plan skip_all => 'pandoc not available' unless pandoc;

my $modules;

stderr_is {
Expand Down

0 comments on commit d3ce5a5

Please sign in to comment.