diff _test/temp.pl @ 418:3f38dabaf5cc ref20150831

sync
author cin
date Mon, 28 Dec 2015 15:11:35 +0300
parents 3ed0c58e9da3
children bbc4739c4d48
line wrap: on
line diff
--- a/_test/temp.pl	Mon Nov 02 01:56:53 2015 +0300
+++ b/_test/temp.pl	Mon Dec 28 15:11:35 2015 +0300
@@ -3,9 +3,9 @@
 use Carp;
 use Time::HiRes qw(gettimeofday tv_interval);
 use Scalar::Util qw(blessed refaddr);
-use YAML::XS qw(Dump);
+use YAML::XS qw(Dump Load);
 
-my $t = [gettimeofday];
+
 
 use IMPL::require {
 	Container => 'IMPL::Config::Container',
@@ -14,36 +14,19 @@
 	Value => 'IMPL::Config::ValueDescriptor'
 };
 
-my $c1 = Container->new();
-
-$c1->Register('db', Service->new(
-    type => 'Foo::Data',
-    norequire => 1,
-    activation => 'container'
-) );
-
-$c1->Register(['sec', 'ldap'], Reference->new('db') );
+my $data;
+{
+	open my $h, "sample.yaml" or die;
+	binmode $h;
+	local $/;
+	$data = <$h>;
+}
 
-$c1->Register('mixed', Value->new([
-    Reference->new('db'),
-    Reference->new('sec'),
-    Reference->new('ldap')
-]));
+my $t = [gettimeofday];
 
-my $c2 = Container->new($c1);
-
-my $data = [ $c1->Resolve('mixed')] ;
+print Dump Load($data);
 
 print "Activated: ",tv_interval($t,[gettimeofday]),"\n";
 
-print Dump($data);
-
-
-package Foo::Data;
-use IMPL::declare {
-	base => [
-	   'IMPL::Object' => undef
-	]
-};
 
 1;