| 1 |
package Dancer2::ConfigReader::Recursive; |
| 2 |
use Moo; |
| 3 |
use Dancer2::Core::Factory; |
| 4 |
use Dancer2::Core; |
| 5 |
use Dancer2::Core::Types; |
| 6 |
use Dancer2::FileUtils 'path'; |
| 7 |
|
| 8 |
with 'Dancer2::Core::Role::ConfigReader'; |
| 9 |
|
| 10 |
has name => ( |
| 11 |
is => 'ro', |
| 12 |
isa => Str, |
| 13 |
lazy => 0, |
| 14 |
default => 'Recursive', |
| 15 |
); |
| 16 |
|
| 17 |
has config_files => ( |
| 18 |
is => 'ro', |
| 19 |
lazy => 1, |
| 20 |
isa => ArrayRef, |
| 21 |
default => sub { |
| 22 |
my ($self) = @_; |
| 23 |
return []; |
| 24 |
}, |
| 25 |
); |
| 26 |
|
| 27 |
sub read_config { |
| 28 |
return { |
| 29 |
additional_config_readers => |
| 30 |
'Dancer2::ConfigReader::Recursive' |
| 31 |
}; |
| 32 |
} |
| 33 |
|
| 34 |
1; |