| 1 | use 5.014; # because we use the 'state' and 'non-destructive substitution' feature (s///r) | ||
| 2 | use strict; | ||
| 3 | use warnings; | ||
| 4 | |||
| 5 | package Banal::Dist::Util; # git description: v0.003-2-g3efaa56 | ||
| 6 | # vim: set ts=2 sts=2 sw=2 tw=115 et : | ||
| 7 | # ABSTRACT: General purpose utility collection mainly used by <Dist::Zilla::*::Author::TABULO> | ||
| 8 | # KEYWORDS: author utility | ||
| 9 | |||
| 10 | our $VERSION = '0.004'; | ||
| 11 | # AUTHORITY | ||
| 12 | |||
| 13 | |||
| 14 | use Path::Tiny qw(path); | ||
| 15 | use Data::Printer; # DEBUG aid. | ||
| 16 | |||
| 17 | use Exporter::Shiny qw( pause_config ); | ||
| 18 | |||
| 19 | use namespace::autoclean; | ||
| 20 | |||
| 21 | |||
| 22 | # return username, password from ~/.pause | ||
| 23 | sub pause_config_alt # Hmmm. We've got a similar named routine in *::Pause.pm | ||
| 24 | { | ||
| 25 | my $file = path($ENV{HOME} // 'oops', '.pause'); | ||
| 26 | return if not -e $file; | ||
| 27 | |||
| 28 | my ($username, $password) = map { | ||
| 29 | my (undef, $val) = split ' ', $_; $val # awk-style whitespace splitting | ||
| 30 | } $file->lines; | ||
| 31 | } | ||
| 32 | |||
| 33 | |||
| 34 | |||
| 35 | |||
| 36 | |||
| 37 | |||
| 38 | |||
| 39 | 1; | ||
| 40 | |||
| 41 | __END__ |