aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Open311/Endpoint/Role/ConfigFile.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2016-08-26 15:05:30 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2016-08-26 15:05:30 +0100
commit0e45fa27e4bc857f61b71f6c121a61e08e54cb6a (patch)
tree7e83c50825819b60a9a73f16c4d4f0a4ff247650 /perllib/Open311/Endpoint/Role/ConfigFile.pm
parentc1178ea85d1879d6533ac09e2a3c813441554b43 (diff)
parenta09c61c807d8d6b50227c9d8aa687f1eb22bad00 (diff)
Merge branch 'stevenage-open311'
Diffstat (limited to 'perllib/Open311/Endpoint/Role/ConfigFile.pm')
-rw-r--r--perllib/Open311/Endpoint/Role/ConfigFile.pm30
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;