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