line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
926
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
2
|
|
|
|
|
|
|
package Env::Heroku::Cloudinary; |
3
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:PNU'; |
4
|
|
|
|
|
|
|
# ABSTRACT: env for cloudinary |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
21
|
|
7
|
1
|
|
|
1
|
|
4
|
use URI; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
171
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.003'; # VERSION |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub import { |
12
|
1
|
|
|
1
|
|
6
|
my ($self) = @_; |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
|
|
3
|
my $cloudinaryurl = $ENV{CLOUDINARY_URL}; |
15
|
1
|
50
|
33
|
|
|
6
|
if ( $cloudinaryurl and $cloudinaryurl =~ s/^cloudinary:// ) { |
16
|
0
|
|
|
|
|
0
|
my $url = URI->new( $cloudinaryurl, 'http' ); |
17
|
0
|
|
|
|
|
0
|
$ENV{CLOUDINARY_CLOUD} = $url->host; |
18
|
0
|
0
|
|
|
|
0
|
($ENV{CLOUDINARY_API_KEY},$ENV{CLOUDINARY_API_SECRET}) = split ':', $url->userinfo |
19
|
|
|
|
|
|
|
if $url->userinfo; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
|
|
9
|
return 1; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
__END__ |