diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-08-23 15:43:22 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-08-23 16:15:58 +0100 |
commit | eaa2480195d27ff3f1efd325b149da0668c63708 (patch) | |
tree | 7d548537eff1bb2a831129c71ad2e2b621066f72 /perllib/Open311/Endpoint/Role/ConfigFile.pm | |
parent | ec5e2c47f736c075e6dafd1ed63860287f596077 (diff) |
Remove Open311 endpoint to separate repo.
Diffstat (limited to 'perllib/Open311/Endpoint/Role/ConfigFile.pm')
-rw-r--r-- | perllib/Open311/Endpoint/Role/ConfigFile.pm | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/perllib/Open311/Endpoint/Role/ConfigFile.pm b/perllib/Open311/Endpoint/Role/ConfigFile.pm deleted file mode 100644 index 1c4b83355..000000000 --- a/perllib/Open311/Endpoint/Role/ConfigFile.pm +++ /dev/null @@ -1,30 +0,0 @@ -package Open311::Endpoint::Role::ConfigFile; -use Moo::Role; -use Path::Tiny 'path'; -use Carp 'croak'; -use YAML (); -use Types::Standard qw( Maybe Str ); - -has config_file => ( - is => 'ro', - isa => Maybe[Str], -); - -around BUILDARGS => sub { - my $next = shift; - my $class = shift; - - my %args = @_; - if (my $config_file = $args{config_file}) { - my $cfg = path($config_file); - croak "$config_file is not a file" unless $cfg->is_file; - - my $config = YAML::LoadFile($cfg) or croak "Couldn't load config from $config_file"; - return $class->$next(%$config, %args); - } - else { - return $class->$next(%args); - } -}; - -1; |