| 1 | package Git::Raw::Blob; | ||
| 2 | 87 | $Git::Raw::Blob::VERSION = '0.90'; | |
| 3 | 87 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 87 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | use overload | ||
| 6 | 11 | ▶ | '""' => sub { return $_[0] -> id }, |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 7 | 87 | fallback => 1; | |
| 8 | |||
| 9 | 87 | ▶ | use Git::Raw; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | =head1 NAME | ||
| 12 | |||
| 13 | Git::Raw::Blob - Git blob class | ||
| 14 | |||
| 15 | =head1 VERSION | ||
| 16 | |||
| 17 | version 0.90 | ||
| 18 | |||
| 19 | =head1 DESCRIPTION | ||
| 20 | |||
| 21 | A L<Git::Raw::Blob> represents a Git blob. | ||
| 22 | |||
| 23 | B<WARNING>: The API of this module is unstable and may change without warning | ||
| 24 | (any change will be appropriately documented in the changelog). | ||
| 25 | |||
| 26 | =head1 METHODS | ||
| 27 | |||
| 28 | =head2 create( $repo, $buffer ) | ||
| 29 | |||
| 30 | Create a new blob from the given buffer. | ||
| 31 | |||
| 32 | =head2 lookup( $repo, $id ) | ||
| 33 | |||
| 34 | Retrieve the blob corresponding to C<$id>. This function is pretty much the | ||
| 35 | same as C<$repo-E<gt>lookup($id)> except that it only returns blobs. If the blob | ||
| 36 | doesn't exist, this function wil return C<undef>. | ||
| 37 | |||
| 38 | =head2 owner( ) | ||
| 39 | |||
| 40 | Retrieve the L<Git::Raw::Repository> owning the blob. | ||
| 41 | |||
| 42 | =head2 content( ) | ||
| 43 | |||
| 44 | Retrieve the raw content of a blob. | ||
| 45 | |||
| 46 | =head2 size( ) | ||
| 47 | |||
| 48 | Retrieve the size of the raw content of a blob. | ||
| 49 | |||
| 50 | =head2 id( ) | ||
| 51 | |||
| 52 | Return the raw ID (the SHA-1 hash) of the blob as a string. | ||
| 53 | |||
| 54 | =head2 is_binary( ) | ||
| 55 | |||
| 56 | Determine if the blob content is most certainly binary or not. | ||
| 57 | |||
| 58 | =head2 is_blob( ) | ||
| 59 | |||
| 60 | Returns true. | ||
| 61 | |||
| 62 | =cut | ||
| 63 | |||
| 64 | =head2 is_tree( ) | ||
| 65 | |||
| 66 | Returns false. | ||
| 67 | |||
| 68 | =cut | ||
| 69 | |||
| 70 | =head1 AUTHOR | ||
| 71 | |||
| 72 | Alessandro Ghedini <alexbio@cpan.org> | ||
| 73 | |||
| 74 | =head1 LICENSE AND COPYRIGHT | ||
| 75 | |||
| 76 | Copyright 2012 Alessandro Ghedini. | ||
| 77 | |||
| 78 | This program is free software; you can redistribute it and/or modify it | ||
| 79 | under the terms of either: the GNU General Public License as published | ||
| 80 | by the Free Software Foundation; or the Artistic License. | ||
| 81 | |||
| 82 | See http://dev.perl.org/licenses/ for more information. | ||
| 83 | |||
| 84 | =cut | ||
| 85 | |||
| 86 | 87 | 1; # End of Git::Raw::Blob | |