Changeset 8968 for lang/perl/App-Starter
- Timestamp:
- 04/06/08 10:59:16 (8 months ago)
- Location:
- lang/perl/App-Starter/trunk
- Files:
-
- 4 modified
-
Changes (modified) (1 diff)
-
Makefile.PL (modified) (1 diff)
-
bin/app-starter-catalyst.pl (modified) (1 diff)
-
lib/App/Starter.pm (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/App-Starter/trunk/Changes
r8498 r8968 1 1 Revision history for App-Starter 2 3 0.09 2008-04-06/10:54 4 - Fix type 2 5 3 6 0.08 2008-03-29/15:24 -
lang/perl/App-Starter/trunk/Makefile.PL
r8490 r8968 1 1 use inc::Module::Install; 2 name 'App-Starter';3 all_from 'lib/App/Starter.pm';4 requires 'Test::More'=> 0;5 requires 'YAML::Syck'=> 0;6 requires 'Template'=> 0;7 requires 'IO::All'=> 0;8 requires 'Class::Accessor'=> 0;9 requires 'FindBin::libs'=> 0;10 requires 'Getopt::Long'=> 0;2 name 'App-Starter'; 3 all_from 'lib/App/Starter.pm'; 4 requires 'Test::More' => 0; 5 requires 'YAML::Syck' => 0; 6 requires 'Template' => 0; 7 requires 'IO::All' => 0; 8 requires 'Class::Accessor' => 0; 9 requires 'FindBin::libs' => 0; 10 requires 'Getopt::Long' => 0; 11 11 install_script glob('bin/*.pl'); 12 licence 'perl' => 0; 12 13 auto_install; 13 14 WriteAll; -
lang/perl/App-Starter/trunk/bin/app-starter-catalyst.pl
r8953 r8968 15 15 =head1 NAME 16 16 17 app-starter-catalyst.pl - App::Starter script file .17 app-starter-catalyst.pl - App::Starter script file for catalyst. 18 18 19 19 =head1 SYNOPSIS -
lang/perl/App-Starter/trunk/lib/App/Starter.pm
r8953 r8968 13 13 use base qw/Class::Accessor/; 14 14 15 our $VERSION = '0.0 8';15 our $VERSION = '0.09'; 16 16 17 17 my $DIR = {}; … … 38 38 39 39 my $conf_file = ''; 40 if (-e File::Spec->catfile( $ENV{HOME}, '/.app-starter/conf', $config->{template} . '.yml' ) ) { 41 $conf_file = File::Spec->catfile( $ENV{HOME}, '/.app-starter/conf', $config->{template} . '.yml' ) ; 40 if (-e File::Spec->catfile( 41 $ENV{HOME}, '/.app-starter/conf', 42 $config->{template} . '.yml' 43 ) 44 ) 45 { 46 $conf_file 47 = File::Spec->catfile( $ENV{HOME}, '/.app-starter/conf', 48 $config->{template} . '.yml' ); 42 49 } 43 50 else { 44 $conf_file = File::Spec->catfile( $ENV{HOME}, '/.app-starter/conf', $config->{template} . '.yaml' ); 45 } 46 47 $self->{config} = $conf_file ; 51 $conf_file 52 = File::Spec->catfile( $ENV{HOME}, '/.app-starter/conf', 53 $config->{template} . '.yaml' ); 54 } 55 56 $self->{config} = $conf_file; 48 57 } 49 58 … … 131 140 =head1 SYNOPSIS 132 141 133 134 my $app = App::Starter->new( { config => ' /home/tomyhero/work/App-Starter/conf/config.yml' } )->create; 135 136 # or 137 # from = 'tmp/a' , replace => { module => 'MyApp' } overwrite config.yml setting. 138 my $app = App::Starter->new( { config => '/home/tomyhero/work/App-Starter/conf/config.yml' , from => '/tmp/a' , name => 'my_app' , replace => { module => 'MyApp' } } )->create; 139 140 # or even you can use ~/.app-sterter 141 142 #~/.app-starter 143 #|-- conf 144 #| `-- sample.conf 145 #`-- skel 146 # `-- sample 147 # |-- bin 148 # | `-- __app__.pl 149 # `-- lib 150 # `-- __app__ 151 # `-- Foo.pm 152 my $app = App::Starter->new( { template => 'sample' , name =>'foo' } )->create; 142 my $app 143 = App::Starter->new( 144 { config => ' /tmp/conf/config.yml' } ) 145 ->create; 146 147 # or 148 # from = 'tmp/a' , replace => { module => 'MyApp' } overwrite config.yml setting. 149 my $app = App::Starter->new( 150 { config => '/tmp/conf/config.yml', 151 from => '/tmp/a', 152 name => 'my_app', 153 replace => { module => 'MyApp' } 154 } 155 )->create; 156 157 # or even you can use ~/.app-sterter so taht you do not need to hve from and config options 158 159 #~/.app-starter 160 #|-- conf 161 #| `-- sample.conf 162 #`-- skel 163 # `-- sample 164 # |-- bin 165 # | `-- __app__.pl 166 # `-- lib 167 # `-- __app__ 168 # `-- Foo.pm 169 my $app 170 = App::Starter->new( { template => 'sample', name => 'foo' } )->create; 153 171 154 172 =head1 DESCRIPTION … … 156 174 you can start your application quickly once you craete skelton with this module. This module only does is rename key to value. in your template file, you can set like this [% key_name %] 157 175 which replace with value you set in config. and also you can use __key_name__ format as file or directory name which replace as rule you set at config 176 177 I recommend to use ~/.app-starter directory to store your app-starter data 158 178 159 179 =head1 CONFIG … … 172 192 =head2 new 173 193 174 constractor194 constractor 175 195 176 196 =head2 create … … 184 204 dann 185 205 206 =head1 COPYRIGHT AND LISENCE 207 208 Copyright (c) Tomohiro Teranishi, All rights reserved. 209 210 This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See L<perlartistic>. 211 186 212 =cut
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)