Revision history for Perl extension WWW::OpenSearch
-0.16 Tue May 25 2010
- - Fix tests for Test::More 0.95_02
-
-0.15 Thu Nov 19 2009
- - repackaged with a new version of Module::Install
-
-0.14 Thu Apr 17 2008
- - Handle broken LWP 5.810 in Makefile.PL
-
-0.13 Fri Dec 21 2007
- - Fix pod coverage (Ian Beckwith)
-
-0.12 Tue May 01 2007
- - switch from ||= to a "defined" idiom for some params
- - switch to Module::Install
-
-0.11 Tue Apr 17 2007
- - added a simple OSD parsing test
-
-0.10_02 Tue Jan 23 2007
- - fix Request.pm to clone the extra attributes we've
- added (Marc Tobias)
-
-0.10_01 Mon Jan 22 2007
- - use URI::Template for parsing OSD uri templates
- - added opensearch-specific Request and Agent classes
- - un-break get_best_url()
- - you can now pass a WWW::OpenSearch::Url to WWW::OpenSearch's
- search() method
- - added ns() (namespace) field to Url.pm
- - re-worked paging to use the new Request object
-
- [ THINGS THAT MAY BREAK YOUR CODE ]
- - using URI::Template means some methods are now proxied to
- that class
- - removed agent argument in new() in OpenSearch.pm
- - handling of POST requests in prepare_query() in Url.pm now
- returns data suitable for passing to HTTP::Request
- - un-link Response.pm and the parent WWW::OpenSearch object --
- a Response is now in the context of whatever
- WWW::OpenSearch::Url was used
-
-0.09 Thu Dec 07 2006
- - fix link fetching from atom feeds
-
-0.08 Wed Sep 13 2006
- - fix optional attributes for Image
- - added strict to Url object
-
-0.07 Mon Sep 11 2006
- - inflate query and image fields to objects for OSD 1.1
- - pod updates
-
-0.06_02 Thu Jul 20 2006
- - added tests
- - updated available description info
- - try to handle POST urls better
- - update XML::Atom calls to latest release API
- - added option to override the useragent from new()
- - fix undef warning
- - turn utf8 flag off for queries
-
-0.06_01 Thu May 18 2006
- - Complete re-write to handle OpenSearch 1.1/Atom
- - Now uses XML::Feed to abstract RSS and Atom
- - Improved OpenSearch Description/Url handling
- - Encapsulate returns in a Response object
-
-0.05 Mon Jan 9 18:30:18 UTC 2006
- - Added partial support of OpenSearch 1.1. There's no API change and
- old elements just work as before, with 1.1 OpenSearch document as
- well. See http://opensearch.a9.com/docs/upgrading10.jsp
- (Thanks to Masaaki Hirose)
-
-0.04 Sat Jul 29 18:34:31 PDT 2005
- - Drop off XML::Simple for efficiency.
- LibXMLify everything. Now you need XML::RSS::LibXML
-
-0.03 Sun Jul 24 02:36:46 PDT 2005
- - Hacked current_page so you can specify page number correctly
- (Thanks to Naoya Ito)
-
-0.02 Sat Mar 26 14:14:58 JST 2005
- - Added accessors for attributes
- - Fixed POD
-
-0.01 Thu Mar 17 20:45:13 2005
- - original version
+0.17 2013-01-18
+ - Avoid hash randomization problem in test (RT #82796)
+
+0.16 2010-05-25
+ - Fix tests for Test::More 0.95_02
+
+0.15 2009-11-19
+ - repackaged with a new version of Module::Install
+
+0.14 2008-04-17
+ - Handle broken LWP 5.810 in Makefile.PL
+
+0.13 2007-12-21
+ - Fix pod coverage (Ian Beckwith)
+
+0.12 2007-05-01
+ - switch from ||= to a "defined" idiom for some params
+ - switch to Module::Install
+
+0.11 2007-04-17
+ - added a simple OSD parsing test
+
+0.10_02 2007-01-23
+ - fix Request.pm to clone the extra attributes we've added (Marc Tobias)
+
+0.10_01 2007-01-22
+ - use URI::Template for parsing OSD uri templates
+ - added opensearch-specific Request and Agent classes
+ - un-break get_best_url()
+ - you can now pass a WWW::OpenSearch::Url to WWW::OpenSearch's search()
+ method
+ - added ns() (namespace) field to Url.pm
+ - re-worked paging to use the new Request object
+
+ [THINGS THAT MAY BREAK YOUR CODE]
+ - using URI::Template means some methods are now proxied to that class
+ - removed agent argument in new() in OpenSearch.pm
+ - handling of POST requests in prepare_query() in Url.pm now returns data
+ suitable for passing to HTTP::Request
+ - un-link Response.pm and the parent WWW::OpenSearch object -- a Response
+ is now in the context of whatever WWW::OpenSearch::Url was used
+
+0.09 2006-12-07
+ - fix link fetching from atom feeds
+
+0.08 2006-09-13
+ - fix optional attributes for Image
+ - added strict to Url object
+
+0.07 2006-09-11
+ - inflate query and image fields to objects for OSD 1.1
+ - pod updates
+
+0.06_02 2006-07-20
+ - added tests
+ - updated available description info
+ - try to handle POST urls better
+ - update XML::Atom calls to latest release API
+ - added option to override the useragent from new()
+ - fix undef warning
+ - turn utf8 flag off for queries
+
+0.06_01 2006-05-18
+ - Complete re-write to handle OpenSearch 1.1/Atom
+ - Now uses XML::Feed to abstract RSS and Atom
+ - Improved OpenSearch Description/Url handling
+ - Encapsulate returns in a Response object
+
+0.05 2006-01-09
+ - Added partial support of OpenSearch 1.1. There's no API change and old
+ elements just work as before, with 1.1 OpenSearch document as well. See
+ http://opensearch.a9.com/docs/upgrading10.jsp (Thanks to Masaaki Hirose)
+
+0.04 2005-07-29
+ - Drop off XML::Simple for efficiency. LibXMLify everything. Now you need
+ XML::RSS::LibXML
+
+0.03 2005-07-24
+ - Hacked current_page so you can specify page number correctly (Thanks to
+ Naoya Ito)
+
+0.02 2005-03-26
+ - Added accessors for attributes
+ - Fixed POD
+
+0.01 2005-03-17
+ - original version
author:
- 'Brian Cassidy <bricas@cpan.org>'
build_requires:
- ExtUtils::MakeMaker: 6.42
+ ExtUtils::MakeMaker: 6.59
Test::More: 0
configure_requires:
- ExtUtils::MakeMaker: 6.42
+ ExtUtils::MakeMaker: 6.59
distribution_type: module
-generated_by: 'Module::Install version 0.97'
+dynamic_config: 1
+generated_by: 'Module::Install version 1.06'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
resources:
license: http://dev.perl.org/licenses/
repository: http://github.com/bricas/www-opensearch
-version: 0.16
+version: 0.17
-use inc::Module::Install 0.97;
+use inc::Module::Install 1.00;
if ( -e 'MANIFEST.SKIP' ) {
system( 'pod2text lib/WWW/OpenSearch.pm > README' );
Tatsuhiko Miyagawa <miyagawa@bulknews.net>
COPYRIGHT AND LICENSE
- Copyright 2005-2010 by Tatsuhiko Miyagawa and Brian Cassidy
+ Copyright 2005-2013 by Tatsuhiko Miyagawa and Brian Cassidy
This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
use Cwd ();
use File::Find ();
use File::Path ();
-use FindBin;
use vars qw{$VERSION $MAIN};
BEGIN {
# This is not enforced yet, but will be some time in the next few
# releases once we can make sure it won't clash with custom
# Module::Install extensions.
- $VERSION = '0.97';
+ $VERSION = '1.06';
# Storage for the pseudo-singleton
$MAIN = undef;
sub new {
my ($class, %args) = @_;
- FindBin->again;
+ delete $INC{'FindBin.pm'};
+ {
+ # to suppress the redefine warning
+ local $SIG{__WARN__} = sub {};
+ require FindBin;
+ }
# ignore the prefix on extension modules built from top level.
my $base_path = Cwd::abs_path($FindBin::Bin);
}
sub _cmp ($$) {
- _version($_[0]) <=> _version($_[1]);
+ _version($_[1]) <=> _version($_[2]);
}
# Cloned from Params::Util::_CLASS
1;
-# Copyright 2008 - 2010 Adam Kennedy.
+# Copyright 2008 - 2012 Adam Kennedy.
use strict 'vars';
use vars qw{$VERSION};
BEGIN {
- $VERSION = '0.97';
+ $VERSION = '1.06';
}
# Suspend handler for "redefined" warnings
use strict;
use Config ();
-use File::Spec ();
use ExtUtils::MakeMaker ();
use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.97';
+ $VERSION = '1.06';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
eval { require $mod; $pkg->VERSION($ver || 0); 1 };
}
-# check if we can run some command
+# Check if we can run some command
sub can_run {
my ($self, $cmd) = @_;
for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
next if $dir eq '';
- my $abs = File::Spec->catfile($dir, $_[1]);
+ require File::Spec;
+ my $abs = File::Spec->catfile($dir, $cmd);
return $abs if (-x $abs or $abs = MM->maybe_command($abs));
}
return;
}
-# can we locate a (the) C compiler
+# Can our C compiler environment build XS files
+sub can_xs {
+ my $self = shift;
+
+ # Ensure we have the CBuilder module
+ $self->configure_requires( 'ExtUtils::CBuilder' => 0.27 );
+
+ # Do we have the configure_requires checker?
+ local $@;
+ eval "require ExtUtils::CBuilder;";
+ if ( $@ ) {
+ # They don't obey configure_requires, so it is
+ # someone old and delicate. Try to avoid hurting
+ # them by falling back to an older simpler test.
+ return $self->can_cc();
+ }
+
+ # Do we have a working C compiler
+ my $builder = ExtUtils::CBuilder->new(
+ quiet => 1,
+ );
+ unless ( $builder->have_compiler ) {
+ # No working C compiler
+ return 0;
+ }
+
+ # Write a C file representative of what XS becomes
+ require File::Temp;
+ my ( $FH, $tmpfile ) = File::Temp::tempfile(
+ "compilexs-XXXXX",
+ SUFFIX => '.c',
+ );
+ binmode $FH;
+ print $FH <<'END_C';
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+int main(int argc, char **argv) {
+ return 0;
+}
+
+int boot_sanexs() {
+ return 1;
+}
+
+END_C
+ close $FH;
+
+ # Can the C compiler access the same headers XS does
+ my @libs = ();
+ my $object = undef;
+ eval {
+ local $^W = 0;
+ $object = $builder->compile(
+ source => $tmpfile,
+ );
+ @libs = $builder->link(
+ objects => $object,
+ module_name => 'sanexs',
+ );
+ };
+ my $result = $@ ? 0 : 1;
+
+ # Clean up all the build files
+ foreach ( $tmpfile, $object, @libs ) {
+ next unless defined $_;
+ 1 while unlink;
+ }
+
+ return $result;
+}
+
+# Can we locate a (the) C compiler
sub can_cc {
my $self = shift;
my @chunks = split(/ /, $Config::Config{cc}) or return;
__END__
-#line 156
+#line 236
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.97';
+ $VERSION = '1.06';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
use strict 'vars';
use ExtUtils::MakeMaker ();
use Module::Install::Base ();
+use Fcntl qw/:flock :seek/;
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.97';
+ $VERSION = '1.06';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
require ExtUtils::MakeMaker;
if ( $perl_version and $self->_cmp($perl_version, '5.006') >= 0 ) {
- # MakeMaker can complain about module versions that include
- # an underscore, even though its own version may contain one!
- # Hence the funny regexp to get rid of it. See RT #35800
- # for details.
- my $v = $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/;
- $self->build_requires( 'ExtUtils::MakeMaker' => $v );
- $self->configure_requires( 'ExtUtils::MakeMaker' => $v );
+ # This previous attempted to inherit the version of
+ # ExtUtils::MakeMaker in use by the module author, but this
+ # was found to be untenable as some authors build releases
+ # using future dev versions of EU:MM that nobody else has.
+ # Instead, #toolchain suggests we use 6.59 which is the most
+ # stable version on CPAN at time of writing and is, to quote
+ # ribasushi, "not terminally fucked, > and tested enough".
+ # TODO: We will now need to maintain this over time to push
+ # the version up as new versions are released.
+ $self->build_requires( 'ExtUtils::MakeMaker' => 6.59 );
+ $self->configure_requires( 'ExtUtils::MakeMaker' => 6.59 );
} else {
# Allow legacy-compatibility with 5.005 by depending on the
# most recent EU:MM that supported 5.005.
- $self->build_requires( 'ExtUtils::MakeMaker' => 6.42 );
- $self->configure_requires( 'ExtUtils::MakeMaker' => 6.42 );
+ $self->build_requires( 'ExtUtils::MakeMaker' => 6.36 );
+ $self->configure_requires( 'ExtUtils::MakeMaker' => 6.36 );
}
# Generate the MakeMaker params
'all_from' if you prefer) in Makefile.PL.
EOT
- $DB::single = 1;
if ( $self->tests ) {
my @tests = split ' ', $self->tests;
my %seen;
. ($self->postamble || '');
local *MAKEFILE;
- open MAKEFILE, "< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+ open MAKEFILE, "+< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+ eval { flock MAKEFILE, LOCK_EX };
my $makefile = do { local $/; <MAKEFILE> };
- close MAKEFILE or die $!;
$makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /;
$makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
# XXX - This is currently unused; not sure if it breaks other MM-users
# $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg;
- open MAKEFILE, "> $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+ seek MAKEFILE, 0, SEEK_SET;
+ truncate MAKEFILE, 0;
print MAKEFILE "$preamble$makefile$postamble" or die $!;
close MAKEFILE or die $!;
__END__
-#line 539
+#line 544
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.97';
+ $VERSION = '1.06';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
sub install_as_vendor { $_[0]->installdirs('vendor') }
sub dynamic_config {
- my $self = shift;
- unless ( @_ ) {
- warn "You MUST provide an explicit true/false value to dynamic_config\n";
- return $self;
+ my $self = shift;
+ my $value = @_ ? shift : 1;
+ if ( $self->{values}->{dynamic_config} ) {
+ # Once dynamic we never change to static, for safety
+ return 0;
}
- $self->{values}->{dynamic_config} = $_[0] ? 1 : 0;
+ $self->{values}->{dynamic_config} = $value ? 1 : 0;
return 1;
}
+# Convenience command
+sub static_config {
+ shift->dynamic_config(0);
+}
+
sub perl_version {
my $self = shift;
return $self->{values}->{perl_version} unless @_;
# Normalize the version
$version = $self->_perl_version($version);
- # We don't support the reall old versions
+ # We don't support the really old versions
unless ( $version >= 5.005 ) {
die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n";
}
'GNU Free Documentation license' => 'unrestricted', 1,
'GNU Affero General Public License' => 'open_source', 1,
'(?:Free)?BSD license' => 'bsd', 1,
+ 'Artistic license 2\.0' => 'artistic_2', 1,
'Artistic license' => 'artistic', 1,
'Apache (?:Software )?license' => 'apache', 1,
'GPL' => 'gpl', 1,
sub _extract_bugtracker {
my @links = $_[0] =~ m#L<(
- \Qhttp://rt.cpan.org/\E[^>]+|
- \Qhttp://github.com/\E[\w_]+/[\w_]+/issues|
- \Qhttp://code.google.com/p/\E[\w_\-]+/issues/list
+ https?\Q://rt.cpan.org/\E[^>]+|
+ https?\Q://github.com/\E[\w_]+/[\w_]+/issues|
+ https?\Q://code.google.com/p/\E[\w_\-]+/issues/list
)>#gx;
my %links;
@links{@links}=();
sub requires_from {
my $self = shift;
my $content = Module::Install::_readperl($_[0]);
- my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg;
+ my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+(v?[\d\.]+)/mg;
while ( @requires ) {
my $module = shift @requires;
my $version = shift @requires;
return $v;
}
-
-
+sub add_metadata {
+ my $self = shift;
+ my %hash = @_;
+ for my $key (keys %hash) {
+ warn "add_metadata: $key is not prefixed with 'x_'.\n" .
+ "Use appopriate function to add non-private metadata.\n" unless $key =~ /^x_/;
+ $self->{values}->{$key} = $hash{$key};
+ }
+}
######################################################################
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.97';
+ $VERSION = '1.06';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.97';;
+ $VERSION = '1.06';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
__PACKAGE__->mk_accessors( qw( description_url agent description ) );
-our $VERSION = '0.16';
+our $VERSION = '0.17';
=head1 NAME
=head1 COPYRIGHT AND LICENSE
-Copyright 2005-2010 by Tatsuhiko Miyagawa and Brian Cassidy
+Copyright 2005-2013 by Tatsuhiko Miyagawa and Brian Cassidy
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=head1 COPYRIGHT AND LICENSE
-Copyright 2005-2010 by Tatsuhiko Miyagawa and Brian Cassidy
+Copyright 2005-2013 by Tatsuhiko Miyagawa and Brian Cassidy
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=head1 COPYRIGHT AND LICENSE
-Copyright 2005-2010 by Tatsuhiko Miyagawa and Brian Cassidy
+Copyright 2005-2013 by Tatsuhiko Miyagawa and Brian Cassidy
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=head1 COPYRIGHT AND LICENSE
-Copyright 2005-2010 by Tatsuhiko Miyagawa and Brian Cassidy
+Copyright 2005-2013 by Tatsuhiko Miyagawa and Brian Cassidy
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=head1 COPYRIGHT AND LICENSE
-Copyright 2005-2010 by Tatsuhiko Miyagawa and Brian Cassidy
+Copyright 2005-2013 by Tatsuhiko Miyagawa and Brian Cassidy
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=head1 COPYRIGHT AND LICENSE
-Copyright 2005-2010 by Tatsuhiko Miyagawa and Brian Cassidy
+Copyright 2005-2013 by Tatsuhiko Miyagawa and Brian Cassidy
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=head1 COPYRIGHT AND LICENSE
-Copyright 2005-2010 by Tatsuhiko Miyagawa and Brian Cassidy
+Copyright 2005-2013 by Tatsuhiko Miyagawa and Brian Cassidy
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=head1 COPYRIGHT AND LICENSE
-Copyright 2005-2010 by Tatsuhiko Miyagawa and Brian Cassidy
+Copyright 2005-2013 by Tatsuhiko Miyagawa and Brian Cassidy
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
isa_ok( $req, 'WWW::OpenSearch::Request' );
is( lc $req->method, 'post', 'method' );
is( $req->uri, 'https://intranet/search?format=html', 'uri' );
- is( $req->content, 'l=*&c=&s=iPod&o=1', 'content' );
+ is( _sort_result( $req->content ), 'c=&l=*&o=1&s=iPod', 'content' );
}
{
is( $req->uri, 'http://example.com/?q=iPod&pw=1&format=atom', 'uri' );
}
}
+
+sub _sort_result {
+ my $s = shift;
+ return join( '&',
+ sort { substr( $a, 0, 1 ) cmp substr( $b, 0, 1 ) }
+ split( /\&/, $s ) );
+}