Changeset 250


Ignore:
Timestamp:
May 11, 2006, 10:38:50 PM (14 years ago)
Author:
Dominic Hargreaves
Message:

Wiki::Toolkit::Feed::RSS (note tests fail currently)

Location:
wiki-toolkit/trunk
Files:
2 edited
1 copied

Legend:

Unmodified
Added
Removed
  • wiki-toolkit/trunk/Changes

    r238 r250  
     10.69_03 11 May 2006
     2        Add Wiki::Toolkit::Feed::RSS (formerly CGI::Wiki::Plugin::RSS::Modwiki)
     3
    140.69_02 27 April 2006
    25        Add missing new file lib/Wiki/Toolkit/Setup/Database.pm to
  • wiki-toolkit/trunk/lib/Wiki/Toolkit/Feed/RSS.pm

    r249 r250  
    1 package CGI::Wiki::Plugin::RSS::ModWiki;
     1package Wiki::Toolkit::Feed::RSS;
    22
    33use strict;
    44
    55use vars qw( $VERSION );
    6 $VERSION = '0.09';
     6$VERSION = '0.10';
    77
    88use POSIX 'strftime';
     
    2020  my $wiki = $args{wiki};
    2121
    22   unless ($wiki && UNIVERSAL::isa($wiki, 'CGI::Wiki'))
    23   {
    24     croak 'No CGI::Wiki object supplied';
     22  unless ($wiki && UNIVERSAL::isa($wiki, 'Wiki::Toolkit'))
     23  {
     24    croak 'No Wiki::Toolkit object supplied';
    2525  }
    2626 
     
    4141  }
    4242
    43   $self->{timestamp_fmt} = $CGI::Wiki::Store::Database::timestamp_fmt;
     43  $self->{timestamp_fmt} = $Wiki::Toolkit::Store::Database::timestamp_fmt;
    4444  $self->{utc_offset} = strftime "%z", localtime;
    4545  $self->{utc_offset} =~ s/(..)(..)$/$1:$2/;
     
    267267=head1 NAME
    268268
    269   CGI::Wiki::Plugin::RSS::ModWiki - A CGI::Wiki plugin to output RecentChanges RSS.
     269  Wiki::Toolkit::Feed::RSS - Output RecentChanges RSS for Wiki::Toolkit.
    270270
    271271=head1 DESCRIPTION
    272272
    273 This is an alternative access to the recent changes of a CGI::Wiki
     273This is an alternative access to the recent changes of a Wiki::Toolkit
    274274wiki. It outputs RSS as described by the ModWiki proposal at
    275275L<http://www.usemod.com/cgi-bin/mb.pl?ModWiki>
     
    277277=head1 SYNOPSIS
    278278
    279   use CGI::Wiki;
    280   use CGI::Wiki::Plugin::RSS::ModWiki;
    281 
    282   my $wiki = CGI::Wiki->new( ... );  # See perldoc CGI::Wiki
     279  use Wiki::Toolkit;
     280  use Wiki::Toolkit::Feed::RSS;
     281
     282  my $wiki = CGI::Wiki->new( ... );  # See perldoc Wiki::Toolkit
    283283
    284284  # Set up the RSS feeder with the mandatory arguments - see
    285285  # C<new()> below for more, optional, arguments.
    286   my $rss = CGI::Wiki::Plugin::RSS::ModWiki->new(
     286  my $rss = Wiki::Toolkit::Feed::RSS->new(
    287287    wiki                => $wiki,
    288288    site_name           => 'My Wiki',
     
    303303=head2 C<new()>
    304304
    305   my $rss = CGI::Wiki::Plugin::RSS::ModWiki->new(
     305  my $rss = Wiki::Toolkit::Feed::RSS->new(
    306306    # Mandatory arguments:
    307307    wiki                 => $wiki,
     
    330330    software_name        => $your_software_name,     # e.g. "CGI::Wiki"
    331331    software_version     => $your_software_version,  # e.g. "0.73"
    332     software_homepage    => $your_software_homepage, # e.g. "http://search.cpan.org/dist/CGI-Wiki/"
     332    software_homepage    => $your_software_homepage, # e.g. "http://search.cpan.org/dist/Wiki-Toolkit/"
    333333  );
    334334
    335 C<wiki> must be a L<CGI::Wiki> object. C<make_node_url>, and
     335C<wiki> must be a L<Wiki::Toolkit> object. C<make_node_url>, and
    336336C<make_diff_url> and C<make_history_url>, if supplied, must be coderefs.
    337337
     
    403403B<Note:> Many of the fields emitted by the RSS generator are taken
    404404from the node metadata. The form of this metadata is I<not> mandated
    405 by L<CGI::Wiki>. Your wiki application should make sure to store some or
     405by L<Wiki::Toolkit>. Your wiki application should make sure to store some or
    406406all of the following metadata when calling C<write_node>:
    407407
     
    432432=over 4
    433433
    434 =item * L<CGI::Wiki>
     434=item * L<Wiki::Toolkit>
    435435
    436436=item * L<http://web.resource.org/rss/1.0/spec>
     
    442442=head1 MAINTAINER
    443443
    444 Earle Martin <EMARTIN@cpan.org>. Originally by Kake Pugh <kake@earth.li>.
     444The Wiki::Toolkit project. Originally by Kake Pugh <kake@earth.li>.
    445445
    446446=head1 COPYRIGHT AND LICENSE
    447447
    448 Copyright 2003-4 Kake Pugh. Subsequent modifications copyright 2005
    449 Earle Martin.
     448Copyright 2003-4 Kake Pugh.
     449Copyright 2005 Earle Martin.
     450Copyright 2006 the Wiki::Toolkit team
    450451
    451452This module is free software; you can redistribute it and/or modify it
  • wiki-toolkit/trunk/t/299_feed_rss_recentchanges.t

    r247 r250  
    11use strict;
    2 use CGI::Wiki::TestConfig::Utilities;
    3 use CGI::Wiki;
     2use Wiki::Toolkit::TestConfig::Utilities;
     3use Wiki::Toolkit;
    44use URI::Escape;
    55
    66use Test::More tests =>
    7   (3 + 17 * $CGI::Wiki::TestConfig::Utilities::num_stores);
     7  (3 + 17 * $Wiki::Toolkit::TestConfig::Utilities::num_stores);
    88
    9 use_ok( "CGI::Wiki::Plugin::RSS::ModWiki" );
     9use_ok( "Wiki::Toolkit::Feed::RSS" );
    1010
    11 eval { my $rss = CGI::Wiki::Plugin::RSS::ModWiki->new; };
     11eval { my $rss = Wiki::Toolkit::Feed::RSS->new; };
    1212ok( $@, "new croaks if no wiki object supplied" );
    1313
    1414eval {
    15         my $rss = CGI::Wiki::Plugin::RSS::ModWiki->new( wiki => "foo" );
     15        my $rss = Wiki::Toolkit::Feed::RSS->new( wiki => "foo" );
    1616     };
    1717ok( $@, "new croaks if something that isn't a wiki object supplied" );
    1818
    19 my %stores = CGI::Wiki::TestConfig::Utilities->stores;
     19my %stores = Wiki::Toolkit::TestConfig::Utilities->stores;
    2020
    2121my ($store_name, $store);
     
    2727      print "#\n##### TEST CONFIG: Store: $store_name\n#\n";
    2828
    29       my $wiki = CGI::Wiki->new( store => $store );
     29      my $wiki = Wiki::Toolkit->new( store => $store );
    3030      my %default_config = (
    3131              wiki => $wiki,
    32               site_name => "CGI::Wiki Test Site",
     32              site_name => "Wiki::Toolkit Test Site",
    3333              make_node_url => sub {
    3434                                     my $id = uri_escape($_[0]);
     
    4040      );
    4141      my $rss = eval {
    42           CGI::Wiki::Plugin::RSS::ModWiki->new( %default_config, site_url => "http://example.com/kakeswiki/" );
     42          Wiki::Toolkit::Feed::RSS->new( %default_config, site_url => "http://example.com/kakeswiki/" );
    4343      };
    4444      is( $@, "",
    4545         "'new' doesn't croak if wiki object and mandatory parameters supplied"
    4646      );
    47       isa_ok( $rss, "CGI::Wiki::Plugin::RSS::ModWiki" );
     47      isa_ok( $rss, "Wiki::Toolkit::Feed::RSS" );
    4848
    4949      my $feed = eval { $rss->recent_changes; };
     
    7171
    7272      # Check that interwiki things are passed through right.
    73       $rss = CGI::Wiki::Plugin::RSS::ModWiki->new(
     73      $rss = Wiki::Toolkit::Feed::RSS->new(
    7474          %default_config,
    7575          interwiki_identifier => "KakesWiki",
     
    8181
    8282      # Check that diff url comes through.
    83       $rss = CGI::Wiki::Plugin::RSS::ModWiki->new(
     83      $rss = Wiki::Toolkit::Feed::RSS->new(
    8484          %default_config,
    8585          make_diff_url        => sub {
     
    9595
    9696      # Check that history url comes through.
    97       $rss = CGI::Wiki::Plugin::RSS::ModWiki->new(
     97      $rss = Wiki::Toolkit::Feed::RSS->new(
    9898          %default_config,
    9999          make_history_url        => sub {
Note: See TracChangeset for help on using the changeset viewer.