Skip to content

Commit

Permalink
Move parsers to App::Grok::Parser::*
Browse files Browse the repository at this point in the history
  • Loading branch information
hinrik committed Jul 24, 2009
1 parent 4ca3522 commit 625d117
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 16 deletions.
1 change: 1 addition & 0 deletions Changes
@@ -1,5 +1,6 @@
0.15
- Rename -l/--only option to -l/--locate
- Move parsers to the App::Grok::Parser:: namespace

0.14 Fri Jul 24 09:20:07 GMT 2009
- Remove Module::Install::AuthorRequires for now, it's not working right
Expand Down
4 changes: 2 additions & 2 deletions MANIFEST
@@ -1,7 +1,7 @@
script/grok
lib/App/Grok.pm
lib/App/Grok/Pod5.pm
lib/App/Grok/Pod6.pm
lib/App/Grok/Parser/Pod5.pm
lib/App/Grok/Parser/Pod6.pm
p6/grok
Makefile.PL
MANIFEST
Expand Down
8 changes: 4 additions & 4 deletions lib/App/Grok.pm
Expand Up @@ -205,10 +205,10 @@ sub detect_source {

if ($first_pod =~ /^=(?:pod|head\d+|over)$/
|| $contents =~ /^=cut\b/m) {
return 'App::Grok::Pod5';
return 'App::Grok::Parser::Pod5';
}
else {
return 'App::Grok::Pod6';
return 'App::Grok::Parser::Pod6';
}
}

Expand Down Expand Up @@ -267,7 +267,7 @@ sub render_target {
my $functions = $self->read_functions();
if (defined $functions->{$target}) {
my ($func, $body) = @{ $functions->{$target} };
my $renderer = 'App::Grok::Pod5';
my $renderer = 'App::Grok::Parser::Pod5';
eval "require $renderer";
die $@ if $@;
my $content = "=head1 $func\n\n$body";
Expand All @@ -277,7 +277,7 @@ sub render_target {
my $entries = $self->read_table();
if (defined $entries->{$target}) {
my $content = $entries->{$target};
my $renderer = 'App::Grok::Pod5';
my $renderer = 'App::Grok::Parser::Pod5';
eval "require $renderer";
die $@ if $@;
return $renderer->new->render_string($content, $output);
Expand Down
4 changes: 2 additions & 2 deletions lib/App/Grok/Pod5.pm → lib/App/Grok/Parser/Pod5.pm
@@ -1,4 +1,4 @@
package App::Grok::Pod5;
package App::Grok::Parser::Pod5;

use strict;
use warnings;
Expand Down Expand Up @@ -48,7 +48,7 @@ sub render_string {
=head1 NAME
App::Grok::Pod5 - A Pod 5 backend for grok
App::Grok::Parser::Pod5 - A Pod 5 backend for grok
=head1 METHODS
Expand Down
4 changes: 2 additions & 2 deletions lib/App/Grok/Pod6.pm → lib/App/Grok/Parser/Pod6.pm
@@ -1,4 +1,4 @@
package App::Grok::Pod6;
package App::Grok::Parser::Pod6;

# blows up if we use strict before this, damn source filter
use Perl6::Perldoc::Parser;
Expand Down Expand Up @@ -43,7 +43,7 @@ sub render_string {
=head1 NAME
App::Grok::Pod6 - A Pod 6 backend for grok
App::Grok::Parser::Pod6 - A Pod 6 backend for grok
=head1 METHODS
Expand Down
4 changes: 2 additions & 2 deletions t/01_compile.t
Expand Up @@ -3,6 +3,6 @@ use warnings;
use Test::More tests => 4;
use Test::Script;
use_ok('App::Grok');
use_ok('App::Grok::Pod5');
use_ok('App::Grok::Pod6');
use_ok('App::Grok::Parser::Pod5');
use_ok('App::Grok::Parser::Pod6');
script_compiles_ok('script/grok', 'grok compiles');
4 changes: 2 additions & 2 deletions t/02_source/01_pod5.t
Expand Up @@ -2,10 +2,10 @@ use strict;
use warnings;
use File::Spec::Functions 'catfile';
use Test::More tests => 4;
use App::Grok::Pod5;
use App::Grok::Parser::Pod5;

my $pod = catfile('t_source', 'basic5.pod');
ok(my $render = App::Grok::Pod5->new(), 'Constructed renderer object');
ok(my $render = App::Grok::Parser::Pod5->new(), 'Constructed renderer object');

my $text = $render->render_file($pod, 'text');
my $ansi = $render->render_file($pod, 'ansi');
Expand Down
4 changes: 2 additions & 2 deletions t/02_source/02_pod6.t
Expand Up @@ -2,10 +2,10 @@ use strict;
use warnings;
use File::Spec::Functions 'catfile';
use Test::More tests => 4;
use App::Grok::Pod6;
use App::Grok::Parser::Pod6;

my $pod = catfile('t_source', 'basic.pod');
ok(my $render = App::Grok::Pod6->new(), 'Constructed renderer object');
ok(my $render = App::Grok::Parser::Pod6->new(), 'Constructed renderer object');

my $text = $render->render_file($pod, 'text');
my $ansi = $render->render_file($pod, 'ansi');
Expand Down

0 comments on commit 625d117

Please sign in to comment.