| 1 | ## | ||
| 2 | # name: YamlTime::Git | ||
| 3 | # abstract: Git Support for YamlTime | ||
| 4 | # author: Ingy döt Net <ingy@cpan.org> | ||
| 5 | # license: perl | ||
| 6 | # copyright: 2011 | ||
| 7 | # see: | ||
| 8 | # - YamlTime | ||
| 9 | |||
| 10 | 1 | ▶ | use 5.008003; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 0 | ▶ | use YamlTime 0.08 (); |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 12 | |||
| 13 | package YamlTime::Extension::Git; | ||
| 14 | |||
| 15 | our $VERSION = '0.01'; | ||
| 16 | |||
| 17 | package YamlTime::Command::commit; | ||
| 18 | use Mouse; | ||
| 19 | YamlTime->import( -command ); | ||
| 20 | extends qw[YamlTime::Command]; | ||
| 21 | use constant abstract => "'git commit' your YamlTime changes"; | ||
| 22 | |||
| 23 | sub execute { | ||
| 24 | my ($self, $opt, $args) = @_; | ||
| 25 | my @args = @$args || ('-m', 'YamlTime!'); | ||
| 26 | $self->run('git add .') and | ||
| 27 | $self->run("git commit @args"); | ||
| 28 | } | ||
| 29 | |||
| 30 | package YamlTime::Command::push; | ||
| 31 | use Mouse; | ||
| 32 | YamlTime->import( -command ); | ||
| 33 | extends qw[YamlTime::Command]; | ||
| 34 | use constant abstract => "'git push' your YamlTime repository"; | ||
| 35 | |||
| 36 | sub execute { | ||
| 37 | my ($self, $opt, $args) = @_; | ||
| 38 | my @args = @$args || qw(origin master); | ||
| 39 | $self->run("git push @args"); | ||
| 40 | } | ||
| 41 | |||
| 42 | 1; | ||