Revision 661,
1.2 KB
checked in by iwaim, 14 years ago
(diff) |
v-s-s: 0.3 release
|
Rev | Line | |
---|
[488] | 1 | package VineLinux::VSS; |
---|
| 2 | |
---|
| 3 | use strict; |
---|
| 4 | use warnings; |
---|
| 5 | |
---|
[492] | 6 | use VineLinux::VSS::ConfigLoader; |
---|
[488] | 7 | use VineLinux::VSS::Type::Elisp; |
---|
| 8 | use VineLinux::VSS::Type::SelfBuild; |
---|
[494] | 9 | use VineLinux::VSS::Type::PerlModule; |
---|
[488] | 10 | |
---|
| 11 | use base qw( Class::Accessor::Fast ); |
---|
[492] | 12 | __PACKAGE__->mk_accessors( qw(type package_name packager_name packager_fullname packager_email) ); |
---|
[488] | 13 | |
---|
[661] | 14 | our $VERSION = '0.3'; |
---|
[488] | 15 | |
---|
| 16 | sub new{ |
---|
| 17 | my ($class, %opt) = @_; |
---|
| 18 | |
---|
| 19 | my $self = bless { |
---|
| 20 | type => '', |
---|
| 21 | }, $class; |
---|
[492] | 22 | |
---|
| 23 | my $loader = VineLinux::VSS::ConfigLoader->new; |
---|
| 24 | my $config = $loader->load($opt{config}, $self); |
---|
| 25 | |
---|
[488] | 26 | $self->type($opt{type}); |
---|
[491] | 27 | $self->package_name($opt{package_name}); |
---|
[488] | 28 | |
---|
| 29 | return $self; |
---|
| 30 | } |
---|
| 31 | |
---|
| 32 | sub run{ |
---|
| 33 | my $class = shift; |
---|
| 34 | |
---|
| 35 | my $type = $class->type; |
---|
| 36 | print "generating sleleton files: " . $type . "\n"; |
---|
| 37 | |
---|
| 38 | if ($type eq 'elisp') { |
---|
[492] | 39 | VineLinux::VSS::Type::Elisp->generate($class); |
---|
[488] | 40 | } elsif ($type eq 'self-build') { |
---|
[492] | 41 | VineLinux::VSS::Type::SelfBuild->generate($class); |
---|
[494] | 42 | } elsif ($type eq 'perlmodule') { |
---|
| 43 | VineLinux::VSS::Type::PerlModule->generate($class); |
---|
[488] | 44 | } |
---|
| 45 | |
---|
| 46 | print "done.\n"; |
---|
| 47 | return $class; |
---|
| 48 | } |
---|
| 49 | |
---|
| 50 | sub bootstrap{ |
---|
| 51 | my $class = shift; |
---|
| 52 | my $self = $class->new(@_); |
---|
| 53 | $self->run(); |
---|
| 54 | return $self; |
---|
| 55 | } |
---|
| 56 | |
---|
| 57 | 1; |
---|
| 58 | |
---|
Note: See
TracBrowser
for help on using the repository browser.