Changeset 22113 for lang/perl/Module-Setup
- Timestamp:
- 10/25/08 20:21:03 (5 years ago)
- Location:
- lang/perl/Module-Setup/trunk
- Files:
-
- 1 added
- 7 modified
-
bin/module-setup (modified) (1 diff)
-
lib/Module/Setup.pm (modified) (4 diffs)
-
lib/Module/Setup/Devel.pm (added)
-
lib/Module/Setup/Distribute.pm (modified) (3 diffs)
-
lib/Module/Setup/Path/Flavor.pm (modified) (2 diffs)
-
lib/Module/Setup/Test/Flavor.pm (modified) (1 diff)
-
t/010_core/setup_options.t (modified) (2 diffs)
-
t/97_podspell.t (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/Module-Setup/trunk/bin/module-setup
r21798 r22113 47 47 --help Show this message 48 48 49 For Devel: 50 51 --devel for flavor development 52 --test develpoment flavor test 53 54 $ module-setup --devel FlavorClassName # create skeleton 55 $ cd FlavorClassName 56 $ # edit 57 $ module-setup --devel --test # flavor test 58 $ module-setup --devel --pack # flavor packing 59 49 60 =cut 50 61 -
lang/perl/Module-Setup/trunk/lib/Module/Setup.pm
r22050 r22113 17 17 use Pod::Usage; 18 18 19 use Module::Setup::Devel; 19 20 use Module::Setup::Distribute; 20 21 use Module::Setup::Path; 22 use Module::Setup::Path::Flavor; 21 23 use Module::Setup::Path::Template; 22 24 … … 75 77 'target' => \($options->{target}), 76 78 'module-setup-dir' => \($options->{module_setup_dir}), 79 'devel' => \($options->{devel}), 80 'test' => \($options->{test}), 77 81 version => \&_setup_options_version, 78 82 help => \&_setup_options_pod2usage, … … 123 127 124 128 $options->{flavor_class} ||= 'Default'; 129 return Module::Setup::Devel->new($self)->run if $options->{devel}; 130 125 131 $self->setup_base_dir; 126 132 … … 421 427 422 428 my $template = []; 423 $self->_collect_flavor_files($template, file => $self->base_dir->flavor->template); 424 $self->_collect_flavor_files($template, plugin => $self->base_dir->flavor->plugins); 429 my $flavor_dir = exists $config->{flavor_dir} ? Module::Setup::Path::Flavor->new( $config->{flavor_dir} ) : $self->base_dir->flavor; 430 $self->_collect_flavor_files($template, file => $flavor_dir->template); 431 $self->_collect_flavor_files($template, plugin => $flavor_dir->plugins); 425 432 push @{ $template }, +{ 426 config => YAML::LoadFile($ self->base_dir->flavor->config->path),433 config => YAML::LoadFile($flavor_dir->config->path), 427 434 }; 428 435 429 436 unless ($config->{without_additional}) { 430 437 $template = [] if $config->{additional}; 431 for my $additional ( $ self->base_dir->flavor->additional->path->children ) {438 for my $additional ( $flavor_dir->additional->path->children ) { 432 439 next unless $additional->is_dir; 433 440 my $name = $additional->dir_list(-1); 434 441 next if $config->{additional} && $name ne $config->{additional}; 435 my $base_path = Module::Setup::Path::Template->new($ self->base_dir->flavor->additional->path, $name);442 my $base_path = Module::Setup::Path::Template->new($flavor_dir->additional->path, $name); 436 443 437 444 my $templates = []; -
lang/perl/Module-Setup/trunk/lib/Module/Setup/Distribute.pm
r21981 r22113 4 4 5 5 use Fcntl qw( :mode ); 6 use YAML (); 6 7 7 8 use Module::Setup::Path::Dir; … … 20 21 }, $class; 21 22 23 $self->{target_path} = Module::Setup::Path::Dir->new($target); 22 24 $self->{base_path} = Module::Setup::Path::Dir->new($target, $self->{dist_name}); 23 25 $self->{dist_path} = Module::Setup::Path::Dir->new($target, $self->{dist_name}); … … 33 35 sub package { shift->{package} }; 34 36 sub dist_name { shift->{dist_name} }; 37 sub target_path { shift->{target_path} }; 35 38 sub base_path { shift->{base_path} }; 36 39 sub dist_path { shift->{dist_path} }; -
lang/perl/Module-Setup/trunk/lib/Module/Setup/Path/Flavor.pm
r21792 r22113 3 3 use warnings; 4 4 use base 'Module::Setup::Path::Base'; 5 6 use YAML (); 5 7 6 8 use Module::Setup::Path::Config; … … 26 28 sub additional { shift->{additional} } 27 29 30 sub create_flavor { 31 my($self, $config) = @_; 32 33 $self->path->mkpath; 34 $self->plugins->path->mkpath; 35 $self->template->path->mkpath; 36 $self->additional->path->mkpath; 37 YAML::DumpFile($self->config->path, $config); 38 } 39 28 40 1; -
lang/perl/Module-Setup/trunk/lib/Module/Setup/Test/Flavor.pm
r22043 r22113 80 80 } 81 81 } 82 82 83 83 plan tests => $count; 84 84 module_setup $options, $module; -
lang/perl/Module-Setup/trunk/t/010_core/setup_options.t
r22023 r22113 22 22 additional => undef, 23 23 without_additional => undef, 24 devel => undef, 25 test => undef, 24 26 %{ $block->options || {} }, 25 27 }; … … 116 118 pack: 1 117 119 without_additional: 1 120 121 === 122 --- input 123 --devel 124 --test 125 --- argv 126 --- options 127 devel: 1 128 test: 1 -
lang/perl/Module-Setup/trunk/t/97_podspell.t
r22030 r22113 20 20 utils 21 21 PBP pbp 22 devel
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)