Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

A hack I think will fix the formatting on search.cpan.

search.cpan seems to dislike a =begin block that isn't a single
word. Hopefully it accepts dashes.

If search.cpan wasn't a fucking closed source app I could actually
look at the code and figure this out.
  • Loading branch information...
commit 5547fba771baa52a04ec8dcb3673032ed4c1c0cc 1 parent 6b83828
@autarch autarch authored
View
15 author/extract-inline-tests
@@ -27,9 +27,10 @@ use warnings;
\n=for[ \t]+example[ \t]+end\s*? # ... until the =for example end
(?:\n|$) # ... at the end of file or a newline
| # OR
- =begin[ \t]+(?:test|testing)\b # ... when we find a =begin test or testing
- .*? # ... and keep capturing
- \n=end[ \t]+(?:test|testing)\s*? # ... until an =end tag
+ =begin[ \t]+(?:test|testing)(?:-SETUP)? # ... when we find a =begin test or testing
+ .*? # ... and keep capturing
+ \n=end[ \t]+(?:test|testing)(?:-SETUP)? # ... until an =end tag
+ .*?
(?:\n|$) # ... at the end of file or a newline
) # ... and stop capturing
/isx;
@@ -42,10 +43,14 @@ use warnings;
# A hack to turn the SYNOPSIS into something Test::Inline
# doesn't barf on
- if ( $elt =~ s/=head1[ \t]+SYNOPSIS/=begin testing SETUP\n\n{/ ) {
- $elt .= "}\n\n=end testing SETUP";
+ if ( $elt =~ s/=head1[ \t]+SYNOPSIS/=begin testing-SETUP\n\n{/ ) {
+ $elt .= "}\n\n=end testing-SETUP";
}
+ # It seems like search.cpan doesn't like a name with
+ # spaces after =begin. bleah, what a mess.
+ $elt =~ s/testing-SETUP/testing SETUP/g;
+
push @elements, $elt;
}
View
4 lib/Moose/Cookbook/Basics/Recipe4.pod
@@ -1,7 +1,7 @@
=pod
-=begin testing SETUP
+=begin testing-SETUP
BEGIN {
eval 'use Regexp::Common; use Locale::US;';
@@ -12,7 +12,7 @@ BEGIN {
}
}
-=end testing
+=end testing-SETUP
=head1 NAME
View
4 lib/Moose/Cookbook/Basics/Recipe5.pod
@@ -1,7 +1,7 @@
=pod
-=begin testing SETUP
+=begin testing-SETUP
BEGIN {
eval 'use HTTP::Headers; use Params::Coerce; use URI;';
@@ -12,7 +12,7 @@ BEGIN {
}
}
-=end testing
+=end testing-SETUP
=head1 NAME
View
4 lib/Moose/Cookbook/Extending/Recipe3.pod
@@ -1,7 +1,7 @@
=pod
-=begin testing SETUP
+=begin testing-SETUP
BEGIN {
eval 'use Test::Warn 0.11;';
@@ -12,7 +12,7 @@ BEGIN {
}
}
-=end testing
+=end testing-SETUP
=head1 NAME
View
4 lib/Moose/Cookbook/Roles/Recipe3.pod
@@ -2,7 +2,7 @@ package Moose::Cookbook::Roles::Recipe3;
=pod
-=begin testing SETUP
+=begin testing-SETUP
{
# Not in the recipe, but needed for writing tests.
@@ -23,7 +23,7 @@ package Moose::Cookbook::Roles::Recipe3;
);
}
-=end testing
+=end testing-SETUP
=head1 NAME

0 comments on commit 5547fba

Please sign in to comment.
Something went wrong with that request. Please try again.