Aion-Env

 view release on metacpan or  search on metacpan

lib/Aion/Env.pm  view on Meta::CPAN

	    	die "$name type is'nt isa!" unless $isa->();
		}
    }
    
    constant->import("$pkg\::$name", $val);
}

my $BOM = "\x{feff}";
sub parse {
    my ($file) = @_;
    open my $f, '<:utf8', $file or die "$file: $!";

    my %env;
    my $interpolate = sub {
    	$_[0] =~ s!\$\{(\w+)\}!$env{$1}!ge;
    };
     
    while(<$f>) {
    	s/^$BOM// if $. == 1;
        next if /^\s*(?:#|$)/;
        

lib/Aion/Env.pm  view on Meta::CPAN


    close $f;
    
    \%env
};

1;

__END__

=encoding utf-8

=head1 NAME

Aion::Env - creates a constant associated with the value from .env

=head1 VERSION

0.1

=head1 SYNOPSIS

t/aion/env.t  view on Meta::CPAN

use common::sense; use open qw/:std :utf8/;  use Carp qw//; use Cwd qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//;  use Test::More 0.98;  use String::Diff q...
# # NAME
# 
# Aion::Env - создаёт константу связанную со значением из .env
# 
# # VERSION
# 
# 0.1
# 
# # SYNOPSIS
# 



( run in 0.472 second using v1.01-cache-2.11-cpan-13bb782fe5a )