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

sartak at bestpractical.com sartak at bestpractical.com
Thu Mar 26 17:43:13 EDT 2009


The branch, master has been updated
       via  4f4a174689e282ed7030db097198f205dbc7d289 (commit)
       via  70e5a0365696aa0bd6034267f88e3e6d8c8ae8ae (commit)
      from  8d5bbe03188b1a622b4437ce69108ea556f9eced (commit)

Summary of changes:
 lib/App/Changeloggr/Action/AddChanges.pm |    2 +
 lib/App/Changeloggr/Model/Change.pm      |   49 ------------------------------
 lib/App/Changeloggr/Model/Changelog.pm   |    9 +++++
 3 files changed, 11 insertions(+), 49 deletions(-)

- Log -----------------------------------------------------------------
commit 70e5a0365696aa0bd6034267f88e3e6d8c8ae8ae
Author: Shawn M Moore <sartak at gmail.com>
Date:   Thu Mar 26 17:42:37 2009 -0400

    Remove half-assed plaintext git parsing

diff --git a/lib/App/Changeloggr/Model/Change.pm b/lib/App/Changeloggr/Model/Change.pm
index 47aa8b4..8bf54a7 100644
--- a/lib/App/Changeloggr/Model/Change.pm
+++ b/lib/App/Changeloggr/Model/Change.pm
@@ -39,55 +39,6 @@ sub current_user_can {
     return $self->SUPER::current_user_can($right, @_);
 }
 
-sub guess_type {
-    my $self = shift;
-    my $text = shift;
-
-    if ($text =~ /^commit [0-9a-f]{32}$/m) {
-        return 'git';
-    }
-
-    if ($text =~ /^-{70}$/m) {
-        return 'svk';
-    }
-
-    if ($text =~ /^\w{3} \w{3} +\d+ \d\d:\d\d:\d\d \w{3} \d{4}  /m) {
-        return 'darcs';
-    }
-
-    return 'unknown';
-}
-
-sub create_from_git {
-    my $self = shift;
-    my $text = shift;
-
-    $text =~ s{
-        ^
-        commit  \s* ([0-9a-f]{32}) \n
-        Author: \s* (.*) \n
-        Date:   \s* (.*) \n
-        ([\s\S]+?)
-        (?= commit \s* [0-9a-f]{32} \n | \z)
-    }{};
-
-    my ($identifier, $author, $date, $message) = ($1, $2, $3, $4);
-
-    $self->create(
-        identifier => $identifier,
-        author     => $author,
-        date       => $date,
-        message    => $message,
-    );
-
-    return $text;
-}
-
-sub create_from_svk {
-}
-
-sub create_from_darcs {
-}
 
 1;
 

commit 4f4a174689e282ed7030db097198f205dbc7d289
Author: Shawn M Moore <sartak at gmail.com>
Date:   Thu Mar 26 17:42:56 2009 -0400

    First half of Changelog->parse_and_add_changes($text)

diff --git a/lib/App/Changeloggr/Action/AddChanges.pm b/lib/App/Changeloggr/Action/AddChanges.pm
index aeccf06..91d9744 100644
--- a/lib/App/Changeloggr/Action/AddChanges.pm
+++ b/lib/App/Changeloggr/Action/AddChanges.pm
@@ -45,6 +45,8 @@ sub take_action {
     my $self = shift;
     my $changelog = $self->get_changelog;
 
+    $changelog->parse_and_add_changes($self->argument_value('changes'));
+
     $self->result->message("Added your changes!");
 }
 
diff --git a/lib/App/Changeloggr/Model/Changelog.pm b/lib/App/Changeloggr/Model/Changelog.pm
index a004d06..9b69e65 100644
--- a/lib/App/Changeloggr/Model/Changelog.pm
+++ b/lib/App/Changeloggr/Model/Changelog.pm
@@ -39,5 +39,14 @@ sub current_user_can {
     return $self->SUPER::current_user_can($right, %args);
 }
 
+sub parse_and_add_changes {
+    my $self = shift;
+    my $text = shift;
+
+    my $changes = App::Changeloggr::Model::ChangesCollection->create_from_text($text);
+
+    return $changes;
+}
+
 1;
 

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



More information about the Bps-public-commit mailing list