Skip Menu |

This queue is for tickets about the XML-Feed CPAN distribution.

Report information
The Basics
Id: 45865
Status: rejected
Priority: 0/
Queue: XML-Feed

People
Owner: Nobody in particular
Requestors: RUZ [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.43
Fixed in: (no value)



Subject: new in XML::Feed::Entry bless using incorrect package
my $format_class = 'XML::Feed::Format::' . $format; eval "use $format_class"; Carp::croak("Unsupported format $format: $@") if $@; my $entry = bless {}, join('::', __PACKAGE__, "Format", $format); construction next to bless result in XML::Feed::Entry::Format::Atom that is incorrect. Replacing it with $format_class will fix issue. -- Best regards, Ruslan.
Subject: Re: [rt.cpan.org #45865] new in XML::Feed::Entry bless using incorrect package
Date: Fri, 8 May 2009 10:30:27 -0700
To: bug-XML-Feed [...] rt.cpan.org
From: Tatsuhiko Miyagawa <miyagawa [...] gmail.com>
On Fri, May 8, 2009 at 9:09 AM, Ruslan Zakirov via RT <bug-XML-Feed@rt.cpan.org> wrote: Show quoted text
>    my $format_class = 'XML::Feed::Format::' . $format; >    eval "use $format_class"; >    Carp::croak("Unsupported format $format: $@") if $@; >    my $entry = bless {}, join('::', __PACKAGE__, "Format", $format); > > construction next to bless result in XML::Feed::Entry::Format::Atom that is incorrect.
No, that's not incorrect. XML::Feed::Entry::Format::Atom *is* the class we want an object for. We define Entry subclasses in XML::Feed::Format::(RSS|Atom). Look at the source. Show quoted text
> Replacing it with $format_class will fix issue.
Which issue? -- Tatsuhiko Miyagawa
CC: RUZ [...] cpan.org
Subject: Re: [rt.cpan.org #45865] new in XML::Feed::Entry bless using incorrect package
Date: Fri, 8 May 2009 23:37:32 +0400
To: bug-XML-Feed [...] rt.cpan.org
From: Ruslan Zakirov <ruslan.zakirov [...] gmail.com>
Ok, probably I don't get internals and this module is not intended to build an entry from scratch. Just want to create a proper Atom entry. Switched to XML::Atom. On Fri, May 8, 2009 at 9:30 PM, miyagawa@gmail.com via RT <bug-XML-Feed@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=45865 > > > On Fri, May 8, 2009 at 9:09 AM, Ruslan Zakirov via RT > <bug-XML-Feed@rt.cpan.org> wrote:
>>    my $format_class = 'XML::Feed::Format::' . $format; >>    eval "use $format_class"; >>    Carp::croak("Unsupported format $format: $@") if $@; >>    my $entry = bless {}, join('::', __PACKAGE__, "Format", $format); >> >> construction next to bless result in XML::Feed::Entry::Format::Atom that is incorrect.
> > No, that's not incorrect. XML::Feed::Entry::Format::Atom *is* the > class we want an object for. We define Entry subclasses in > XML::Feed::Format::(RSS|Atom). Look at the source. >
>> Replacing it with $format_class will fix issue.
> > Which issue? > > -- > Tatsuhiko Miyagawa > >
-- Best regards, Ruslan.
Subject: Re: [rt.cpan.org #45865] new in XML::Feed::Entry bless using incorrect package
Date: Fri, 8 May 2009 13:14:08 -0700
To: bug-XML-Feed [...] rt.cpan.org
From: Tatsuhiko Miyagawa <miyagawa [...] gmail.com>
Show quoted text
> Ok, probably I don't get internals and this module is not intended to > build an entry from scratch. Just want to create a proper Atom entry. > Switched to XML::Atom.
It *is* intended to parse existent feeds AND build an feed/entry from scratch. my $feed = XML::Feed->new('Atom'); my $entry = XML::Feed::Entry->new; $entry->title("foo"); $feed->add_entry($entry); print $feed->as_xml; with XML::Atom you have more controls to what attributes to add etc. so that might fit your needs too, though. -- Tatsuhiko Miyagawa
CC: RUZ [...] cpan.org
Subject: Re: [rt.cpan.org #45865] new in XML::Feed::Entry bless using incorrect package
Date: Sat, 9 May 2009 00:24:36 +0400
To: bug-XML-Feed [...] rt.cpan.org
From: Ruslan Zakirov <ruslan.zakirov [...] gmail.com>
On Sat, May 9, 2009 at 12:14 AM, miyagawa@gmail.com via RT <bug-XML-Feed@rt.cpan.org> wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=45865 > >
>> Ok, probably I don't get internals and this module is not intended to >> build an entry from scratch. Just want to create a proper Atom entry. >> Switched to XML::Atom.
> > It *is* intended to parse existent feeds AND build an feed/entry from scratch. > >  my $feed = XML::Feed->new('Atom'); >  my $entry = XML::Feed::Entry->new; >  $entry->title("foo"); >  $feed->add_entry($entry); > >  print $feed->as_xml; > > with XML::Atom you have more controls to what attributes to add etc. > so that might fit your needs too, though.
Devils in details :) I don't need feed, but this doesn't matters now. http://cubloid.blogspot.com/2009/05/blogging-for-perl-geeks.html Show quoted text
> > -- > Tatsuhiko Miyagawa > >
-- Best regards, Ruslan.