source: projects/vine-spec-skeleton/tags/release-0.4/lib/VineLinux/VSS.pm @ 3226

Revision 3226, 1.3 KB checked in by iwaim, 13 years ago (diff)

version 0.4 release

Line 
1package VineLinux::VSS;
2
3use strict;
4use warnings;
5
6use VineLinux::VSS::ConfigLoader;
7use VineLinux::VSS::Type::Elisp;
8use VineLinux::VSS::Type::SelfBuild;
9use VineLinux::VSS::Type::PerlModule;
10use VineLinux::VSS::Init;
11
12use base qw( Class::Accessor::Fast );
13__PACKAGE__->mk_accessors( qw(type package_name packager_name packager_fullname packager_email) );
14
15our $VERSION = '0.4';
16
17sub 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
33sub 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
51sub bootstrap{
52    my $class = shift;
53    my $self = $class->new(@_);
54    $self->run();
55    return $self;
56}
57
58sub init{
59    my $class = shift;
60    my $config = shift;
61    VineLinux::VSS::Init->run($config);
62}
63
641;
Note: See TracBrowser for help on using the repository browser.