[Bps-public-commit] net-lighthouse branch, master, updated. 562e8ca6660a1c1e20de5c3d8cf36971a2a05a69

sunnavy at bestpractical.com sunnavy at bestpractical.com
Mon Aug 31 01:54:25 EDT 2009


The branch, master has been updated
       via  562e8ca6660a1c1e20de5c3d8cf36971a2a05a69 (commit)
      from  2db4dc34fee200a8c019226ea0e4008f976d74d1 (commit)

Summary of changes:
 lib/Net/Lighthouse/Util.pm |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

- Log -----------------------------------------------------------------
commit 562e8ca6660a1c1e20de5c3d8cf36971a2a05a69
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Aug 31 13:54:06 2009 +0800

    handle yaml type in xml

diff --git a/lib/Net/Lighthouse/Util.pm b/lib/Net/Lighthouse/Util.pm
index 66396f7..12e4fac 100644
--- a/lib/Net/Lighthouse/Util.pm
+++ b/lib/Net/Lighthouse/Util.pm
@@ -4,6 +4,7 @@ use warnings;
 package Net::Lighthouse::Util;
 use XML::Simple;
 use DateTime;
+use YAML::Syck;
 
 sub translate_from_xml {
     my $class = shift;
@@ -27,6 +28,9 @@ sub translate_from_xml {
                     $ref->{$k} =
                       $class->datetime_from_string( $ref->{$k}{content} );
             }
+            elsif ( $ref->{$k}{type} && $ref->{$k}{type} eq 'yaml' ) {
+                    $ref->{$k} = Load( $ref->{$k}{content} );
+            }
             elsif ( defined $ref->{$k}{content} ) {
                 $ref->{$k} = $ref->{$k}{content};
             }

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



More information about the Bps-public-commit mailing list