| 1 | package Enbld::Definition::Zsh; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | use parent qw/Enbld::Definition/; | ||
| 7 | |||
| 8 | sub initialize { | ||
| 9 | my $self = shift; | ||
| 10 | |||
| 11 | $self->SUPER::initialize; | ||
| 12 | |||
| 13 | $self->{defined}{ArchiveName} = 'zsh'; | ||
| 14 | $self->{defined}{WebSite} = 'http://www.zsh.org'; | ||
| 15 | $self->{defined}{VersionForm} = '\d\.\d\.\d'; | ||
| 16 | $self->{defined}{DownloadSite} = 'http://sourceforge.net/projects/zsh/files/zsh/'; | ||
| 17 | |||
| 18 | $self->{defined}{IndexParserForm} = \&set_index_parser_form; | ||
| 19 | $self->{defined}{URL} = \&set_URL; | ||
| 20 | |||
| 21 | return $self; | ||
| 22 | } | ||
| 23 | |||
| 24 | sub set_index_parser_form { | ||
| 25 | my $attributes = shift; | ||
| 26 | |||
| 27 | my $index_parser_form = '<a href="/projects/zsh/files/zsh/' . | ||
| 28 | $attributes->VersionForm .'/"'; | ||
| 29 | |||
| 30 | return $index_parser_form; | ||
| 31 | } | ||
| 32 | |||
| 33 | sub set_URL { | ||
| 34 | my $attributes = shift; | ||
| 35 | |||
| 36 | my $site = 'http://sourceforge.net/projects/zsh/files/zsh/'; | ||
| 37 | |||
| 38 | my $dir = $attributes->Version; | ||
| 39 | my $file = $attributes->ArchiveName . '-' . $attributes->Version . | ||
| 40 | '.' . $attributes->Extension; | ||
| 41 | |||
| 42 | my $url = $site . $dir . '/' . $file . '/download'; | ||
| 43 | |||
| 44 | return $url; | ||
| 45 | } | ||
| 46 | |||
| 47 | 1; | ||
| 48 | |||
| 49 | =pod | ||
| 50 | |||
| 51 | =head1 NAME | ||
| 52 | |||
| 53 | Enbld::Definition::Zsh - definition module for Zsh | ||
| 54 | |||
| 55 | =head1 SEE ALSO | ||
| 56 | |||
| 57 | L<Zsh|http://www.zsh.org> | ||
| 58 | |||
| 59 | L<Enbld::Definition> | ||
| 60 | |||
| 61 | =head1 COPYRIGHT | ||
| 62 | |||
| 63 | copyright 2013- Magnolia C<< <magnolia.k@me.com> >>. | ||
| 64 | |||
| 65 | =head1 LICENSE | ||
| 66 | |||
| 67 | This is free software; you can redistribute it and/or modify it under | ||
| 68 | the same terms as the Perl 5 programming language system itself. | ||
| 69 | |||
| 70 | =cut |