| 1 | # ABSTRACT: Constants used across the Pinto utilities | ||
| 2 | |||
| 3 | package Pinto::Constants; | ||
| 4 | |||
| 5 | 153 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 153 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 153 | ▶ | use URI; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 153 | ▶ | use Readonly; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 153 | ▶ | use Exporter qw(import); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | #------------------------------------------------------------------------------ | ||
| 13 | |||
| 14 | 153 | our $VERSION = '0.14'; # VERSION | |
| 15 | |||
| 16 | #------------------------------------------------------------------------------ | ||
| 17 | |||
| 18 | 153 | Readonly our @EXPORT_OK => qw( | |
| 19 | |||
| 20 | $PINTO_SERVER_DEFAULT_PORT | ||
| 21 | $PINTO_SERVER_DEFAULT_HOST | ||
| 22 | $PINTO_SERVER_DEFAULT_ROOT | ||
| 23 | |||
| 24 | $PINTO_PROTOCOL_VERSION | ||
| 25 | $PINTO_PROTOCOL_STATUS_OK | ||
| 26 | $PINTO_PROTOCOL_DIAG_PREFIX | ||
| 27 | $PINTO_PROTOCOL_NULL_MESSAGE | ||
| 28 | $PINTO_PROTOCOL_PROGRESS_MESSAGE | ||
| 29 | $PINTO_PROTOCOL_ACCEPT | ||
| 30 | |||
| 31 | $PINTO_DEFAULT_PALETTE | ||
| 32 | $PINTO_PALETTE_COLOR_0 | ||
| 33 | $PINTO_PALETTE_COLOR_1 | ||
| 34 | $PINTO_PALETTE_COLOR_2 | ||
| 35 | |||
| 36 | $PINTO_LOCK_TYPE_SHARED | ||
| 37 | $PINTO_LOCK_TYPE_EXCLUSIVE | ||
| 38 | |||
| 39 | $PINTO_STACK_NAME_ALL | ||
| 40 | |||
| 41 | $PINTO_AUTHOR_REGEX | ||
| 42 | $PINTO_USERNAME_REGEX | ||
| 43 | $PINTO_STACK_NAME_REGEX | ||
| 44 | $PINTO_PROPERTY_NAME_REGEX | ||
| 45 | $PINTO_REVISION_ID_REGEX | ||
| 46 | |||
| 47 | $PINTO_MINIMUM_CPANM_VERSION | ||
| 48 | |||
| 49 | $PINTO_DIFF_STYLE_CONCISE | ||
| 50 | $PINTO_DIFF_STYLE_DETAILED | ||
| 51 | @PINTO_DIFF_STYLES | ||
| 52 | |||
| 53 | $PINTO_STRATOPAN_CPAN_URI | ||
| 54 | $PINTO_STRATOPAN_LOCATOR_URI | ||
| 55 | $PINTO_BACKPAN_CPAN_URI | ||
| 56 | @PINTO_DEFAULT_SOURCE_URIS | ||
| 57 | |||
| 58 | @PINTO_PREREQ_PHASES | ||
| 59 | @PINTO_PREREQ_RELATIONS | ||
| 60 | |||
| 61 | @PINTO_ENVIRONMENT_VARIABLES | ||
| 62 | ); | ||
| 63 | |||
| 64 | Readonly our %EXPORT_TAGS => ( | ||
| 65 | all => \@EXPORT_OK, | ||
| 66 | 4896 | color => [ grep {m/PALETTE/x} @EXPORT_OK ], | |
| 67 | 4896 | server => [ grep {m/SERVER/x} @EXPORT_OK ], | |
| 68 | 4896 | protocol => [ grep {m/PROTOCOL/x} @EXPORT_OK ], | |
| 69 | 4896 | regex => [ grep {m/REGEX/x} @EXPORT_OK ], | |
| 70 | 4896 | lock => [ grep {m/LOCK/x} @EXPORT_OK ], | |
| 71 | 4896 | diff => [ grep {m/DIFF/x} @EXPORT_OK ], | |
| 72 | 4896 | prereq => [ grep {m/PREREQ/x} @EXPORT_OK ], | |
| 73 | 153 | stratopan => [ grep {m/STRATOPAN/x} @EXPORT_OK ], | |
| 74 | ); | ||
| 75 | |||
| 76 | #------------------------------------------------------------------------------ | ||
| 77 | |||
| 78 | 153 | Readonly our $PINTO_SERVER_DEFAULT_HOST => 'localhost'; | |
| 79 | |||
| 80 | 153 | Readonly our $PINTO_SERVER_DEFAULT_PORT => 3111; | |
| 81 | |||
| 82 | 153 | Readonly our $PINTO_SERVER_DEFAULT_ROOT => "http://$PINTO_SERVER_DEFAULT_HOST:$PINTO_SERVER_DEFAULT_PORT"; | |
| 83 | |||
| 84 | #------------------------------------------------------------------------------ | ||
| 85 | |||
| 86 | 153 | Readonly our $PINTO_PROTOCOL_VERSION => 1; | |
| 87 | |||
| 88 | 153 | Readonly our $PINTO_PROTOCOL_DIAG_PREFIX => '## '; | |
| 89 | |||
| 90 | 153 | Readonly our $PINTO_PROTOCOL_STATUS_OK => "${PINTO_PROTOCOL_DIAG_PREFIX}Status: ok"; | |
| 91 | |||
| 92 | 153 | Readonly our $PINTO_PROTOCOL_NULL_MESSAGE => "${PINTO_PROTOCOL_DIAG_PREFIX}-- ##"; | |
| 93 | |||
| 94 | 153 | Readonly our $PINTO_PROTOCOL_PROGRESS_MESSAGE => "${PINTO_PROTOCOL_DIAG_PREFIX}. ##"; | |
| 95 | |||
| 96 | 153 | Readonly our $PINTO_PROTOCOL_ACCEPT => "application/vnd.pinto.v${PINTO_PROTOCOL_VERSION}+text"; | |
| 97 | |||
| 98 | #------------------------------------------------------------------------------ | ||
| 99 | |||
| 100 | 153 | Readonly our $PINTO_DEFAULT_PALETTE => [qw(green yellow red)]; | |
| 101 | |||
| 102 | 153 | Readonly our $PINTO_PALETTE_COLOR_0 => 0; | |
| 103 | 153 | Readonly our $PINTO_PALETTE_COLOR_1 => 1; | |
| 104 | 153 | Readonly our $PINTO_PALETTE_COLOR_2 => 2; | |
| 105 | |||
| 106 | #------------------------------------------------------------------------------ | ||
| 107 | |||
| 108 | 153 | Readonly our $PINTO_LOCK_TYPE_SHARED => 'SH'; | |
| 109 | 153 | Readonly our $PINTO_LOCK_TYPE_EXCLUSIVE => 'EX'; | |
| 110 | |||
| 111 | #------------------------------------------------------------------------------ | ||
| 112 | |||
| 113 | 153 | Readonly our $PINTO_STACK_NAME_ALL => '%'; | |
| 114 | |||
| 115 | #------------------------------------------------------------------------------ | ||
| 116 | |||
| 117 | 153 | Readonly my $PINTO_ALPHANUMERIC_REGEX => qr{^ [a-zA-Z0-9-._]+ $}x; | |
| 118 | 153 | Readonly my $PINTO_HEXADECIMAL_UUID_REGEX => qr{^ [a-f0-9-]+ $}x; | |
| 119 | |||
| 120 | 153 | Readonly our $PINTO_AUTHOR_REGEX => qr/^ [A-Z]{2} [-A-Z0-9]* $/x; | |
| 121 | 153 | Readonly our $PINTO_USERNAME_REGEX => $PINTO_ALPHANUMERIC_REGEX; | |
| 122 | 153 | Readonly our $PINTO_STACK_NAME_REGEX => $PINTO_ALPHANUMERIC_REGEX; | |
| 123 | 153 | Readonly our $PINTO_PROPERTY_NAME_REGEX => $PINTO_ALPHANUMERIC_REGEX; | |
| 124 | 153 | Readonly our $PINTO_REVISION_ID_REGEX => $PINTO_HEXADECIMAL_UUID_REGEX; | |
| 125 | |||
| 126 | #------------------------------------------------------------------------------ | ||
| 127 | |||
| 128 | 153 | Readonly our $PINTO_MINIMUM_CPANM_VERSION => '1.6920'; | |
| 129 | |||
| 130 | #------------------------------------------------------------------------------ | ||
| 131 | |||
| 132 | 153 | Readonly our $PINTO_DIFF_STYLE_CONCISE => 'concise'; | |
| 133 | 153 | Readonly our $PINTO_DIFF_STYLE_DETAILED => 'detailed'; | |
| 134 | |||
| 135 | 153 | Readonly our @PINTO_DIFF_STYLES => ($PINTO_DIFF_STYLE_CONCISE, $PINTO_DIFF_STYLE_DETAILED); | |
| 136 | |||
| 137 | #------------------------------------------------------------------------------ | ||
| 138 | # TODO: Make these configurable via ENV vars | ||
| 139 | |||
| 140 | 153 | Readonly our $PINTO_PUBLIC_CPAN_URI => URI->new('http://www.cpan.org'); | |
| 141 | 153 | Readonly our $PINTO_BACKPAN_CPAN_URI => URI->new('http://backpan.perl.org'); | |
| 142 | 153 | Readonly our $PINTO_STRATOPAN_CPAN_URI => URI->new('http://cpan.stratopan.com'); | |
| 143 | 153 | Readonly our $PINTO_STRATOPAN_LOCATOR_URI => URI->new('http://meta.stratopan.com/locate'); | |
| 144 | |||
| 145 | 153 | Readonly our @PINTO_DEFAULT_SOURCE_URIS => ( $PINTO_STRATOPAN_CPAN_URI, | |
| 146 | $PINTO_PUBLIC_CPAN_URI, | ||
| 147 | $PINTO_BACKPAN_CPAN_URI ); | ||
| 148 | |||
| 149 | #------------------------------------------------------------------------------ | ||
| 150 | |||
| 151 | 153 | Readonly our @PINTO_PREREQ_PHASES => qw(configure build test runtime develop); | |
| 152 | 153 | Readonly our @PINTO_PREREQ_RELATIONS => qw(requires suggests recommends); | |
| 153 | |||
| 154 | #------------------------------------------------------------------------------ | ||
| 155 | |||
| 156 | 153 | Readonly our @PINTO_ENVIRONMENT_VARIABLES => qw( | |
| 157 | PINTO_AUTHOR_ID | ||
| 158 | PINTO_DEBUG | ||
| 159 | PINTO_DIFF_STYLE | ||
| 160 | PINTO_EDITOR | ||
| 161 | PINTO_LOCKFILE_TIMEOUT | ||
| 162 | PINTO_NO_COLOR | ||
| 163 | PINTO_PAGER | ||
| 164 | PINTO_PAGER_OPTIONS | ||
| 165 | PINTO_PALETTE | ||
| 166 | PINTO_REPOSITORY_ROOT | ||
| 167 | PINTO_STALE_LOCKFILE_TIMEOUT | ||
| 168 | PINTO_USERNAME | ||
| 169 | ); | ||
| 170 | |||
| 171 | #------------------------------------------------------------------------------ | ||
| 172 | 153 | 1; | |
| 173 | |||
| 174 | __END__ | ||