File Coverage

blib/lib/Yukki/Settings/Repository.pm
Criterion Covered Total %
statement 20 21 95.2
branch n/a
condition n/a
subroutine 7 8 87.5
pod 1 1 100.0
total 28 30 93.3


line stmt bran cond sub pod time code
1             package Yukki::Settings::Repository;
2             $Yukki::Settings::Repository::VERSION = '0.991_002'; # TRIAL
3              
4 3     3   46 $Yukki::Settings::Repository::VERSION = '0.991002';use v5.24;
  3         9  
5 3     3   13 use utf8;
  3         6  
  3         42  
6 3     3   71 use Moo;
  3         5  
  3         26  
7              
8             extends 'Yukki::Settings::Privileges';
9              
10             with 'Yukki::Role::Savable';
11              
12 3     3   1129 use Types::Path::Tiny qw( Path );
  3         14  
  3         21  
13 3     3   1139 use Types::Standard qw( ArrayRef Int Str );
  3         9  
  3         17  
14 3     3   3881 use Yukki::Types qw( AccessLevel );
  3         14  
  3         39  
15              
16 3     3   2224 use namespace::clean;
  3         19  
  3         34  
17              
18             # ABSTRACT: settings describing a wiki repository
19              
20              
21             has repository => (
22             is => 'ro',
23             isa => Path,
24             required => 1,
25             coerce => 1,
26             );
27              
28              
29             has site_branch => (
30             is => 'ro',
31             isa => Str,
32             required => 1,
33             default => 'refs/heads/master',
34             );
35              
36              
37             has name => (
38             is => 'ro',
39             isa => Str,
40             required => 1,
41             );
42              
43              
44             has default_page => (
45             is => 'ro',
46             isa => Path,
47             required => 1,
48             coerce => 1,
49             default => 'home.yukki',
50             );
51              
52              
53             has sort => (
54             is => 'ro',
55             isa => Int,
56             required => 1,
57             default => 50,
58             );
59              
60              
61             sub savable_attributes {
62 0     0 1   qw(
63             repository
64             site_page
65             name
66             default_page
67             sort
68             anonymous_access_level
69             read_groups
70             write_groups
71             )
72             }
73              
74             1;
75              
76             __END__
77              
78             =pod
79              
80             =encoding UTF-8
81              
82             =head1 NAME
83              
84             Yukki::Settings::Repository - settings describing a wiki repository
85              
86             =head1 VERSION
87              
88             version 0.991_002
89              
90             =head1 DESCRIPTION
91              
92             This class provides structure for describing a git repository used to back a Yukki workspace. These may either be defined as part of the main settings file for command-line managed repositories. App-managed repositories will be stored in a sub-directory, each configuration in its own file.
93              
94             =head1 ISA
95              
96             L<Yukki::Settings::Privileges>
97              
98             =head1 ROLES
99              
100             L<Yukki::Role::Savable>
101              
102             =head1 ATTRIBUTES
103              
104             =head2 repository
105              
106             This is required. This is the name of the git repository folder found under C<repository_path>.
107              
108             =head2 site_branch
109              
110             This is the name of the branch that will contain the wiki's files. The default is C<refs/heads/master>. You could actually use the same git repository for multiple Yukki repositories by using different branches. If you want to do it that way for some reason. Unless you know what you're doing, you probably don't want to do that.
111              
112             =head2 name
113              
114             This is a human readable title for the repository.
115              
116             =head2 default_page
117              
118             This is the name of the main repository index.
119              
120             =head2 sort
121              
122             This is the sort order the repository should take when being listed in menus. The default is 50. The value must be an integer.
123              
124             =head1 METHODS
125              
126             =head2 savable_attributes
127              
128             The list of savable attributes.
129              
130             =head1 AUTHOR
131              
132             Andrew Sterling Hanenkamp <hanenkamp@cpan.org>
133              
134             =head1 COPYRIGHT AND LICENSE
135              
136             This software is copyright (c) 2017 by Qubling Software LLC.
137              
138             This is free software; you can redistribute it and/or modify it under
139             the same terms as the Perl 5 programming language system itself.
140              
141             =cut