|
| 1 | +# Copyright (C) 2008-2010, Sebastian Riedel. |
| 2 | + |
| 3 | +package Mojo::Command::Generate::Gitignore; |
| 4 | + |
| 5 | +use strict; |
| 6 | +use warnings; |
| 7 | + |
| 8 | +use base 'Mojo::Command'; |
| 9 | + |
| 10 | +__PACKAGE__->attr(description => <<'EOF'); |
| 11 | +Generate .gitignore. |
| 12 | +EOF |
| 13 | +__PACKAGE__->attr(usage => <<"EOF"); |
| 14 | +usage: $0 generate gitignore |
| 15 | +EOF |
| 16 | + |
| 17 | +# I want to see the edge of the universe. |
| 18 | +# Ooh, that sounds cool. |
| 19 | +# It's funny, you live in the universe, but you never get to do this things |
| 20 | +# until someone comes to visit. |
| 21 | +sub run { |
| 22 | + my $self = shift; |
| 23 | + $self->render_to_rel_file('gitignore', '.gitignore'); |
| 24 | + $self->chmod_file('.gitignore', 0644); |
| 25 | +} |
| 26 | + |
| 27 | +1; |
| 28 | +__DATA__ |
| 29 | +@@ gitignore |
| 30 | +.* |
| 31 | +!.gitignore |
| 32 | +!.perltidyrc |
| 33 | +*~ |
| 34 | +blib |
| 35 | +Makefile* |
| 36 | +!Makefile.PL |
| 37 | +META.yml |
| 38 | +MANIFEST* |
| 39 | +!MANIFEST.SKIP |
| 40 | +pm_to_blib |
| 41 | +__END__ |
| 42 | +=head1 NAME |
| 43 | +
|
| 44 | +Mojo::Command::Generate::Gitignore - Gitignore Generator Command |
| 45 | +
|
| 46 | +=head1 SYNOPSIS |
| 47 | +
|
| 48 | + use Mojo::Command::Generate::Gitignore; |
| 49 | +
|
| 50 | + my $gitignore = Mojo::Command::Generate::Gitignore->new; |
| 51 | + $gitignore->run(@ARGV); |
| 52 | +
|
| 53 | +=head1 DESCRIPTION |
| 54 | +
|
| 55 | +L<Mojo::Command::Generate::Gitignore> is a C<.gitignore> generator. |
| 56 | +
|
| 57 | +=head1 ATTRIBUTES |
| 58 | +
|
| 59 | +L<Mojo::Command::Generate::Gitignore> inherits all attributes from |
| 60 | +L<Mojo::Command> and implements the following new ones. |
| 61 | +
|
| 62 | +=head2 C<description> |
| 63 | +
|
| 64 | + my $description = $gitignore->description; |
| 65 | + $gitignore = $gitignore->description('Foo!'); |
| 66 | +
|
| 67 | +Short description of this command, used for the command list. |
| 68 | +
|
| 69 | +=head2 C<usage> |
| 70 | +
|
| 71 | + my $usage = $gitignore->usage; |
| 72 | + $gitignore = $gitignore->usage('Foo!'); |
| 73 | +
|
| 74 | +Usage information for this command, used for the help screen. |
| 75 | +
|
| 76 | +=head1 METHODS |
| 77 | +
|
| 78 | +L<Mojo::Command::Generate::Gitignore> inherits all methods from |
| 79 | +L<Mojo::Command> and implements the following new ones. |
| 80 | +
|
| 81 | +=head2 C<run> |
| 82 | +
|
| 83 | + $gitignore = $gitignore->run(@ARGV); |
| 84 | +
|
| 85 | +Run this command. |
| 86 | +
|
| 87 | +=head1 SEE ALSO |
| 88 | +
|
| 89 | +L<Mojolicious>, L<Mojolicious::Book>, L<http://mojolicious.org>. |
| 90 | +
|
| 91 | +=cut |
0 commit comments