[Bps-public-commit] App-Changeloggr branch, master, updated. f0f2b2588df69c076303d5d00a45ac67bce322e1

sartak at bestpractical.com sartak at bestpractical.com
Thu Mar 26 18:27:19 EDT 2009


The branch, master has been updated
       via  f0f2b2588df69c076303d5d00a45ac67bce322e1 (commit)
      from  5d5866509e02a450b2b89f88e3068076e096abff (commit)

Summary of changes:
 lib/App/Changeloggr/Model/ChangesCollection.pm |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

- Log -----------------------------------------------------------------
commit f0f2b2588df69c076303d5d00a45ac67bce322e1
Author: Shawn M Moore <sartak at gmail.com>
Date:   Thu Mar 26 18:27:04 2009 -0400

    Don't have Changes create themselves, create them in the collection

diff --git a/lib/App/Changeloggr/Model/ChangesCollection.pm b/lib/App/Changeloggr/Model/ChangesCollection.pm
index 5bb182b..f6c4b93 100644
--- a/lib/App/Changeloggr/Model/ChangesCollection.pm
+++ b/lib/App/Changeloggr/Model/ChangesCollection.pm
@@ -15,18 +15,31 @@ sub create_from_text {
     my $changelog = $args{changelog};
 
     while (length $text) {
+        my ($fields, $newtext) = $self->extract_change_data_from_text($text);
+        last if !defined($newtext);
+
         my $change = App::Changeloggr::Model::Change->new;
-        my $newtext = $change->create_from_text(
+        $change->create(
+            %$fields,
             changelog => $changelog,
-            text      => $text,
         );
+        $self->add_record($change);
 
-        last if !defined($newtext);
         $text = $newtext;
     }
 
     return $text;
 }
 
+sub extract_change_data_from_text {
+    my $self = shift;
+    my $text = shift;
+    my %fields;
+
+
+
+    return (\%fields, $text);
+}
+
 1;
 

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list