Net::Google::Calendar のパッチ

2006/10/01 18:22 追記
早速対応してくれました。「Domou Arigato」と書いてるのに笑った。http://pause.perl.org/incoming/ を見るとアップ済みのようなので、もうすぐ CPAN へ反映されると思います。

Net::Google::Calendar がまともに動かないので、パッチ書いた。

Index: Net-Google-Calendar-0.3/lib/Net/Google/Calendar.pm
===================================================================
--- Net-Google-Calendar-0.3/lib/Net/Google/Calendar.pm (revision 285)
+++ Net-Google-Calendar-0.3/lib/Net/Google/Calendar.pm (revision 286)
@@ -348,7 +348,9 @@
     }
 
+    my $xml = $entry->as_xml;
+    _utf8_off($xml);
     my %params = ( Content_Type => 'application/atom+xml; charset=UTF-8',
                    Authorization => "GoogleLogin auth=".$self->{_auth},
-                   Content => $entry->as_xml );
+                   Content => $xml );
 
     $params{'X-HTTP-Method-Override'} = $method unless "POST" eq $method;
@@ -381,4 +383,10 @@
 }
 
+sub _utf8_off {
+    if ($] >= 5.008) {
+        require Encode;
+        return Encode::_utf8_off($_[0]);
+    }
+}
 
 =head1 WARNING
Index: Net-Google-Calendar-0.3/lib/Net/Google/Calendar/Entry.pm
===================================================================
--- Net-Google-Calendar-0.3/lib/Net/Google/Calendar/Entry.pm (revision 285)
+++ Net-Google-Calendar-0.3/lib/Net/Google/Calendar/Entry.pm (revision 286)
@@ -54,5 +54,5 @@
     my $self = shift;                                                                               
                                                                                                   
-    $self->category('', { scheme => 'http://schemas.google.com/g/2005#kind', term => 'http://schemas.google.com/g/2005#event' } );
+    $self->category( { scheme => 'http://schemas.google.com/g/2005#kind', term => 'http://schemas.google.com/g/2005#event' } );
                                                                                                   
     $self->{_gd_ns} = XML::Atom::Namespace->new(gd => 'http://schemas.google.com/g/2005');          
@@ -174,5 +174,5 @@
    my($ns, $name, $attr) = @_;
    my $ns_uri = ref($ns) eq 'XML::Atom::Namespace' ? $ns->{uri} : $ns;
-   my $node = first($atom->{doc}, $ns_uri, $name);
+   my $node = first($atom->elem, $ns_uri, $name);
    return $node unless defined $node && defined $attr;
    my $val;

rt.cpan.org でレポートしておいた。