Skip to content

Commit

Permalink
Rename script::simple to Applify
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Henning Thorsen committed Jan 2, 2012
1 parent bae59d0 commit 886adca
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
10 changes: 5 additions & 5 deletions Makefile.PL
@@ -1,15 +1,15 @@
use inc::Module::Install;

name q(script-simple);
all_from q(lib/script/simple.pm);
name q(Applify);
all_from q(lib/Applify.pm);

requires q(File::Basename) => 2.70;
requires q(Getopt::Long) => 2.38;
requires q(Cwd) => 3.31;

bugtracker q(http://rt.cpan.org/NoAuth/Bugs.html?Dist=script-simple);
homepage q(http://search.cpan.org/dist/script-simple);
repository q(origin);
bugtracker q(http://rt.cpan.org/NoAuth/Bugs.html?Dist=Applify);
homepage q(http://metacpan.org/dist/Applify);
repository q(https://jhthorsen@github.com/jhthorsen/Applify.git);

# install_script glob('bin/*');
auto_install;
Expand Down
6 changes: 3 additions & 3 deletions README
@@ -1,5 +1,5 @@
NAME
script::simple - Write object oriented scripts with ease
Applify - Write object oriented scripts with ease

VERSION
0.01
Expand All @@ -11,7 +11,7 @@ DESCRIPTION

SYNOPSIS
#!/usr/bin/perl
use script::simple;
use Applify;

option file => input_file => 'File to read from';
option dir => output_dir => 'Directory to write files to';
Expand Down Expand Up @@ -169,7 +169,7 @@ METHODS

import
Will export the functions listed under "EXPORTED FUNCTIONS". The
functions will act on a script::simple object created by this method.
functions will act on a Applify object created by this method.

COPYRIGHT & LICENSE
This library is free software. You can redistribute it and/or modify it
Expand Down
4 changes: 2 additions & 2 deletions example/script-simple.pl
@@ -1,6 +1,6 @@
#!/usr/bin/perl
use lib 'lib';
use script::simple;
use Applify;

option file => input_file => 'File to read from', 'Makefile.PL';
option dir => output_dir => 'Directory to write files to', '.';
Expand Down Expand Up @@ -37,6 +37,6 @@ =head1 DESCRIPTION
=head1 AUTHOR
See L<script::simple>.
See L<Applify>.
=cut
8 changes: 4 additions & 4 deletions lib/script/simple.pm → lib/Applify.pm
@@ -1,8 +1,8 @@
package script::simple;
package Applify;

=head1 NAME
script::simple - Write object oriented scripts with ease
Applify - Write object oriented scripts with ease
=head1 VERSION
Expand All @@ -17,7 +17,7 @@ are define directly in the script file and not in a module.
=head1 SYNOPSIS
#!/usr/bin/perl
use script::simple;
use Applify;
option file => input_file => 'File to read from';
option dir => output_dir => 'Directory to write files to';
Expand Down Expand Up @@ -493,7 +493,7 @@ sub _option_to_attr {
=head2 import
Will export the functions listed under L</EXPORTED FUNCTIONS>. The functions
will act on a L<script::simple> object created by this method.
will act on a L<Applify> object created by this method.
=cut

Expand Down
20 changes: 10 additions & 10 deletions t/10-script-simple.t → t/10-basic.t
Expand Up @@ -2,15 +2,15 @@ use warnings;
use strict;
use lib qw(lib);
use Test::More;
use script::simple ();
use Applify ();

plan tests => 38;

{
my $app = eval q[use script::simple; app {}] or BAIL_OUT $@;
my $app = eval q[use Applify; app {}] or BAIL_OUT $@;
my $script = $app->script;

isa_ok($script, 'script::simple');
isa_ok($script, 'Applify');
can_ok($script, qw/
option app documentation version
caller options
Expand Down Expand Up @@ -63,7 +63,7 @@ plan tests => 38;
}

my $application_class = $script->_generate_application_class(sub{});
like($application_class, qr{^script::simple::__ANON__2__::}, 'generated application class');
like($application_class, qr{^Applify::__ANON__2__::}, 'generated application class');
can_ok($application_class, qw/
new run script
foo_bar foo_2 foo_3
Expand All @@ -82,8 +82,8 @@ Usage:

eval { $script->documentation(undef) };
like($@, qr{Usage: documentation }, 'need to give documentation(...) a true value');
is($script->documentation('script::simple'), $script, 'documentation(...) return $self on set');
is($script->documentation, 'script::simple', 'documentation() return what was set');
is($script->documentation('Applify'), $script, 'documentation(...) return $self on set');
is($script->documentation, 'Applify', 'documentation() return what was set');

eval { $script->print_version };
like($@, qr{Cannot print version}, 'cannot print version without version(...)');
Expand All @@ -107,20 +107,20 @@ Usage:
HELP

is((run_method($script, 'print_version'))[0], <<' VERSION', 'print_version(numeric)');
10-script-simple.t version 1.23
10-basic.t version 1.23
VERSION

$script->version('script::simple');
$script->version('Applify');
is((run_method($script, 'print_version'))[0], <<" VERSION", 'print_version(module)');
10-script-simple.t version $script::simple::VERSION
10-basic.t version $Applify::VERSION
VERSION
}

{
my $app = do 'example/script-simple.pl';
my $script = $app->script;

isa_ok($script, 'script::simple');
isa_ok($script, 'Applify');
can_ok($app, qw/ input_file output_dir dry_run generate_exit_value /);

eval { run_method($app, 'run') };
Expand Down
4 changes: 2 additions & 2 deletions t/20-moose.t
Expand Up @@ -2,7 +2,7 @@ use warnings;
use strict;
use lib qw(lib);
use Test::More;
use script::simple ();
use Applify ();

plan skip_all => 'Moose is not available' unless(eval 'use Moose; 1');
plan tests => 5;
Expand All @@ -20,7 +20,7 @@ plan tests => 5;

local @ARGV = qw/ --o-foo 42 /;
my $app = eval q[
use script::simple;
use Applify;
extends 'My::Class';
option int => o_foo => 'Some option';
app {
Expand Down

0 comments on commit 886adca

Please sign in to comment.