Skip to content

Commit

Permalink
Look up the man pages. Depend on Perl6::Doc 0.42
Browse files Browse the repository at this point in the history
  • Loading branch information
hinrik committed Jul 24, 2009
1 parent 0bc215d commit c06849e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
1 change: 1 addition & 0 deletions MANIFEST
Expand Up @@ -30,6 +30,7 @@ t/04_targets/02_synopsis.t
t/04_targets/03_function.t
t/04_targets/04_table.t
t/04_targets/05_failure.t
t/04_targets/06_man_page.t
t_source/basic.pod
t_source/basic5.pod
xt/perlcriticrc
Expand Down
2 changes: 1 addition & 1 deletion Makefile.PL
Expand Up @@ -17,7 +17,7 @@ requires ('Getopt::Long' => '2.33');
requires ('IO::Interactive' => '0');
requires ('File::ShareDir' => '0');
requires ('File::Temp' => '0');
requires ('Perl6::Doc' => '0.41');
requires ('Perl6::Doc' => '0.42');
requires ('Perl6::Perldoc' => '0.0.5');
requires ('Perl6::Perldoc::To::Ansi' => '0.07');
requires ('Pod::Text::Ansi' => '0.03');
Expand Down
11 changes: 10 additions & 1 deletion lib/App/Grok/Resource/Spec.pm
Expand Up @@ -18,7 +18,6 @@ my %docs = map {

sub spec_fetch {
my ($topic) = @_;
return if $topic !~ /^\w\d\d/;
_build_index() if !%index;

for my $doc (keys %index) {
Expand Down Expand Up @@ -57,6 +56,14 @@ sub _build_index {
}
}

# man pages (perlintro, etc)
my $pages_dir = catdir($dist_dir, 'man_pages');
for my $file (glob "$pages_dir/*.pod") {
my $name = (splitpath($file))[2];
$name =~ s/\.pod$//;
$index{$name} = $file;
}

# synopsis 32
my $S32_dir = catdir($docs{S}, 'S32-setting-library');
for my $file (glob "$S32_dir/*.pod") {
Expand Down Expand Up @@ -94,6 +101,8 @@ App::Grok::Resource::Spec - Perl 6 specification resource for grok
This module the locates Apocalypses, Exegeses, Synopsis and magazine articles
distributed with L<Perl6::Doc>.
It also includes user documentation like F<perlintro> and F<perlsyn>.
=head1 METHODS
=head2 C<spec_index>
Expand Down
12 changes: 12 additions & 0 deletions t/04_targets/06_man_page.t
@@ -0,0 +1,12 @@
use strict;
use warnings;
use File::Spec::Functions 'catfile';
use Test::More tests => 2;

my $grok = catfile('script', 'grok');

my $perlintro = qx/$^X $grok perlintro/;
my $perlsyn = qx/$^X $grok perlsyn/;

like($perlintro, qr/A brief introduction and overview of Perl 6/, 'Got perlintro');
like($perlsyn, qr/Perl syntax/, 'Got perlsyn');

0 comments on commit c06849e

Please sign in to comment.