| 1 | package Yukki::Web::Settings; | ||
| 2 | 6 | $Yukki::Web::Settings::VERSION = '0.991_007'; # TRIAL | |
| 3 | 6 | $Yukki::Web::Settings::VERSION = '0.991007'; | |
| 4 | 6 | ▶ | use v5.24; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 6 | ▶ | use utf8; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 6 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 6 | extends 'Yukki::Settings'; | |
| 9 | |||
| 10 | 6 | ▶ | use Types::Path::Tiny qw( Path ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 6 | ▶ | use Types::Standard qw( ArrayRef HashRef Str ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | 6 | ▶ | use Yukki::Types qw( BaseURL PluginConfig ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | |||
| 14 | 6 | ▶ | use namespace::clean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | |||
| 16 | # ABSTRACT: provides structure and validation to web settings in yukki.conf | ||
| 17 | |||
| 18 | |||
| 19 | 6 | has template_path => ( | |
| 20 | is => 'ro', | ||
| 21 | isa => Path, | ||
| 22 | required => 1, | ||
| 23 | coerce => 1, | ||
| 24 | default => 'root/template', | ||
| 25 | ); | ||
| 26 | |||
| 27 | |||
| 28 | 6 | has static_path => ( | |
| 29 | is => 'ro', | ||
| 30 | isa => Path, | ||
| 31 | required => 1, | ||
| 32 | coerce => 1, | ||
| 33 | default => 'root', | ||
| 34 | ); | ||
| 35 | |||
| 36 | |||
| 37 | 6 | has base_url => ( | |
| 38 | is => 'ro', | ||
| 39 | isa => BaseURL, | ||
| 40 | required => 1, | ||
| 41 | coerce => 1, | ||
| 42 | default => 'SCRIPT_NAME', | ||
| 43 | ); | ||
| 44 | |||
| 45 | |||
| 46 | has scripts => ( | ||
| 47 | is => 'ro', | ||
| 48 | isa => ArrayRef[Str], | ||
| 49 | required => 1, | ||
| 50 | 0 | ▶ | default => sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 51 | 0 | [ qw( | |
| 52 | script/lib/jquery/jquery.js | ||
| 53 | script/lib/jquery/jquery-ui.js | ||
| 54 | script/lib/jquery/jquery.caret.js | ||
| 55 | script/lib/jquery/jquery.tag-editor.js | ||
| 56 | script/lib/plupload/plupload.full.js | ||
| 57 | script/lib/sha1/sha1.js | ||
| 58 | script/yukki.js | ||
| 59 | ) ] | ||
| 60 | }, | ||
| 61 | 6 | ); | |
| 62 | |||
| 63 | 0 | ▶ | sub all_scripts { |
|
Subroutine
all_scripts: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 64 | 0 | my $self = shift; | |
| 65 | 0 | $self->scripts->@*; | |
| 66 | } | ||
| 67 | |||
| 68 | has styles => ( | ||
| 69 | is => 'ro', | ||
| 70 | isa => ArrayRef[Str], | ||
| 71 | required => 1, | ||
| 72 | 0 | ▶ | default => sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 73 | 0 | [ qw( | |
| 74 | style/yukki.css | ||
| 75 | style/lib/jquery/jquery.css | ||
| 76 | style/lib/jquery/jquery.tag-editor.css | ||
| 77 | ) ] | ||
| 78 | }, | ||
| 79 | 6 | ); | |
| 80 | |||
| 81 | 0 | ▶ | sub all_styles { |
|
Subroutine
all_styles: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 82 | 0 | my $self = shift; | |
| 83 | 0 | $self->styles->@*; | |
| 84 | } | ||
| 85 | |||
| 86 | |||
| 87 | has menu_names => ( | ||
| 88 | is => 'ro', | ||
| 89 | isa => ArrayRef[Str], | ||
| 90 | required => 1, | ||
| 91 | 0 | ▶ | default => sub { [ qw( |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 92 | repository | ||
| 93 | user | ||
| 94 | page | ||
| 95 | page_bottom | ||
| 96 | admin | ||
| 97 | ) ] }, | ||
| 98 | 6 | ); | |
| 99 | |||
| 100 | |||
| 101 | has page_views => ( | ||
| 102 | is => 'ro', | ||
| 103 | isa => HashRef[HashRef], | ||
| 104 | required => 1, | ||
| 105 | 0 | ▶ | default => sub { +{ |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 106 | 0 | default => { | |
| 107 | label => 'View', | ||
| 108 | sort => 10, | ||
| 109 | template => 'shell.html', | ||
| 110 | }, | ||
| 111 | slides => { | ||
| 112 | label => 'Slides', | ||
| 113 | sort => 11, | ||
| 114 | template => 'slides.html', | ||
| 115 | hide => 1, | ||
| 116 | vars => { | ||
| 117 | "head link.local" => [ qw( style/slides.css ) ], | ||
| 118 | "head script.local" => [ qw( script/slides.js ) ], | ||
| 119 | }, | ||
| 120 | }, | ||
| 121 | } }, | ||
| 122 | 6 | ); | |
| 123 | |||
| 124 | |||
| 125 | has plugins => ( | ||
| 126 | is => 'ro', | ||
| 127 | isa => PluginConfig, | ||
| 128 | required => 1, | ||
| 129 | 0 | ▶ | default => sub { [ |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 130 | 0 | { module => 'Attachment' }, | |
| 131 | { module => 'YukkiText' }, | ||
| 132 | ] }, | ||
| 133 | 6 | ); | |
| 134 | |||
| 135 | |||
| 136 | has media_types => ( | ||
| 137 | is => 'ro', | ||
| 138 | isa => HashRef[Str|ArrayRef[Str]], | ||
| 139 | required => 1, | ||
| 140 | 0 | ▶ | default => sub { +{ |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 141 | 0 | 'text/yukki' => 'yukki', | |
| 142 | } }, | ||
| 143 | 6 | ); | |
| 144 | |||
| 145 | |||
| 146 | 6 | 1; | |
| 147 | |||
| 148 | __END__ | ||