Permalink
Browse files

added simple starter

  • Loading branch information...
dann committed Dec 21, 2008
1 parent 011b696 commit 4c5b9512949914f8ad36b60b22a66960b07da12c
View
@@ -20,6 +20,8 @@ requires 'Kwalify';
build_requires 'Test::More';
+install_script 'bin/angelos-gen';
+
author_tests('xt');
use_test_base;
auto_include;
View
17 TODO
@@ -1,17 +0,0 @@
-- setup home
-
-controller
- -- begin
- -- end
- - context
- -- forward
- -- detach
-
-view
- -- auto render based on action
- --- how should we get action?
-
-config loader
-
-plugin system
- - Class::Trigger?
View
@@ -0,0 +1,11 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+#use Carp::Always;
+use Angelos::Script::Generate;
+
+my $flavor_type= $ARGV[0];
+my $module = $ARGV[1];
+warn $module;
+Angelos::Script::Generate->run($flavor_type, $module);
+
@@ -4,7 +4,7 @@ use Text::SimpleTable;
sub show_components {
my ( $class, $components ) = @_;
my $report = $class->_make_components_report($components);
- print $report;
+ print $report . "\n";
}
sub _make_components_report {
@@ -8,7 +8,7 @@ our $VERSION = '0.0008';
=head1 NAME
- MooseX::Object::Pluggable - Make your classes pluggable
+ Angelos::Role::Pluggable - Make your classes pluggable
=head1 SYNOPSIS
@@ -1,13 +1,30 @@
package Angelos::Script::Generate;
use Mouse;
use Module::Setup;
+use String::CamelCase qw(camelize);
extends 'Angelos::Script';
+
no Mouse;
sub run {
- # FIXME fix later
- my $options = {};
- Module::Setup->new( options => $options )->run;
+ my ( $class, $flavor_type, $module ) = @_;
+
+ local $ENV{MODULE_SETUP_DIR} = '/tmp/module-setup';
+ my $plugins = [];
+ my $flavor_class = $class->to_flavor_class($flavor_type);
+ my $options = {
+ module => $module,
+ plugins => $plugins,
+ flavor_class => $flavor_class,
+ };
+ my $argv = [$module];
+ my $pmsetup = Module::Setup->new( options => $options, argv => $argv );
+ $pmsetup->run( $options, [ $module, $flavor_class ] );
+}
+
+sub to_flavor_class {
+ my ( $class, $flavor_type ) = @_;
+ "+Angelos::Script::Generate::Flavor::" . camelize($flavor_type);
}
1;
Oops, something went wrong.

0 comments on commit 4c5b951

Please sign in to comment.