refactor a bit, add post class in prep for testing
Matt S Trout [Wed, 13 May 2009 13:41:47 +0000 (14:41 +0100)]
Makefile.PL [new file with mode: 0644]
lib/IronMunger/Calculate.pm
lib/IronMunger/Post.pm [new file with mode: 0644]
load.pl [new file with mode: 0644]

diff --git a/Makefile.PL b/Makefile.PL
new file mode 100644 (file)
index 0000000..43b8dd2
--- /dev/null
@@ -0,0 +1,11 @@
+use strict;
+use warnings;
+use inc::Module::Install;
+
+name 'IronMunger';
+
+requires 'MooseX::Declare';
+requires 'signatures';
+requires 'autobox::DateTime::Duration';
+
+WriteAll;
index 1178c81..76aa983 100644 (file)
@@ -2,8 +2,8 @@ package IronMunger::Calculate;
 
 use strict;
 use warnings;
-use signatures;
 use autobox::DateTime::Duration;
+use signatures;
 
 sub check_post_gap ($aperture, $days, @posts) {
   return @posts if @posts <= $aperture;
diff --git a/lib/IronMunger/Post.pm b/lib/IronMunger/Post.pm
new file mode 100644 (file)
index 0000000..2b43897
--- /dev/null
@@ -0,0 +1,10 @@
+use MooseX::Declare;
+
+class IronMunger::Post {
+
+  use MooseX::Types::DateTimeX qw(DateTime);
+
+  has at => (isa => DateTime, is => 'rw', required => 1);
+}
+
+1;
diff --git a/load.pl b/load.pl
new file mode 100644 (file)
index 0000000..293360d
--- /dev/null
+++ b/load.pl
@@ -0,0 +1,11 @@
+use DateTime;
+
+use IO::All;
+
+use Text::CSV_XS;
+
+use Data::Dumper qw(Dumper); $Data::Dumper::Indent = 1;
+
+my $in = io('csv/my_Jess_Robinson.csv');
+
+