Permalink
Browse files

Renamed Mowyw to App::Mowyw

This is in preparation of a CPAN release of mowyw
  • Loading branch information...
1 parent 3a2dd1d commit c16fb9fba8b26684d9b524dc8ddce9e38b06f680 @moritz committed Jun 10, 2011
View
2 Build.PL
@@ -10,7 +10,7 @@ my $build = Module::Build->new(
module_name => 'mowyw',
dist_author => 'Moritz Lenz',
dist_abstract => 'Macro processor for creating static HTML pages',
- dist_version_from => 'lib/Mowyw.pm',
+ dist_version_from => 'lib/App/Mowyw.pm',
requires => {
'perl' => '5.8.1',
'Carp' => 0,
View
14 lib/Mowyw.pm → lib/App/Mowyw.pm
@@ -1,12 +1,12 @@
-package Mowyw;
+package App::Mowyw;
use strict;
use warnings;
#use warnings FATAL => 'all';
our $VERSION = '0.6.2';
-use Mowyw::Lexer qw(lex);
-use Mowyw::Datasource;
+use App::Mowyw::Lexer qw(lex);
+use App::Mowyw::Datasource;
use File::Temp qw(tempfile);
use File::Compare;
@@ -272,7 +272,7 @@ sub p_bind {
if ($options{file}){
$options{file} = get_include_filename('include', $options{file}, $meta->{FILES}->[-1]);
}
- $meta->{VARS}{$var} = Mowyw::Datasource->new(\%options);
+ $meta->{VARS}{$var} = App::Mowyw::Datasource->new(\%options);
return '';
}
@@ -441,7 +441,7 @@ sub parse_hash {
sub my_dclone {
# dclone can't handle code references, which is very bad
- # becase DBI objects from Mowyw::Datasource::DBI hold code refs.
+ # becase DBI objects from App::Mowyw::Datasource::DBI hold code refs.
# so we don't clone blessed objects at all, but pass a reference instead.
my $meta = shift;
my %result;
@@ -739,8 +739,8 @@ sub process_file {
# process file at all?
my $process = 0;
# use Data::Dumper;
-# print Dumper $Mowyw::config{file_filter};
- for my $f(@{$Mowyw::config{file_filter}}){
+# print Dumper $App::Mowyw::config{file_filter};
+ for my $f(@{$App::Mowyw::config{file_filter}}){
my ($include, undef, $re) = @$f;
if ($fn =~ m/$re/){
$process = $include;
View
4 lib/Mowyw/Datasource.pm → lib/App/Mowyw/Datasource.pm
@@ -1,4 +1,4 @@
-package Mowyw::Datasource;
+package App::Mowyw::Datasource;
use strict;
use warnings;
use Carp qw(confess);
@@ -14,7 +14,7 @@ sub new {
my $type = lc($opts->{type}) or confess "No 'type' given";
delete $opts->{type};
my $type_name = $type_map{$type} || confess "Don't know what to do with datasource type '$type'";
- $type_name = "Mowyw::Datasource::$type_name";
+ $type_name = "App::Mowyw::Datasource::$type_name";
eval "use $type_name;";
confess $@ if $@;
my $obj = eval $type_name . "->new(\$opts)" or confess $@;
View
4 lib/Mowyw/Datasource/Array.pm → lib/App/Mowyw/Datasource/Array.pm
@@ -1,8 +1,8 @@
-package Mowyw::Datasource::Array;
+package App::Mowyw::Datasource::Array;
use strict;
use warnings;
-use base 'Mowyw::Datasource';
+use base 'App::Mowyw::Datasource';
use Scalar::Util qw(reftype);
use Carp qw(confess);
View
4 lib/Mowyw/Datasource/DBI.pm → lib/App/Mowyw/Datasource/DBI.pm
@@ -1,11 +1,11 @@
-package Mowyw::Datasource::DBI;
+package App::Mowyw::Datasource::DBI;
use strict;
use warnings;
use 5.008;
use Encode qw(decode);
use DBI;
use Carp qw(confess);
-use base 'Mowyw::Datasource';
+use base 'App::Mowyw::Datasource';
sub new {
my ($class, $opts) = @_;
View
4 lib/Mowyw/Datasource/XML.pm → lib/App/Mowyw/Datasource/XML.pm
@@ -1,8 +1,8 @@
-package Mowyw::Datasource::XML;
+package App::Mowyw::Datasource::XML;
use strict;
use warnings;
-use base 'Mowyw::Datasource::Array';
+use base 'App::Mowyw::Datasource::Array';
use XML::Simple;
use Scalar::Util qw(reftype);
View
8 lib/Mowyw/Lexer.pm → lib/App/Mowyw/Lexer.pm
@@ -1,16 +1,16 @@
#!/usr/bin/perl
use warnings;
use strict;
-package Mowyw::Lexer;
+package App::Mowyw::Lexer;
=pod
=head1 NAME
-Mowyw::Lexer - Simple Lexer
+App::Mowyw::Lexer - Simple Lexer
=head1 SYNOPSIS
- use Mowyw::Lexer qw(lex);
+ use App::Mowyw::Lexer qw(lex);
# suppose you want to parse simple math expressions
my @input_tokens = (
['Int', qr/(?:-|\+)?\d+/],
@@ -28,7 +28,7 @@ Mowyw::Lexer - Simple Lexer
=head1 DESCRIPTION
-Mowyw::Lexer is a simple lexer that breaks up a text into tokens according to
+App::Mowyw::Lexer is a simple lexer that breaks up a text into tokens according to
regexes you provide.
The only exported subroutine is C<lex>, which expects input text as its first
View
26 mowyw
@@ -21,26 +21,26 @@ use strict;
use FindBin;
use lib "$FindBin::Bin/lib";
require 5.008001;
-use Mowyw qw(get_config process_file process_dir parse_all_in_dir);
+use App::Mowyw qw(get_config process_file process_dir parse_all_in_dir);
use Getopt::Long;
-$Mowyw::config{make_behaviour} = undef;
+$App::Mowyw::config{make_behaviour} = undef;
my $result = GetOptions(
- "make" => \$Mowyw::config{make_behaviour},
- "postfix=s" => \$Mowyw::config{default}{postfix},
- "includes-prefix=s" => \$Mowyw::config{default}{include},
- "menu-prefix=s" => \$Mowyw::config{default}{menu},
- "destination-prefix=s" => \$Mowyw::config{default}{online},
- "source-prefix=s" => \$Mowyw::config{default}{source},
- "encoding=s" => \$Mowyw::config{encoding},
- "quiet" => \$Mowyw::config{quiet},
+ "make" => \$App::Mowyw::config{make_behaviour},
+ "postfix=s" => \$App::Mowyw::config{default}{postfix},
+ "includes-prefix=s" => \$App::Mowyw::config{default}{include},
+ "menu-prefix=s" => \$App::Mowyw::config{default}{menu},
+ "destination-prefix=s" => \$App::Mowyw::config{default}{online},
+ "source-prefix=s" => \$App::Mowyw::config{default}{source},
+ "encoding=s" => \$App::Mowyw::config{encoding},
+ "quiet" => \$App::Mowyw::config{quiet},
);
-($Mowyw::config{per_fn}, $Mowyw::config{file_filter}) = get_config();
+($App::Mowyw::config{per_fn}, $Mowyw::config{file_filter}) = get_config();
#use Data::Dumper;
-#print Dumper $Mowyw::config{file_filter};
+#print Dumper $App::Mowyw::config{file_filter};
-parse_all_in_dir($Mowyw::config{default}{source});
+parse_all_in_dir($App::Mowyw::config{default}{source});
__END__
=head1 NAME
View
2 t/00-use.t
@@ -1,4 +1,4 @@
use Test::More tests => 1;
use strict;
use warnings;
-use_ok('Mowyw');
+use_ok('App::Mowyw');
View
2 t/comment.t
@@ -2,7 +2,7 @@ use Test::More tests => 2;
use strict;
use warnings;
-BEGIN { use_ok('Mowyw', 'parse_str'); };
+BEGIN { use_ok('App::Mowyw', 'parse_str'); };
my %meta = ( VARS => {} );
View
12 t/complete.t
@@ -2,15 +2,15 @@ use Test::More tests => 6;
use strict;
use warnings;
-BEGIN { use_ok('Mowyw', 'parse_all_in_dir'); };
+BEGIN { use_ok('App::Mowyw', 'parse_all_in_dir'); };
my %meta = ( VARS => {} );
-$Mowyw::config{default}{include} = 't/complete/includes/';
-$Mowyw::config{default}{source} = 't/complete/source/';
-$Mowyw::config{default}{online} = 't/complete/online/';
-$Mowyw::config{default}{postfix} = '';
-$Mowyw::Quiet = 1;
+$App::Mowyw::config{default}{include} = 't/complete/includes/';
+$App::Mowyw::config{default}{source} = 't/complete/source/';
+$App::Mowyw::config{default}{online} = 't/complete/online/';
+$App::Mowyw::config{default}{postfix} = '';
+$App::Mowyw::Quiet = 1;
ok eval {
parse_all_in_dir('t/complete/source/');
View
12 t/datasource-array.t
@@ -4,19 +4,19 @@ use lib qw(blib);
use Test::More tests => 12;
BEGIN {
- use_ok 'Mowyw::Datasource';
- use_ok 'Mowyw::Datasource::Array';
+ use_ok 'App::Mowyw::Datasource';
+ use_ok 'App::Mowyw::Datasource::Array';
}
my $a = eval {
- Mowyw::Datasource->new({
+ App::Mowyw::Datasource->new({
type => 'Array',
source => [qw(foo bar baz)],
});
};
print $@ if $@;
-ok !$@, 'No errors while creating Mowyw::Datasource::Array instance';
+ok !$@, 'No errors while creating App::Mowyw::Datasource::Array instance';
ok !$a->is_exhausted(), 'fresh iterator not exhausted';
is $a->get(), 'foo', 'First item correct';
@@ -33,15 +33,15 @@ $a->next();
ok $a->is_exhausted, 'Iterator now exhausted';
eval {
- Mowyw::Datasource->new({
+ App::Mowyw::Datasource->new({
type => 'Array',
});
};
ok $@, 'new() dies when "source" argument is missing';
eval {
- Mowyw::Datasource->new({
+ App::Mowyw::Datasource->new({
type => 'Array',
source => { a => 'b' },
});
View
6 t/datasource.t
@@ -12,12 +12,12 @@ BEGIN {
}
}
-BEGIN { use_ok('Mowyw', 'parse_str'); };
+BEGIN { use_ok('App::Mowyw', 'parse_str'); };
my %meta = ( VARS => {}, FILES => [qw(t/datasource.t)]);
-$Mowyw::config{default}{include} = 't/';
-$Mowyw::config{default}{postfix} = '';
+$App::Mowyw::config{default}{include} = 't/';
+$App::Mowyw::config{default}{postfix} = '';
is parse_str('[% bind a type:xml file:sample.xml root:item %]', \%meta),
'',
View
14 t/datasource_xml.t
@@ -14,19 +14,19 @@ BEGIN {
}
BEGIN {
- use_ok 'Mowyw::Datasource';
- use_ok 'Mowyw::Datasource::XML';
+ use_ok 'App::Mowyw::Datasource';
+ use_ok 'App::Mowyw::Datasource::XML';
}
my $x = eval {
- Mowyw::Datasource->new({
+ App::Mowyw::Datasource->new({
type => 'XML',
file => 't/sample.xml',
});
};
print $@ if $@;
-ok !$@, 'No errors while creating Mowyw::Datasource::XML instance';
+ok !$@, 'No errors while creating App::Mowyw::Datasource::XML instance';
ok !$x->is_exhausted, 'Iterator not yet exhausted';
@@ -48,7 +48,7 @@ ok $x->is_exhausted, 'Iterator exhausted';
# next test file
-$x = Mowyw::Datasource->new({
+$x = App::Mowyw::Datasource->new({
type => 'XML',
file => 't/sample-single.xml',
root => 'item',
@@ -63,7 +63,7 @@ $x->next();
ok $x->is_exhausted, 'Iterator exhausted';
eval {
- Mowyw::Datasource->new({
+ App::Mowyw::Datasource->new({
type => 'XML',
file => 't/sample-bad.xml',
});
@@ -73,7 +73,7 @@ ok $@, 'Dies with ambigous root element';
# test limits
$x = eval {
- Mowyw::Datasource->new({
+ App::Mowyw::Datasource->new({
type => 'XML',
file => 't/sample.xml',
limit => 2,
View
6 t/include.t
@@ -3,11 +3,11 @@ use strict;
use warnings;
use Data::Dumper;
-BEGIN { use_ok('Mowyw', 'parse_str'); };
+BEGIN { use_ok('App::Mowyw', 'parse_str'); };
my %meta = ( VARS => {}, FILES => [qw(t/include.t)]);
-$Mowyw::config{default}{include} = 't/';
-$Mowyw::config{default}{postfix} = '';
+$App::Mowyw::config{default}{include} = 't/';
+$App::Mowyw::config{default}{postfix} = '';
is parse_str('[%setvar t foo %][%include sample-include%]', \%meta),
"sample include file !foo!\n",
View
2 t/lexer.t
@@ -1,7 +1,7 @@
use strict;
use warnings;
use lib 'lib';
-use Mowyw::Lexer qw(lex);
+use App::Mowyw::Lexer qw(lex);
use Test::More tests => 13;
my @tokens = (
View
8 t/menu.t
@@ -2,12 +2,12 @@ use Test::More tests => 6;
use strict;
use warnings;
-BEGIN { use_ok('Mowyw', 'parse_str'); };
+BEGIN { use_ok('App::Mowyw', 'parse_str'); };
my %meta = ( VARS => {}, FILES => [qw(t/menu.t)]);
-$Mowyw::config{default}{include} = 't/';
-$Mowyw::config{default}{menu} = 't/menu-';
-$Mowyw::config{default}{postfix} = '';
+$App::Mowyw::config{default}{include} = 't/';
+$App::Mowyw::config{default}{menu} = 't/menu-';
+$App::Mowyw::config{default}{postfix} = '';
is parse_str('[% menu sample %]', \%meta),
View
2 t/options.t
@@ -2,7 +2,7 @@ use Test::More tests => 3;
use strict;
use warnings;
-BEGIN { use_ok('Mowyw', 'parse_str'); };
+BEGIN { use_ok('App::Mowyw', 'parse_str'); };
my %meta = ( OPTIONS => {}, );
View
2 t/parse-errors.t
@@ -2,7 +2,7 @@ use Test::More tests => 10;
use strict;
use warnings;
-BEGIN { use_ok('Mowyw', 'parse_str'); };
+BEGIN { use_ok('App::Mowyw', 'parse_str'); };
my %meta = ( VARS => {}, FILES => ['none'], );
View
4 t/syntax.t
@@ -2,9 +2,9 @@ use Test::More tests => 3;
use strict;
use warnings;
-BEGIN { use_ok('Mowyw', 'parse_str'); };
+BEGIN { use_ok('App::Mowyw', 'parse_str'); };
-$Mowyw::Quiet = 1;
+$App::Mowyw::Quiet = 1;
{
# Test without Vim::TextColor first
View
2 t/variables.t
@@ -2,7 +2,7 @@ use Test::More tests => 8;
use strict;
use warnings;
-BEGIN { use_ok('Mowyw', 'parse_str'); };
+BEGIN { use_ok('App::Mowyw', 'parse_str'); };
my %meta = ( VARS => {} );
View
2 t/verbatim.t
@@ -2,7 +2,7 @@ use Test::More tests => 3;
use strict;
use warnings;
-BEGIN { use_ok('Mowyw', 'parse_str'); };
+BEGIN { use_ok('App::Mowyw', 'parse_str'); };
my $wild_text = 'some [% foo bar {{ tags with readvar keywords';

0 comments on commit c16fb9f

Please sign in to comment.