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

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