File Coverage

blib/lib/Git/Database/Backend/None.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             package Git::Database::Backend::None;
2             $Git::Database::Backend::None::VERSION = '0.012';
3 8     8   3775 use Moo;
  8         19  
  8         73  
4 8     8   2348 use namespace::clean;
  8         26  
  8         44  
5              
6             with 'Git::Database::Role::Backend';
7              
8             # we don't have a backend
9             has '+store' => (
10             is => 'ro',
11             required => 0,
12             init_arg => undef,
13             predicate => 1,
14             );
15              
16             1;
17              
18             __END__
19              
20             =head1 NAME
21              
22             Git::Database::Backend::None - A minimal backend for Git::Database
23              
24             =head1 VERSION
25              
26             version 0.012
27              
28             =head1 SYNOPSIS
29              
30             use Git::Database;
31             use Git::Database::Backend::None;
32              
33             my $backend = Git::Database::Backend::None->new();
34              
35             # the empty tree
36             my $tree = Git::Database::Object::Tree->new( content => '' );
37              
38             # 4b825dc642cb6eb9a060e54bf8d69288fbee4904
39             my $digest = $backend->hash_object( $tree );
40              
41             =head1 DESCRIPTION
42              
43             C<Git::Database::Backend::None> is the minimal backend class for
44             L<Git::Database>.
45              
46             It can't read or write from a L<store|Git::Database::Tutorial/store>,
47             because it doesn't have one.
48              
49             =head2 Git Database Roles
50              
51             This backend does the following roles
52             (check their documentation for a list of supported methods):
53             L<Git::Database::Role::Backend>.
54              
55             Since it's not connected to a store, this class can't delegate the
56             L<digest|Git::Database::Role::Object/digest> computation to Git
57             itself. It therefore uses the default implementation provided by
58             L<Git::Database::Role::Backend>.
59              
60             =head1 AUTHOR
61              
62             Philippe Bruhat (BooK) <book@cpan.org>
63              
64             =head1 COPYRIGHT
65              
66             Copyright 2016 Philippe Bruhat (BooK), all rights reserved.
67              
68             =head1 LICENSE
69              
70             This program is free software; you can redistribute it and/or modify it
71             under the same terms as Perl itself.
72              
73             =cut