| 1 | package Git::Database::Object::Raw; | ||||||||||||||||||||||||||||
| 2 | 11 | $Git::Database::Object::Raw::VERSION = '0.012'; | |||||||||||||||||||||||||||
| 3 | 11 | ▶ | use Moo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 11 | has kind => ( | |||||||||||||||||||||||||||
| 6 | is => 'ro', | ||||||||||||||||||||||||||||
| 7 | required => 1, | ||||||||||||||||||||||||||||
| 8 | ); | ||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 11 | with 'Git::Database::Role::Object'; | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 11 | *sha1 = \&digest; | |||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 26 | ▶ | sub raw { $_[0]->kind . ' ' . $_[0]->size . "\0" . $_[0]->content } | ||||||||||||||||||||||||||
|
Subroutine
raw: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | sub BUILDARGS { | ||||||||||||||||||||||||||||
| 17 | 26 | ▶ | return @_ == 2 && eval { $_[1]->does('Git::Database::Role::Object') } | ||||||||||||||||||||||||||
|
Subroutine
BUILDARGS: called CC=3 SCAR=13.1
Pod
undocumented
Branch: 1 branch
Condition33%1/3
@_ == 2 and eval {
MC/DC0%0/2
@_ == 2 and eval {
do {
$_[1]->does("Git::Database::Role::Object")
}
}
@_ == 2
eval {
do {
$_[1]->does("Git::Database::Role::Object")
}
}
Truth table33%1/3
A and B
A= @_ == 2B= eval {
do {
$_[1]->does("Git::Database::Role::Object")
}
}
| |||||||||||||||||||||||||||||
| 18 | ? { kind => $_[1]->kind, content => $_[1]->content } | ||||||||||||||||||||||||||||
| 19 | : Moo::Object::BUILDARGS(@_); | ||||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 11 | 1; | |||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | __END__ | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | =pod | ||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | =for Pod::Coverage | ||||||||||||||||||||||||||||
| 29 | BUILDARGS | ||||||||||||||||||||||||||||
| 30 | kind | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | =head1 NAME | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | Git::Database::Object::Raw - Raw Git::Database objects | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | =head1 VERSION | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | version 0.012 | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | # $object is-a Git::Database::Object (Blob, Tree, Commit, Tag) | ||||||||||||||||||||||||||||
| 43 | my $raw = Git::Database::Object::Raw->new( $object ); | ||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | This tiny class adds the L</sha1> and L</raw> methods to those offered | ||||||||||||||||||||||||||||
| 48 | by L<Git::Database::Role::Object>. Git::Database::Object::Raw objects | ||||||||||||||||||||||||||||
| 49 | can be handed to L<Git::PurePerl::Loose> or L<Cogit::Loose> for saving | ||||||||||||||||||||||||||||
| 50 | in the Git object database. | ||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | =head1 METHODS | ||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | =head2 sha1 | ||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | Alias for L<digest|Git::Database::Role::Object/digest>. | ||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | =head2 raw | ||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | Return the raw data, as used by L<Git::PurePerl::Loose> and | ||||||||||||||||||||||||||||
| 61 | L<Cogit::Loose> to save an object in the Git object database. | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | =head1 AUTHOR | ||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | Philippe Bruhat (BooK) <book@cpan.org> | ||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | =head1 COPYRIGHT | ||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||
| 69 | Copyright 2016 Philippe Bruhat (BooK), all rights reserved. | ||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||
| 71 | =head1 LICENSE | ||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||
| 73 | This program is free software; you can redistribute it and/or modify it | ||||||||||||||||||||||||||||
| 74 | under the same terms as Perl itself. | ||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||
| 76 | =cut | ||||||||||||||||||||||||||||