Permalink
Browse files

removing dependency on Config modules

  • Loading branch information...
1 parent 6240c7d commit 248d650485ccc1e070e05e8f3cdb7ad039966768 Zbigniew Lukasiak committed Sep 9, 2010
Showing with 3 additions and 26 deletions.
  1. +0 −2 Makefile.PL
  2. +0 −7 t/data/app.conf
  3. +0 −8 t/data/subclassapp.conf
  4. +2 −8 t/lib/MyApp.pm
  5. +1 −1 t/lib/SubClassApp.pm
View
@@ -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
@@ -1,7 +0,0 @@
-<renderer>
-root = t/data/templates
-</renderer>
-<schema>
-dbi_dsn = dbi:SQLite:dbname=t/tmp/dvdzbr.db
-</schema>
-
View
@@ -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
@@ -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
@@ -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' ] };

0 comments on commit 248d650

Please sign in to comment.