Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

removing dependency on Config modules

  • Loading branch information...
commit 248d650485ccc1e070e05e8f3cdb7ad039966768 1 parent 6240c7d
Zbigniew Lukasiak authored
View
2  Makefile.PL
@@ -15,8 +15,6 @@ requires 'Try::Tiny';
requires 'Template::Tiny';
build_requires 'Test::More';
-build_requires 'Config::Any';
-build_requires 'Config::General';
auto_install;
View
7 t/data/app.conf
@@ -1,7 +0,0 @@
-<renderer>
-root = t/data/templates
-</renderer>
-<schema>
-dbi_dsn = dbi:SQLite:dbname=t/tmp/dvdzbr.db
-</schema>
-
View
8 t/data/subclassapp.conf
@@ -1,8 +0,0 @@
-<renderer>
-root = t/data/subclassapp_templates
-root = t/data/templates
-</renderer>
-<schema>
-dbi_dsn = dbi:SQLite:dbname=t/tmp/dvdzbr.db
-</schema>
-
View
10 t/lib/MyApp.pm
@@ -3,22 +3,16 @@ use warnings;
package MyApp;
use base 'WebNano';
-use Object::Tiny::RW 'config';
-use Config::Any;
use WebNano::Renderer::TTiny;
sub new {
my $class = shift;
my $self = $class->SUPER::new( @_ );
- my $cfg = Config::Any->load_stems({ stems => [ $self->config_file ], use_ext => 1 });
- my @values = values %{$cfg->[0]};
- my $config = $values[0];
- $self->config( $config );
- $self->renderer( WebNano::Renderer::TTiny->new( %{ $config->{renderer} } ) );
+ $self->renderer( WebNano::Renderer::TTiny->new( $self->renderer_config() ) );
return $self;
}
-sub config_file { 't/data/app' }
+sub renderer_config { root => 't/data/templates' }
1;
View
2  t/lib/SubClassApp.pm
@@ -4,7 +4,7 @@ use warnings;
package SubClassApp;
use base 'MyApp';
-sub config_file { 't/data/subclassapp' }
+sub renderer_config { root => [ 't/data/subclassapp_templates', 't/data/templates' ] }
sub controller_search_path { [ ref(shift), 'MyApp' ] };
Please sign in to comment.
Something went wrong with that request. Please try again.