Permalink
Browse files

remove legacy commands

  • Loading branch information...
typester committed Jul 8, 2010
1 parent c3c60dc commit 1b043b23c470c3fc6f78e4b049317f1453f744f7
View
@@ -31,15 +31,6 @@ requires 'Exporter::AutoClean';
requires 'Object::Container' => '0.08';
requires 'Path::AttrRouter';
-# for build-in server
-requires 'MIME::Types';
-requires 'MouseX::Types::Path::Class';
-requires 'Getopt::Long' => '2.36';
-
-# build-in helper script
-requires 'Module::Setup';
-requires 'FindBin::libs';
-
# build-in form generator/validator
requires 'HTML::Shakan' => '0.03';
requires 'Clone';
@@ -75,8 +66,6 @@ features(
use_test_base;
-install_script 'script/ark.pl';
-
if ($ENV{ANY_MOOSE_TEST} && author_context) {
# gfx++
# repeat testing
View
@@ -1,73 +0,0 @@
-package Ark::Command;
-use Any::Moose;
-
-use Pod::Usage;
-use Getopt::Long qw/GetOptionsFromArray/;
-
-no Any::Moose;
-
-sub run {
- my $self = shift;
-
- # parse command line
- my ($command, @global_args, @command_args);
- for my $arg (@ARGV) {
- if ($command) {
- push @command_args, $arg;
- }
- else {
- if ($arg =~ /^-/) {
- push @global_args, $arg;
- }
- else {
- $command = $arg;
- }
- }
- }
-
- GetOptionsFromArray(\@global_args, \my %option, qw/help/);
- $self->show_usage(0) if $option{help};
-
- # find command
- $self->show_usage unless $command;
- my $module = 'Ark::Command::' . camelize($command);
- eval "use $module";
- if ($@ or !$module->meta->does_role('Ark::Command::Interface')) {
- $self->show_usage(2, "no such command: $command")
- };
-
- $module->new->run(@command_args);
-}
-
-sub camelize {
- my $s = shift;
- join('', map{ ucfirst $_ } split(/(?<=[A-Za-z])_(?=[A-Za-z])|\b/, $s));
-}
-
-sub show_usage {
- my ($self, $exitval, $message) = @_;
-
- my $caller = caller(0);
- (my $module = $caller) =~ s!::!/!g;
- my $file = $INC{"${module}.pm"};
-
- pod2usage( -exitval => $exitval, -input => $file, -message => $message );
-}
-
-__PACKAGE__->meta->make_immutable;
-
-__END__
-
-=head1 SYNOPSIS
-
- ark.pl [command] [command_args...]
-
- Commands:
- newapp - create new application
- controller - create controller
- view - create view
- model - create model
-
- "ark.pl [command] --help" for command specific usage.
-
-=cut
@@ -1,26 +0,0 @@
-package Ark::Command::Controller;
-use Any::Moose;
-
-with 'Ark::Command::Interface::ModuleSetup';
-
-__PACKAGE__->meta->make_immutable;
-
-__END__
-
-=head1 NAME
-
-Ark::Command::Controller;
-
-=head1 SYNOPSIS
-
- ark.pl controller [options] [target] [base_class]
-
- Options:
- -i --init just init your view flavor
- -f --flavor flavor name for your template (default: default)
-
-=head1 AUTHOR
-
-Daisuke Murase <typester@cpan.org>
-
-=cut
@@ -1,52 +0,0 @@
-package Ark::Command::Flavor::Controller;
-use strict;
-use warnings;
-
-use base qw/Ark::Command::Flavor::Newapp/;
-
-sub setup_module_attribute {
- my $setup = shift;
- $setup->distribute->{dist_path} = Module::Setup::Path::Dir->new('.');
-}
-
-sub setup_template_vars {
- my ($setup, $vars) = @_;
-
- my $conf = $vars->{config};
- my $app = $conf->{ark_app};
- my $ark = $conf->{ark_script};
-
- $ark->show_usage(
- -1, "Error: can't detect ark application under this directory", ref($ark)
- ) unless $app;
-
- eval "use ${app}";
- die $@ if $@;
-
- $vars->{ark_app} = $app;
- $vars->{ark_target} = $vars->{config}{ark_class};
- $vars->{ark_base_class} = $vars->{config}{ark_base_class} || 'Controller';
-
- ($vars->{ark_app_path} = $vars->{ark_app}) =~ s!::!/!g;
- ($vars->{ark_target_path} = $vars->{ark_target}) =~ s!::!/!g;
-}
-
-1;
-
-__DATA__
-
----
-file: lib/____var-ark_app_path-var____/Controller/____var-ark_target_path-var____.pm
-template: |
- package [% ark_app %]::Controller::[% ark_target %];
- use Ark '[% ark_base_class %]';
-
- 1;
-
----
-config:
- plugins:
- - Template
- - Additional
- - +Ark::Command::Flavor::Controller
-
@@ -1,52 +0,0 @@
-package Ark::Command::Flavor::Model;
-use strict;
-use warnings;
-
-use base qw/Ark::Command::Flavor::Newapp/;
-
-sub setup_module_attribute {
- my $setup = shift;
- $setup->distribute->{dist_path} = Module::Setup::Path::Dir->new('.');
-}
-
-sub setup_template_vars {
- my ($setup, $vars) = @_;
-
- my $conf = $vars->{config};
- my $app = $conf->{ark_app};
- my $ark = $conf->{ark_script};
-
- $ark->show_usage(
- -1, "Error: can't detect ark application under this directory", ref($ark)
- ) unless $app;
-
- eval "use ${app}";
- die $@ if $@;
-
- $vars->{ark_app} = $app;
- $vars->{ark_target} = $vars->{config}{ark_class};
- $vars->{ark_base_class} = $vars->{config}{ark_base_class} || 'Model';
-
- ($vars->{ark_app_path} = $vars->{ark_app}) =~ s!::!/!g;
- ($vars->{ark_target_path} = $vars->{ark_target}) =~ s!::!/!g;
-}
-
-1;
-
-__DATA__
-
----
-file: lib/____var-ark_app_path-var____/Model/____var-ark_target_path-var____.pm
-template: |
- package [% ark_app %]::Model::[% ark_target %];
- use Ark '[% ark_base_class %]';
-
- 1;
-
----
-config:
- plugins:
- - Template
- - Additional
- - +Ark::Command::Flavor::Model
-
@@ -1,110 +0,0 @@
-package Ark::Command::Flavor::Newapp;
-use strict;
-use warnings;
-
-use base qw/Module::Setup::Plugin Module::Setup::Flavor/;
-
-sub register {
- my $self = shift;
- $self->add_trigger(after_setup_module_attribute
- => $self->can('setup_module_attribute') );
- $self->add_trigger(after_setup_template_vars
- => $self->can('setup_template_vars') );
-}
-
-sub setup_module_attribute { }
-
-sub setup_template_vars {
- my $setup = shift;
-
-
-}
-
-1;
-
-__DATA__
-
----
-file: app.psgi
-template: |
- use Plack::Builder;
- use Plack::Middleware::Static;
-
- use [% module %];
-
- my $app = [% module %]->new;
- $app->setup;
-
- builder {
- enable 'Plack::Middleware::Static',
- path => qr{^/(js/|css/|swf/|images?/|imgs?/|static/|[^/]+\.[^/]+$)},
- root => $app->path_to('root')->stringify;
-
- $app->handler;
- };
-
----
-file: Makefile.PL
-template: |
- use inc::Module::Install;
- name '[% dist %]';
- all_from 'lib/[% module_path %].pm';
-
- requires 'Ark';
-
- tests 't/*.t';
-
- build_requires 'Test::More';
- use_test_base;
- auto_include;
- WriteAll;
----
-file: t/00_compile.t
-template: |
- use strict;
- use Test::More tests => 1;
-
- BEGIN { use_ok '[% module %]' }
----
-file: lib/____var-module_path-var____.pm
-template: |
- package [% module %];
- use Ark;
-
- our $VERSION = '0.01';
-
- 1;
----
-file: lib/____var-module_path-var____/Controller/Root.pm
-template: |
- package [% module %]::Controller::Root;
- use Ark 'Controller';
-
- has '+namespace' => default => '';
-
- # default 404 handler
- sub default :Path :Args {
- my ($self, $c) = @_;
-
- $c->res->status(404);
- $c->res->body('404 Not Found');
- }
-
- sub index :Path :Args(0) {
- my ($self, $c) = @_;
- $c->res->body('Ark Default Index');
- }
-
- 1;
-
----
-dir: root
----
-dir: tmp
----
-config:
- plugins:
- - Template
- - Additional
- - +Ark::Command::Flavor::Newapp
-
@@ -1,51 +0,0 @@
-package Ark::Command::Flavor::View;
-use strict;
-use warnings;
-
-use base qw/Ark::Command::Flavor::Newapp/;
-
-sub setup_module_attribute {
- my $setup = shift;
- $setup->distribute->{dist_path} = Module::Setup::Path::Dir->new('.');
-}
-
-sub setup_template_vars {
- my ($setup, $vars) = @_;
-
- my $conf = $vars->{config};
- my $app = $conf->{ark_app};
- my $ark = $conf->{ark_script};
-
- $ark->show_usage(
- -1, "Error: can't detect ark application under this directory", ref($ark)
- ) unless $app;
-
- eval "use ${app}";
- die $@ if $@;
-
- $vars->{ark_app} = $app;
- $vars->{ark_target} = $vars->{config}{ark_class};
- $vars->{ark_base_class} = $vars->{config}{ark_base_class} || 'View';
-
- ($vars->{ark_app_path} = $vars->{ark_app}) =~ s!::!/!g;
- ($vars->{ark_target_path} = $vars->{ark_target}) =~ s!::!/!g;
-}
-
-1;
-
-__DATA__
-
----
-file: lib/____var-ark_app_path-var____/View/____var-ark_target_path-var____.pm
-template: |
- package [% ark_app %]::View::[% ark_target %];
- use Ark '[% ark_base_class %]';
-
- 1;
-
----
-config:
- plugins:
- - Template
- - Additional
- - +Ark::Command::Flavor::View
Oops, something went wrong.

0 comments on commit 1b043b2

Please sign in to comment.