Revision 500,
1.2 KB
checked in by iwaim, 14 years ago
(diff) |
vine-spec-skeleton: 0.2 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 | |
---|
11 | use base qw( Class::Accessor::Fast ); |
---|
12 | __PACKAGE__->mk_accessors( qw(type package_name packager_name packager_fullname packager_email) ); |
---|
13 | |
---|
14 | our $VERSION = '0.2'; |
---|
15 | |
---|
16 | sub new{ |
---|
17 | my ($class, %opt) = @_; |
---|
18 | |
---|
19 | my $self = bless { |
---|
20 | type => '', |
---|
21 | }, $class; |
---|
22 | |
---|
23 | my $loader = VineLinux::VSS::ConfigLoader->new; |
---|
24 | my $config = $loader->load($opt{config}, $self); |
---|
25 | |
---|
26 | $self->type($opt{type}); |
---|
27 | $self->package_name($opt{package_name}); |
---|
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') { |
---|
39 | VineLinux::VSS::Type::Elisp->generate($class); |
---|
40 | } elsif ($type eq 'self-build') { |
---|
41 | VineLinux::VSS::Type::SelfBuild->generate($class); |
---|
42 | } elsif ($type eq 'perlmodule') { |
---|
43 | VineLinux::VSS::Type::PerlModule->generate($class); |
---|
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.