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

sartak at bestpractical.com sartak at bestpractical.com
Thu Mar 26 17:58:27 EDT 2009


The branch, master has been updated
       via  80786370f6e90738fc8ed9f9583e537b92cbff3b (commit)
       via  513a9de98fd58a54f3a926afea5ff5b5ed3be77d (commit)
      from  25cd76e2ec00de81beb98622436a725a9ba41a9a (commit)

Summary of changes:
 Makefile.PL                                    |    1 +
 lib/App/Changeloggr/Model/ChangesCollection.pm |   34 ++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 0 deletions(-)
 create mode 100644 lib/App/Changeloggr/Model/ChangesCollection.pm

- Log -----------------------------------------------------------------
commit 513a9de98fd58a54f3a926afea5ff5b5ed3be77d
Author: Shawn M Moore <sartak at gmail.com>
Date:   Thu Mar 26 17:58:07 2009 -0400

    Add a ChangesCollection which has a parse-and-create loop

diff --git a/lib/App/Changeloggr/Model/ChangesCollection.pm b/lib/App/Changeloggr/Model/ChangesCollection.pm
new file mode 100644
index 0000000..89a0dcd
--- /dev/null
+++ b/lib/App/Changeloggr/Model/ChangesCollection.pm
@@ -0,0 +1,34 @@
+package App::Changeloggr::Model::ChangesCollection;
+use strict;
+use warnings;
+use base 'App::Changeloggr::Collection';
+use Params::Validate 'SCALAR';
+
+sub create_from_text {
+    my $self = shift;
+    my %args = validate(@_, {
+        text      => { type => SCALAR },
+        changelog => { isa => 'App::Changeloggr::Model::Changelog' },
+    });
+
+    my $text      = $args{text};
+    my $changelog = $args{changelog};
+    my $count     = 0;
+
+    while (length $text) {
+        my $change = App::Changeloggr::Model::Change->new;
+        my $newtext = $change->create_from_text(
+            changelog => $changelog,
+            text      => $text,
+        );
+
+        last if !defined($newtext);
+        $text = $newtext;
+        ++$count;
+    }
+
+    return ($count, $text;
+}
+
+1;
+

commit 80786370f6e90738fc8ed9f9583e537b92cbff3b
Author: Shawn M Moore <sartak at gmail.com>
Date:   Thu Mar 26 17:58:21 2009 -0400

    Dep on Params::Validate

diff --git a/Makefile.PL b/Makefile.PL
index a5baa97..b1dd42b 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -6,5 +6,6 @@ version     '0.01';
 requires    'Jifty' => '0.90220';
 requires    'JiftyX::ModelHelpers' => '0.22';
 requires    'Data::GUID';
+requires    'Params::Validate';
 
 WriteAll;

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



More information about the Bps-public-commit mailing list