Permalink
Browse files

pod and tests

  • Loading branch information...
1 parent c287a73 commit a0625f653b9201d98cd5db00d48be15139eba4f9 sugama committed Jun 27, 2011
View
@@ -0,0 +1,12 @@
+.*
+!.gitignore
+!.perltidyrc
+*~
+blib
+Makefile*
+!Makefile.PL
+*META.yml
+MANIFEST*
+!MANIFEST.SKIP
+pm_to_blib
+*bak
View
18 README
@@ -1,18 +0,0 @@
-Mojolicious-Plugin-UnmessifyBundle
-
-INSTALLATION
-
-To install this module, run the following commands:
-
- perl Makefile.PL
- make
- make test
- make install
-
-COPYRIGHT AND LICENSE
-
-Copyright (C) 2011 sugama
-
-This program is free software; you can redistribute it and/or
-modify it under the same terms as Perl itself.
-
View
@@ -0,0 +1,50 @@
+=head1 NAME
+
+Mojolicious::Plugin::UnmessifyBundle -
+
+=head1 SYNOPSIS
+
+ sub startup {
+
+ my $self = shift;
+
+ # Mojolicious
+ $self->plugin(unmessify_bundle => {prefix => 'mojolicious-bundle'});
+
+ # Mojolicious::Lite
+ plugin unmessify_bundle => {prefix => 'mojolicious-bundle'};
+ }
+
+ # mod_rewrite can be as follows.
+
+ RewriteEngine on
+ RewriteRule ^(.*(\.(html|htm|xml))|/)$ http://localhost:3000$1 [L,P,QSA]
+ RewriteRule ^/mojolicious-bundle(/.+)$ http://localhost:3000$1 [L,P,QSA]
+
+=head1 DESCRIPTION
+
+Deploying mojolicious onto white listed reverse proxy causes bundle files
+inaccessible unless the each of them are all listed. This plugin modifies the
+paths as if the files are in a single directory so that the white list can
+be a one-liner. This plugin may also avoid file name collision.
+
+=head1 METHODS
+
+=head2 register
+
+$plugin->register;
+
+Register plugin hooks in L<Mojolicious> application.
+
+=head1 AUTHOR
+
+sugama, E<lt>sugama@jamadam.comE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2011 by sugama.
+
+This program is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.
+
+=cut
@@ -48,16 +48,27 @@ Mojolicious::Plugin::UnmessifyBundle -
plugin unmessify_bundle => {prefix => 'mojolicious-bundle'};
}
+ # mod_rewrite can be as follows.
+
RewriteEngine on
RewriteRule ^(.*(\.(html|htm|xml))|/)$ http://localhost:3000$1 [L,P,QSA]
RewriteRule ^/mojolicious-bundle(/.+)$ http://localhost:3000$1 [L,P,QSA]
=head1 DESCRIPTION
-This plugin modifies bundle file paths in exception pages into given directory.
+Deploying mojolicious onto white listed reverse proxy causes bundle files
+inaccessible unless the each of them are all listed. This plugin modifies the
+paths as if the files are in a single directory so that the white list can
+be a one-liner. This plugin may also avoid file name collision.
=head1 METHODS
+=head2 register
+
+$plugin->register;
+
+Register plugin hooks in L<Mojolicious> application.
+
=head1 AUTHOR
sugama, E<lt>sugama@jamadam.comE<gt>
View
0 t/99_pod.t → xt/99_pod.t 100644 → 100755
File renamed without changes.
View
File renamed without changes.
View
@@ -0,0 +1,13 @@
+#!perl
+
+use strict;
+use Test::More;
+
+eval {
+ require Test::Perl::Critic;
+ Test::Perl::Critic->import(-profile => "xt/perlcriticrc")
+};
+
+plan skip_all => "Test::Perl::Critic is not installed." if $@;
+
+all_critic_ok("lib");
View
@@ -0,0 +1,3 @@
+# no strict 'refs'
+[TestingAndDebugging::ProhibitNoStrict]
+allow = refs
View
@@ -0,0 +1,8 @@
+use strict;
+use warnings;
+use Test::More;
+
+eval "use Test::Pod 1.18";
+plan skip_all => 'Test::Pod 1.18 required' if $@;
+plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD};
+all_pod_files_ok();
View
@@ -0,0 +1,9 @@
+use strict;
+use warnings;
+use Test::More;
+
+eval "use Test::Pod::Coverage 1.04";
+plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@;
+plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD};
+
+all_pod_coverage_ok();
View
@@ -0,0 +1,50 @@
+use strict;
+use warnings;
+use Test::More;
+use Test::Requires 'Test::Spelling';
+use Config;
+use File::Spec;
+use ExtUtils::MakeMaker;
+
+my %cmd_map = (
+ spell => 'spell',
+ aspell => 'aspell list -l en',
+ ispell => 'ispell -l',
+ hunspell => 'hunspell -d en_US -l',
+);
+
+my $spell_cmd;
+for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
+ next if $dir eq '';
+ ($spell_cmd) = map { $cmd_map{$_} } grep {
+ my $abs = File::Spec->catfile($dir, $_);
+ -x $abs or MM->maybe_command($abs);
+ } keys %cmd_map;
+ last if $spell_cmd;
+}
+$spell_cmd = $ENV{SPELL_CMD} if $ENV{SPELL_CMD};
+plan skip_all => "spell command are not available." unless $spell_cmd;
+add_stopwords(map { split /[\s\:\-]/ } <DATA>);
+set_spell_cmd($spell_cmd);
+$ENV{LANG} = 'C';
+all_pod_files_spelling_ok('lib');
+
+__DATA__
+Sugama Keita
+PluginBase
+PSTemplate
+DateTime
+timestamp
+callback
+TplExport
+jamadam
+CGI
+Django
+namespaces
+namespace
+HTML
+utf
+plugins
+mojolicious
+middleware
+middlewares

0 comments on commit a0625f6

Please sign in to comment.