Revision 3225,
1.3 KB
checked in by iwaim, 13 years ago
(diff) |
version 0.4 release
|
Line | |
---|
1 | package VineLinux::VSS; |
---|
2 | |
---|
3 | use strict; |
---|
4 | use warnings; |
---|
5 | |
---|
6 | use VineLinux::VSS::ConfigLoader; |
---|
7 | use VineLinux::VSS::Type::Elisp; |
---|
8 | use VineLinux::VSS::Type::SelfBuild; |
---|
9 | use VineLinux::VSS::Type::PerlModule; |
---|
10 | use VineLinux::VSS::Init; |
---|
11 | |
---|
12 | use base qw( Class::Accessor::Fast ); |
---|
13 | __PACKAGE__->mk_accessors( qw(type package_name packager_name packager_fullname packager_email) ); |
---|
14 | |
---|
15 | our $VERSION = '0.4'; |
---|
16 | |
---|
17 | sub new{ |
---|
18 | my ($class, %opt) = @_; |
---|
19 | |
---|
20 | my $self = bless { |
---|
21 | type => '', |
---|
22 | }, $class; |
---|
23 | |
---|
24 | my $loader = VineLinux::VSS::ConfigLoader->new; |
---|
25 | my $config = $loader->load($opt{config}, $self); |
---|
26 | |
---|
27 | $self->type($opt{type}); |
---|
28 | $self->package_name($opt{package_name}); |
---|
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"; |
---|
38 | |
---|
39 | if ($type eq 'elisp') { |
---|
40 | VineLinux::VSS::Type::Elisp->generate($class); |
---|
41 | } elsif ($type eq 'self-build') { |
---|
42 | VineLinux::VSS::Type::SelfBuild->generate($class); |
---|
43 | } elsif ($type eq 'perlmodule') { |
---|
44 | VineLinux::VSS::Type::PerlModule->generate($class); |
---|
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 | |
---|
58 | sub init{ |
---|
59 | my $class = shift; |
---|
60 | my $config = shift; |
---|
61 | VineLinux::VSS::Init->run($config); |
---|
62 | } |
---|
63 | |
---|
64 | 1; |
---|
Note: See
TracBrowser
for help on using the repository browser.