| 1 | package Git::Database::Object::Blob; | ||||||||||||||||||||||||||||
| 2 | 20 | $Git::Database::Object::Blob::VERSION = '0.012'; | |||||||||||||||||||||||||||
| 3 | 20 | ▶ | use Moo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 20 | ▶ | use namespace::clean; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 20 | with 'Git::Database::Role::Object'; | |||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 478 | ▶ | sub kind { 'blob' } | ||||||||||||||||||||||||||
|
Subroutine
kind: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | sub BUILD { | ||||||||||||||||||||||||||||
| 11 | 450 | ▶ | my ($self) = @_; | ||||||||||||||||||||||||||
|
Subroutine
BUILD: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 12 | 450 | ▶ | die "One of 'digest' or 'content' is required" | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$self->has_digest || $self->has_content
MC/DC100%2/2
$self->has_digest || $self->has_content
$self->has_digest
$self->has_content
Truth table100%3/3
A || B
A= $self->has_digestB= $self->has_content
| |||||||||||||||||||||||||||||
| 13 | if !$self->has_digest && !$self->has_content; | ||||||||||||||||||||||||||||
| 14 | } | ||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 20 | 1; | |||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | __END__ | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | =pod | ||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | =for Pod::Coverage | ||||||||||||||||||||||||||||
| 23 | BUILD | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | =head1 NAME | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | Git::Database::Object::Blob - A blob object in the Git object database | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | =head1 VERSION | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | version 0.012 | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | my $r = Git::Database->new(); # current Git repository | ||||||||||||||||||||||||||||
| 36 | my $blob = $r->get_object('b52168'); # abbreviated digest | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | # attributes | ||||||||||||||||||||||||||||
| 39 | $blob->kind; # blob | ||||||||||||||||||||||||||||
| 40 | $blob->digest; # b6fc4c620b67d95f953a5c1c1230aaab5db5a1b0 | ||||||||||||||||||||||||||||
| 41 | $blob->content; # hello | ||||||||||||||||||||||||||||
| 42 | ...; # etc., see below | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | Git::Database::Object::Blob represents a C<blob> object | ||||||||||||||||||||||||||||
| 47 | obtained via L<Git::Database> from a Git object database. | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | =head1 ATTRIBUTES | ||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | =head2 kind | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | The object kind: C<blob>. | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | =head2 digest | ||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | The SHA-1 digest of the blob object. | ||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | =head2 content | ||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | The object's actual content. | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | =head2 size | ||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | The size (in bytes) of the object content. | ||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | =head1 METHODS | ||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||
| 69 | =head2 new() | ||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||
| 71 | Create a new Git::Object::Database::Blob object. | ||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||
| 73 | The C<content> argument is required. | ||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||
| 75 | =head2 as_string() | ||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||
| 77 | Same as C<content()>. | ||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||
| 79 | =head1 SEE ALSO | ||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||
| 81 | L<Git::Database>, | ||||||||||||||||||||||||||||
| 82 | L<Git::Database::Role::Object>. | ||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||
| 84 | =head1 AUTHOR | ||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||
| 86 | Philippe Bruhat (BooK) <book@cpan.org>. | ||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||
| 88 | =head1 COPYRIGHT | ||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | Copyright 2013-2016 Philippe Bruhat (BooK), all rights reserved. | ||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||
| 92 | =head1 LICENSE | ||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||
| 94 | This program is free software; you can redistribute it and/or modify it | ||||||||||||||||||||||||||||
| 95 | under the same terms as Perl itself. | ||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||
| 97 | =cut | ||||||||||||||||||||||||||||