Hello community, here is the log from the commit of package perl-WWW-Mechanize for openSUSE:Factory checked in at 2019-10-11 17:14:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-WWW-Mechanize (Old) and /work/SRC/openSUSE:Factory/.perl-WWW-Mechanize.new.2352 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-WWW-Mechanize" Fri Oct 11 17:14:53 2019 rev:27 rq:737519 version:1.94 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-WWW-Mechanize/perl-WWW-Mechanize.changes 2019-09-02 12:42:16.865780449 +0200 +++ /work/SRC/openSUSE:Factory/.perl-WWW-Mechanize.new.2352/perl-WWW-Mechanize.changes 2019-10-11 17:14:54.553591217 +0200 @@ -1,0 +2,27 @@ +Fri Oct 11 09:04:38 UTC 2019 - <[email protected]> + +- updated to 1.94 + see /usr/share/doc/packages/perl-WWW-Mechanize/Changes + + 1.94 2019-10-10 13:12:28Z + [FIXED] + - Issue #182: Don't autocheck for mech-dump so basic auth works (GH#285) + (Julien Fiegehenn) + + [DOCUMENTATION] + - Fix pod error reported by CPANTS. (GH#284) (Mohammad S Anwar) + +------------------------------------------------------------------- +Mon Oct 7 10:43:25 UTC 2019 - <[email protected]> + +- updated to 1.93 + see /usr/share/doc/packages/perl-WWW-Mechanize/Changes + + 1.93 2019-10-04 21:06:49Z + [FIXED] + - Allow images to not have a src attribute (GH#282) (Julien Fiegehenn) + + [DOCUMENTATION] + - Pod fixes. (GH#283) (Mohammad S Anwar) + +------------------------------------------------------------------- Old: ---- WWW-Mechanize-1.92.tar.gz New: ---- WWW-Mechanize-1.94.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-WWW-Mechanize.spec ++++++ --- /var/tmp/diff_new_pack.DO3qAP/_old 2019-10-11 17:14:55.029589999 +0200 +++ /var/tmp/diff_new_pack.DO3qAP/_new 2019-10-11 17:14:55.029589999 +0200 @@ -17,7 +17,7 @@ Name: perl-WWW-Mechanize -Version: 1.92 +Version: 1.94 Release: 0 %define cpan_name WWW-Mechanize Summary: Handy web browsing in a Perl object @@ -87,6 +87,7 @@ %prep %setup -q -n %{cpan_name}-%{version} +find . -type f ! -name \*.pl -print0 | xargs -0 chmod 644 %build perl Makefile.PL INSTALLDIRS=vendor ++++++ WWW-Mechanize-1.92.tar.gz -> WWW-Mechanize-1.94.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WWW-Mechanize-1.92/CONTRIBUTORS new/WWW-Mechanize-1.94/CONTRIBUTORS --- old/WWW-Mechanize-1.92/CONTRIBUTORS 2019-08-24 03:00:40.000000000 +0200 +++ new/WWW-Mechanize-1.94/CONTRIBUTORS 2019-10-10 15:12:38.000000000 +0200 @@ -27,6 +27,7 @@ * Jason May * Jesse Vincent * John Beppu + * Julien Fiegehenn * Karen Etheridge * Kirrily 'Skud' Robert * Kivanc Yazan @@ -45,7 +46,6 @@ * Schuyler Langdon * Sergey Romanov * Shoichi Kaji - * simbabque * Steve Scaffidi * Stuart Johnston * sunnavy diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WWW-Mechanize-1.92/Changes new/WWW-Mechanize-1.94/Changes --- old/WWW-Mechanize-1.92/Changes 2019-08-24 03:00:40.000000000 +0200 +++ new/WWW-Mechanize-1.94/Changes 2019-10-10 15:12:38.000000000 +0200 @@ -1,5 +1,20 @@ Revision history for WWW::Mechanize +1.94 2019-10-10 13:12:28Z + [FIXED] + - Issue #182: Don't autocheck for mech-dump so basic auth works (GH#285) + (Julien Fiegehenn) + + [DOCUMENTATION] + - Fix pod error reported by CPANTS. (GH#284) (Mohammad S Anwar) + +1.93 2019-10-04 21:06:49Z + [FIXED] + - Allow images to not have a src attribute (GH#282) (Julien Fiegehenn) + + [DOCUMENTATION] + - Pod fixes. (GH#283) (Mohammad S Anwar) + 1.92 2019-08-24 01:00:35Z [FIXED] - Test requires HTTP::Daemon 6.05+ and uses 127.0.0.1 or [::1] according to diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WWW-Mechanize-1.92/MANIFEST new/WWW-Mechanize-1.94/MANIFEST --- old/WWW-Mechanize-1.92/MANIFEST 2019-08-24 03:00:40.000000000 +0200 +++ new/WWW-Mechanize-1.94/MANIFEST 2019-10-10 15:12:38.000000000 +0200 @@ -8,7 +8,6 @@ META.yml Makefile.PL README.md -bin/mech-dump cpanfile dist.ini etc/www-mechanize-logo.png @@ -20,6 +19,7 @@ lib/WWW/Mechanize/Link.pm perlcriticrc perltidyrc +script/mech-dump t/00-load.t t/00-report-prereqs.dd t/00-report-prereqs.t diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WWW-Mechanize-1.92/META.json new/WWW-Mechanize-1.94/META.json --- old/WWW-Mechanize-1.92/META.json 2019-08-24 03:00:40.000000000 +0200 +++ new/WWW-Mechanize-1.94/META.json 2019-10-10 15:12:38.000000000 +0200 @@ -109,15 +109,15 @@ "provides" : { "WWW::Mechanize" : { "file" : "lib/WWW/Mechanize.pm", - "version" : "1.92" + "version" : "1.94" }, "WWW::Mechanize::Image" : { "file" : "lib/WWW/Mechanize/Image.pm", - "version" : "1.92" + "version" : "1.94" }, "WWW::Mechanize::Link" : { "file" : "lib/WWW/Mechanize/Link.pm", - "version" : "1.92" + "version" : "1.94" } }, "release_status" : "stable", @@ -132,7 +132,7 @@ "web" : "https://github.com/libwww-perl/WWW-Mechanize" } }, - "version" : "1.92", + "version" : "1.94", "x_Dist_Zilla" : { "perl" : { "version" : "5.026001" @@ -239,8 +239,8 @@ "class" : "Dist::Zilla::Plugin::InstallGuide", "config" : { "Dist::Zilla::Role::ModuleMetadata" : { - "Module::Metadata" : "1.000033", - "version" : "0.004" + "Module::Metadata" : "1.000036", + "version" : "0.006" } }, "name" : "@Author::OALDERS/InstallGuide", @@ -502,8 +502,8 @@ "class" : "Dist::Zilla::Plugin::StaticInstall", "config" : { "Dist::Zilla::Plugin::StaticInstall" : { - "dry_run" : 1, - "mode" : "auto" + "dry_run" : 0, + "mode" : "on" } }, "name" : "@Author::OALDERS/StaticInstall", @@ -522,7 +522,7 @@ { "class" : "Dist::Zilla::Plugin::CheckIssues", "name" : "@Author::OALDERS/CheckIssues", - "version" : "0.010" + "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", @@ -619,7 +619,7 @@ "branch" : null, "changelog" : "Changes", "signed" : 0, - "tag" : "v1.92", + "tag" : "v1.94", "tag_format" : "v%V", "tag_message" : "v%V" }, @@ -769,8 +769,8 @@ "meta_noindex" : 1 }, "Dist::Zilla::Role::ModuleMetadata" : { - "Module::Metadata" : "1.000033", - "version" : "0.004" + "Module::Metadata" : "1.000036", + "version" : "0.006" } }, "name" : "MetaProvides::Package", @@ -862,6 +862,7 @@ "Jason May <[email protected]>", "Jesse Vincent <[email protected]>", "John Beppu <[email protected]>", + "Julien Fiegehenn <[email protected]>", "Karen Etheridge <[email protected]>", "Kirrily 'Skud' Robert <[email protected]>", "Kivanc Yazan <[email protected]>", @@ -880,7 +881,6 @@ "Schuyler Langdon <[email protected]>", "Sergey Romanov <[email protected]>", "Shoichi Kaji <[email protected]>", - "simbabque <[email protected]>", "Steve Scaffidi <[email protected]>", "Stuart Johnston <[email protected]>", "sunnavy <[email protected]>", @@ -889,6 +889,7 @@ "Zefram <[email protected]>" ], "x_generated_by_perl" : "v5.26.1", - "x_serialization_backend" : "Cpanel::JSON::XS version 4.04" + "x_serialization_backend" : "Cpanel::JSON::XS version 4.10", + "x_static_install" : 1 } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WWW-Mechanize-1.92/META.yml new/WWW-Mechanize-1.94/META.yml --- old/WWW-Mechanize-1.92/META.yml 2019-08-24 03:00:40.000000000 +0200 +++ new/WWW-Mechanize-1.94/META.yml 2019-10-10 15:12:38.000000000 +0200 @@ -41,13 +41,13 @@ provides: WWW::Mechanize: file: lib/WWW/Mechanize.pm - version: '1.92' + version: '1.94' WWW::Mechanize::Image: file: lib/WWW/Mechanize/Image.pm - version: '1.92' + version: '1.94' WWW::Mechanize::Link: file: lib/WWW/Mechanize/Link.pm - version: '1.92' + version: '1.94' requires: Carp: '0' Getopt::Long: '0' @@ -72,7 +72,7 @@ bugtracker: https://github.com/libwww-perl/WWW-Mechanize/issues homepage: https://github.com/libwww-perl/WWW-Mechanize repository: https://github.com/libwww-perl/WWW-Mechanize.git -version: '1.92' +version: '1.94' x_Dist_Zilla: perl: version: '5.026001' @@ -157,8 +157,8 @@ class: Dist::Zilla::Plugin::InstallGuide config: Dist::Zilla::Role::ModuleMetadata: - Module::Metadata: '1.000033' - version: '0.004' + Module::Metadata: '1.000036' + version: '0.006' name: '@Author::OALDERS/InstallGuide' version: '1.200013' - @@ -360,8 +360,8 @@ class: Dist::Zilla::Plugin::StaticInstall config: Dist::Zilla::Plugin::StaticInstall: - dry_run: 1 - mode: auto + dry_run: 0 + mode: on name: '@Author::OALDERS/StaticInstall' version: '0.012' - @@ -375,7 +375,7 @@ - class: Dist::Zilla::Plugin::CheckIssues name: '@Author::OALDERS/CheckIssues' - version: '0.010' + version: '0.011' - class: Dist::Zilla::Plugin::ConfirmRelease name: '@Author::OALDERS/ConfirmRelease' @@ -450,7 +450,7 @@ branch: ~ changelog: Changes signed: 0 - tag: v1.92 + tag: v1.94 tag_format: v%V tag_message: v%V Dist::Zilla::Role::Git::Repo: @@ -560,8 +560,8 @@ inherit_version: '1' meta_noindex: '1' Dist::Zilla::Role::ModuleMetadata: - Module::Metadata: '1.000033' - version: '0.004' + Module::Metadata: '1.000036' + version: '0.006' name: MetaProvides::Package version: '2.004003' - @@ -635,6 +635,7 @@ - 'Jason May <[email protected]>' - 'Jesse Vincent <[email protected]>' - 'John Beppu <[email protected]>' + - 'Julien Fiegehenn <[email protected]>' - 'Karen Etheridge <[email protected]>' - "Kirrily 'Skud' Robert <[email protected]>" - 'Kivanc Yazan <[email protected]>' @@ -653,7 +654,6 @@ - 'Schuyler Langdon <[email protected]>' - 'Sergey Romanov <[email protected]>' - 'Shoichi Kaji <[email protected]>' - - 'simbabque <[email protected]>' - 'Steve Scaffidi <[email protected]>' - 'Stuart Johnston <[email protected]>' - 'sunnavy <[email protected]>' @@ -661,4 +661,5 @@ - 'Ville Skyttä <[email protected]>' - 'Zefram <[email protected]>' x_generated_by_perl: v5.26.1 -x_serialization_backend: 'YAML::Tiny version 1.70' +x_serialization_backend: 'YAML::Tiny version 1.73' +x_static_install: 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WWW-Mechanize-1.92/Makefile.PL new/WWW-Mechanize-1.94/Makefile.PL --- old/WWW-Mechanize-1.92/Makefile.PL 2019-08-24 03:00:40.000000000 +0200 +++ new/WWW-Mechanize-1.94/Makefile.PL 2019-10-10 15:12:38.000000000 +0200 @@ -14,7 +14,7 @@ }, "DISTNAME" => "WWW-Mechanize", "EXE_FILES" => [ - "bin/mech-dump" + "script/mech-dump" ], "LICENSE" => "perl", "MIN_PERL_VERSION" => "5.006", @@ -62,7 +62,7 @@ "lib" => 0, "vars" => 0 }, - "VERSION" => "1.92", + "VERSION" => "1.94", "test" => { "TESTS" => "t/*.t t/local/*.t t/mech-dump/*.t" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WWW-Mechanize-1.92/README.md new/WWW-Mechanize-1.94/README.md --- old/WWW-Mechanize-1.92/README.md 2019-08-24 03:00:40.000000000 +0200 +++ new/WWW-Mechanize-1.94/README.md 2019-10-10 15:12:38.000000000 +0200 @@ -4,7 +4,7 @@ # VERSION -version 1.92 +version 1.94 # SYNOPSIS @@ -210,7 +210,7 @@ Globally sets the HTML::Form strict flag which causes form submission to croak if any of the passed fields don't exist in the form, and/or a value doesn't exist in a select element. This can still be disabled in individual - calls to [`submit_form()|"$mech->submit_form( ... )"`](https://metacpan.org/pod/submit_form\(\)|"$mech->submit_form\( ... \)"). + calls to `[submit_form()](#mech-submit_form)`. Default is off. @@ -1064,7 +1064,7 @@ - `form_id => ID` Selects the form with ID _ID_ (calls - `[form_id()](#mech-form_id-name)`)>>) + `[form_id()](#mech-form_id-name)`) - `button => button` @@ -1210,6 +1210,9 @@ If _$absolute_ is true, links displayed are absolute, not relative. +The output will include empty lines for images that have no `src` attribute +and therefore no `<-`url>>. + ## $mech->dump\_forms( \[$fh\] ) Prints a dump of the forms on the current page to _$fh_. If _$fh_ @@ -1291,7 +1294,7 @@ If you do this, then the mech will use the tidied-up HTML instead of the original both when parsing for its own needs, and for returning to -you through ["content"](#content). +you through `[content()](#mech-content)`. Overloading this method is also the recommended way of implementing extra validation steps (e.g. link checkers) for every HTML page diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WWW-Mechanize-1.92/bin/mech-dump new/WWW-Mechanize-1.94/bin/mech-dump --- old/WWW-Mechanize-1.92/bin/mech-dump 2019-08-24 03:00:40.000000000 +0200 +++ new/WWW-Mechanize-1.94/bin/mech-dump 1970-01-01 01:00:00.000000000 +0100 @@ -1,189 +0,0 @@ -#!/usr/bin/perl - -# PODNAME: mech-dump -# ABSTRACT: Dumps information about a web page - -use warnings; -use strict; -use WWW::Mechanize (); -use Getopt::Long; -use Pod::Usage; - -use HTTP::Cookies; -my @actions; -my $absolute; -my $all; - -my $user; -my $pass; -my $agent; -my $agent_alias; -my $cookie_filename; - -GetOptions( - 'user=s' => \$user, - 'password=s' => \$pass, - headers => sub { push( @actions, \&dump_headers ) }, - forms => sub { push( @actions, \&dump_forms ) }, - links => sub { push( @actions, \&dump_links ) }, - images => sub { push( @actions, \&dump_images ) }, - all => sub { $all++; push( @actions, \&dump_headers, \&dump_forms, \&dump_links, \&dump_images ) }, - text => sub { push( @actions, \&dump_text ) }, - absolute => \$absolute, - 'agent=s' => \$agent, - 'agent-alias=s' => \$agent_alias, - 'cookie-file=s' => \$cookie_filename, - help => sub { pod2usage(1); }, - version => sub { print STDERR $WWW::Mechanize::VERSION, "\n"; exit 0; }, -) or pod2usage(2); - - -my @uris = @ARGV or die "Must specify a URL or file to check. See --help for details.\n"; - -@actions = (\&dump_forms) unless @actions; - -binmode(STDOUT, ':utf8'); - -my $mech = WWW::Mechanize->new(); -if ( defined $agent ) { - $mech->agent( $agent ); -} -elsif ( defined $agent_alias ) { - $mech->agent_alias( $agent_alias ); -} -if ( defined $cookie_filename ) { - my $cookies = HTTP::Cookies->new( file => $cookie_filename, autosave => 1, ignore_discard => 1 ); - $cookies->load() ; - $mech->cookie_jar($cookies); -} -else { - $mech->cookie_jar(undef) ; -} - -$mech->env_proxy(); -foreach my $uri (@uris) { - if ( -e $uri ) { - require URI::file; - $uri = URI::file->new_abs( $uri )->as_string; - } - - my $response = $mech->get( $uri ); - if (!$response->is_success and defined ($response->www_authenticate)) { - if (!defined $user or !defined $pass) { - die("Page requires username and password, but none specified.\n"); - } - $mech->credentials($user,$pass); - $response = $mech->get( $uri ); - $response->is_success or die "Can't fetch $uri with username and password\n", $response->status_line, "\n"; - } - $mech->is_html or die qq{$uri returns type "}, $mech->ct, qq{", not "text/html"\n}; - - foreach my $action (@actions ) { - $action->( $mech ); - print "\n" if @actions; - } -} - - -sub dump_headers { - my $mech = shift; - print "--> Headers:\n" if $all; - $mech->dump_headers( undef ); - return; -} - -sub dump_forms { - my $mech = shift; - print "--> Forms:\n" if $all; - $mech->dump_forms( undef, $absolute ); - return; -} - -sub dump_links { - my $mech = shift; - print "--> Links:\n" if $all; - $mech->dump_links( undef, $absolute ); - return; -} - -sub dump_images { - my $mech = shift; - print "--> Images:\n" if $all; - $mech->dump_images( undef, $absolute ); - return; -} - -sub dump_text { - my $mech = shift; - $mech->dump_text(); - return; -} - -__END__ - -=pod - -=encoding UTF-8 - -=head1 NAME - -mech-dump - Dumps information about a web page - -=head1 VERSION - -version 1.92 - -=head1 SYNOPSIS - -mech-dump [options] [file|url] - -Options: - - --headers Dump HTTP response headers - --forms Dump table of forms (default action) - --links Dump table of links - --images Dump table of images - --all Dump all four of the above, in that order - - --text Dumps the textual part of the web page - - --user=user Set the username - --password=pass Set the password - --cookie-file=filename Set the filename to use for persistent cookies - - --agent=agent Specify the UserAgent to pass - --agent-alias=alias - Specify the alias for the UserAgent to pass. - Pick one of: - * Windows IE 6 - * Windows Mozilla - * Mac Safari - * Mac Mozilla - * Linux Mozilla - * Linux Konqueror - - --absolute Show URLs as absolute, even if relative in the page - --help Show this message - -The order of the options specified is relevant. Repeated options -get repeated dumps. - -Proxy settings are specified through the environment (e.g. C<http_proxy=http://proxy.my.place/>). -See LWP::UserAgent for details. - -=head1 SEE ALSO - -L<WWW::Mechanize> - -=head1 AUTHOR - -Andy Lester <andy at petdance.com> - -=head1 COPYRIGHT AND LICENSE - -This software is copyright (c) 2004-2016 by Andy Lester. - -This is free software; you can redistribute it and/or modify it under -the same terms as the Perl 5 programming language system itself. - -=cut diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WWW-Mechanize-1.92/dist.ini new/WWW-Mechanize-1.94/dist.ini --- old/WWW-Mechanize-1.92/dist.ini 2019-08-24 03:00:40.000000000 +0200 +++ new/WWW-Mechanize-1.94/dist.ini 2019-10-10 15:12:38.000000000 +0200 @@ -13,9 +13,11 @@ -remove = Test::PodSpelling -remove = Test::Synopsis -remove = ExtraTests +StaticInstall.mode = on +StaticInstall.dry_run = 0 [ExecDir] -dir = bin +dir = script [RunExtraTests] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WWW-Mechanize-1.92/lib/WWW/Mechanize/Cookbook.pod new/WWW-Mechanize-1.94/lib/WWW/Mechanize/Cookbook.pod --- old/WWW-Mechanize-1.92/lib/WWW/Mechanize/Cookbook.pod 2019-08-24 03:00:40.000000000 +0200 +++ new/WWW-Mechanize-1.94/lib/WWW/Mechanize/Cookbook.pod 2019-10-10 15:12:38.000000000 +0200 @@ -13,7 +13,7 @@ =head1 VERSION -version 1.92 +version 1.94 =head1 INTRODUCTION diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WWW-Mechanize-1.92/lib/WWW/Mechanize/Examples.pod new/WWW-Mechanize-1.94/lib/WWW/Mechanize/Examples.pod --- old/WWW-Mechanize-1.92/lib/WWW/Mechanize/Examples.pod 2019-08-24 03:00:40.000000000 +0200 +++ new/WWW-Mechanize-1.94/lib/WWW/Mechanize/Examples.pod 2019-10-10 15:12:38.000000000 +0200 @@ -13,7 +13,7 @@ =head1 VERSION -version 1.92 +version 1.94 =head1 SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WWW-Mechanize-1.92/lib/WWW/Mechanize/FAQ.pod new/WWW-Mechanize-1.94/lib/WWW/Mechanize/FAQ.pod --- old/WWW-Mechanize-1.92/lib/WWW/Mechanize/FAQ.pod 2019-08-24 03:00:40.000000000 +0200 +++ new/WWW-Mechanize-1.94/lib/WWW/Mechanize/FAQ.pod 2019-10-10 15:12:38.000000000 +0200 @@ -13,7 +13,7 @@ =head1 VERSION -version 1.92 +version 1.94 =head1 How to get help with WWW::Mechanize diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WWW-Mechanize-1.92/lib/WWW/Mechanize/Image.pm new/WWW-Mechanize-1.94/lib/WWW/Mechanize/Image.pm --- old/WWW-Mechanize-1.92/lib/WWW/Mechanize/Image.pm 2019-08-24 03:00:40.000000000 +0200 +++ new/WWW-Mechanize-1.94/lib/WWW/Mechanize/Image.pm 2019-10-10 15:12:38.000000000 +0200 @@ -3,7 +3,7 @@ use strict; use warnings; -our $VERSION = '1.92'; +our $VERSION = '1.94'; #ABSTRACT: Image object for WWW::Mechanize @@ -69,7 +69,7 @@ =head1 VERSION -version 1.92 +version 1.94 =head1 SYNOPSIS @@ -94,43 +94,45 @@ =head1 Accessors -=head2 $link->url() +=head2 $image->url() -URL from the link +Image URL from the C<src> attribute of the source tag. -=head2 $link->base() +May be C<undef> if source tag has no C<src> attribute. + +=head2 $image->base() Base URL to which the links are relative. -=head2 $link->name() +=head2 $image->name() Name for the field from the NAME attribute, if any. -=head2 $link->tag() +=head2 $image->tag() Tag name (either "image" or "input") -=head2 $link->height() +=head2 $image->height() Image height -=head2 $link->width() +=head2 $image->width() Image width -=head2 $link->alt() +=head2 $image->alt() ALT attribute from the source tag, if any. -=head2 $link->attrs() +=head2 $image->attrs() Hash ref of all the attributes and attribute values in the tag. -=head2 $link->URI() +=head2 $image->URI() Returns the URL as a L<URI::URL> object. -=head2 $link->url_abs() +=head2 $image->url_abs() Returns the URL as an absolute URL string. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WWW-Mechanize-1.92/lib/WWW/Mechanize/Link.pm new/WWW-Mechanize-1.94/lib/WWW/Mechanize/Link.pm --- old/WWW-Mechanize-1.92/lib/WWW/Mechanize/Link.pm 2019-08-24 03:00:40.000000000 +0200 +++ new/WWW-Mechanize-1.94/lib/WWW/Mechanize/Link.pm 2019-10-10 15:12:38.000000000 +0200 @@ -3,7 +3,7 @@ use strict; use warnings; -our $VERSION = '1.92'; +our $VERSION = '1.94'; #ABSTRACT: Link object for WWW::Mechanize @@ -65,7 +65,7 @@ =head1 VERSION -version 1.92 +version 1.94 =head1 SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WWW-Mechanize-1.92/lib/WWW/Mechanize.pm new/WWW-Mechanize-1.94/lib/WWW/Mechanize.pm --- old/WWW-Mechanize-1.92/lib/WWW/Mechanize.pm 2019-08-24 03:00:40.000000000 +0200 +++ new/WWW-Mechanize-1.94/lib/WWW/Mechanize.pm 2019-10-10 15:12:38.000000000 +0200 @@ -6,7 +6,7 @@ use strict; use warnings; -our $VERSION = '1.92'; +our $VERSION = '1.94'; use Tie::RefHash; use HTTP::Request 1.30; @@ -581,10 +581,10 @@ # No conditions, anything matches return 1 unless keys %$p; - return if defined $p->{url} && !($image->url eq $p->{url} ); - return if defined $p->{url_regex} && !($image->url =~ $p->{url_regex} ); - return if defined $p->{url_abs} && !($image->url_abs eq $p->{url_abs} ); - return if defined $p->{url_abs_regex} && !($image->url_abs =~ $p->{url_abs_regex} ); + return if defined $p->{url} && !(defined($image->url) && $image->url eq $p->{url} ); + return if defined $p->{url_regex} && !(defined($image->url) && $image->url =~ $p->{url_regex} ); + return if defined $p->{url_abs} && !(defined($image->url_abs) && $image->url_abs eq $p->{url_abs} ); + return if defined $p->{url_abs_regex} && !(defined($image->url_abs) && $image->url_abs =~ $p->{url_abs_regex} ); return if defined $p->{alt} && !(defined($image->alt) && $image->alt eq $p->{alt} ); return if defined $p->{alt_regex} && !(defined($image->alt) && $image->alt =~ $p->{alt_regex} ); return if defined $p->{tag} && !($image->tag && $image->tag eq $p->{tag} ); @@ -1687,7 +1687,7 @@ =head1 VERSION -version 1.92 +version 1.94 =head1 SYNOPSIS @@ -1914,7 +1914,7 @@ Globally sets the HTML::Form strict flag which causes form submission to croak if any of the passed fields don't exist in the form, and/or a value doesn't exist in a select element. This can still be disabled in individual -calls to L<C<< submit_form()|"$mech->submit_form( ... )" >>>. +calls to C<L<< submit_form()|"$mech->submit_form( ... )" >>>. Default is off. @@ -2820,7 +2820,7 @@ =item * C<< form_id => ID >> Selects the form with ID I<ID> (calls -C<L<< form_id()|"$mech->form_id( $name )" >>>)>>) +C<L<< form_id()|"$mech->form_id( $name )" >>>) =item * C<< button => button >> @@ -2972,6 +2972,9 @@ If I<$absolute> is true, links displayed are absolute, not relative. +The output will include empty lines for images that have no C<src> attribute +and therefore no C<<->url>>. + =head2 $mech->dump_forms( [$fh] ) Prints a dump of the forms on the current page to I<$fh>. If I<$fh> @@ -3053,7 +3056,7 @@ If you do this, then the mech will use the tidied-up HTML instead of the original both when parsing for its own needs, and for returning to -you through L</content>. +you through C<L<< content()|"$mech->content(...)" >>>. Overloading this method is also the recommended way of implementing extra validation steps (e.g. link checkers) for every HTML page diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WWW-Mechanize-1.92/script/mech-dump new/WWW-Mechanize-1.94/script/mech-dump --- old/WWW-Mechanize-1.92/script/mech-dump 1970-01-01 01:00:00.000000000 +0100 +++ new/WWW-Mechanize-1.94/script/mech-dump 2019-10-10 15:12:38.000000000 +0200 @@ -0,0 +1,189 @@ +#!/usr/bin/perl + +# PODNAME: mech-dump +# ABSTRACT: Dumps information about a web page + +use warnings; +use strict; +use WWW::Mechanize (); +use Getopt::Long; +use Pod::Usage; + +use HTTP::Cookies; +my @actions; +my $absolute; +my $all; + +my $user; +my $pass; +my $agent; +my $agent_alias; +my $cookie_filename; + +GetOptions( + 'user=s' => \$user, + 'password=s' => \$pass, + headers => sub { push( @actions, \&dump_headers ) }, + forms => sub { push( @actions, \&dump_forms ) }, + links => sub { push( @actions, \&dump_links ) }, + images => sub { push( @actions, \&dump_images ) }, + all => sub { $all++; push( @actions, \&dump_headers, \&dump_forms, \&dump_links, \&dump_images ) }, + text => sub { push( @actions, \&dump_text ) }, + absolute => \$absolute, + 'agent=s' => \$agent, + 'agent-alias=s' => \$agent_alias, + 'cookie-file=s' => \$cookie_filename, + help => sub { pod2usage(1); }, + version => sub { print STDERR $WWW::Mechanize::VERSION, "\n"; exit 0; }, +) or pod2usage(2); + + +my @uris = @ARGV or die "Must specify a URL or file to check. See --help for details.\n"; + +@actions = (\&dump_forms) unless @actions; + +binmode(STDOUT, ':utf8'); + +my $mech = WWW::Mechanize->new( autocheck => 0 ); +if ( defined $agent ) { + $mech->agent( $agent ); +} +elsif ( defined $agent_alias ) { + $mech->agent_alias( $agent_alias ); +} +if ( defined $cookie_filename ) { + my $cookies = HTTP::Cookies->new( file => $cookie_filename, autosave => 1, ignore_discard => 1 ); + $cookies->load() ; + $mech->cookie_jar($cookies); +} +else { + $mech->cookie_jar(undef) ; +} + +$mech->env_proxy(); +foreach my $uri (@uris) { + if ( -e $uri ) { + require URI::file; + $uri = URI::file->new_abs( $uri )->as_string; + } + + my $response = $mech->get( $uri ); + if (!$response->is_success and defined ($response->www_authenticate)) { + if (!defined $user or !defined $pass) { + die("Page requires username and password, but none specified.\n"); + } + $mech->credentials($user,$pass); + $response = $mech->get( $uri ); + $response->is_success or die "Can't fetch $uri with username and password\n", $response->status_line, "\n"; + } + $mech->is_html or die qq{$uri returns type "}, $mech->ct, qq{", not "text/html"\n}; + + foreach my $action (@actions ) { + $action->( $mech ); + print "\n" if @actions; + } +} + + +sub dump_headers { + my $mech = shift; + print "--> Headers:\n" if $all; + $mech->dump_headers( undef ); + return; +} + +sub dump_forms { + my $mech = shift; + print "--> Forms:\n" if $all; + $mech->dump_forms( undef, $absolute ); + return; +} + +sub dump_links { + my $mech = shift; + print "--> Links:\n" if $all; + $mech->dump_links( undef, $absolute ); + return; +} + +sub dump_images { + my $mech = shift; + print "--> Images:\n" if $all; + $mech->dump_images( undef, $absolute ); + return; +} + +sub dump_text { + my $mech = shift; + $mech->dump_text(); + return; +} + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +mech-dump - Dumps information about a web page + +=head1 VERSION + +version 1.94 + +=head1 SYNOPSIS + +mech-dump [options] [file|url] + +Options: + + --headers Dump HTTP response headers + --forms Dump table of forms (default action) + --links Dump table of links + --images Dump table of images + --all Dump all four of the above, in that order + + --text Dumps the textual part of the web page + + --user=user Set the username + --password=pass Set the password + --cookie-file=filename Set the filename to use for persistent cookies + + --agent=agent Specify the UserAgent to pass + --agent-alias=alias + Specify the alias for the UserAgent to pass. + Pick one of: + * Windows IE 6 + * Windows Mozilla + * Mac Safari + * Mac Mozilla + * Linux Mozilla + * Linux Konqueror + + --absolute Show URLs as absolute, even if relative in the page + --help Show this message + +The order of the options specified is relevant. Repeated options +get repeated dumps. + +Proxy settings are specified through the environment (e.g. C<http_proxy=http://proxy.my.place/>). +See LWP::UserAgent for details. + +=head1 SEE ALSO + +L<WWW::Mechanize> + +=head1 AUTHOR + +Andy Lester <andy at petdance.com> + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2004-2016 by Andy Lester. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WWW-Mechanize-1.92/t/dump.t new/WWW-Mechanize-1.94/t/dump.t --- old/WWW-Mechanize-1.92/t/dump.t 2019-08-24 03:00:40.000000000 +0200 +++ new/WWW-Mechanize-1.94/t/dump.t 2019-10-10 15:12:38.000000000 +0200 @@ -65,6 +65,7 @@ hacktober.jpg hacktober.jpg http://example.org/abs.tif + EXPECTED }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WWW-Mechanize-1.92/t/find_image.t new/WWW-Mechanize-1.94/t/find_image.t --- old/WWW-Mechanize-1.92/t/find_image.t 2019-08-24 03:00:40.000000000 +0200 +++ new/WWW-Mechanize-1.94/t/find_image.t 2019-10-10 15:12:38.000000000 +0200 @@ -42,7 +42,7 @@ hacktober.jpg hacktober.jpg http://example.org/abs.tif - ) ], + ), undef ], '... and all seven are in the right order' ); @@ -109,6 +109,7 @@ my $image5 = [ url => 'hacktober.jpg', attrs => superhashof( { class => re('my-class-2') } ) ]; my $image6 = [ url => 'hacktober.jpg', attrs => superhashof( { class => re('my-class-3') } ) ]; my $image7 = [ url => 'http://example.org/abs.tif', attrs => superhashof( { id => 'absolute' } ) ]; +my $image8 = [ url => undef, tag => 'img', attrs => superhashof( { 'data-image' => "hacktober.jpg", id => "no-src-regression-269" } ) ]; my $tests = [ { @@ -188,6 +189,7 @@ $image5, $image6, $image7, + $image8, ], }, { @@ -214,6 +216,7 @@ $image5, $image6, $image7, + $image8, ], }, { @@ -234,6 +237,7 @@ expected_single => $image4, expected_all => [ $image4, + $image8, ], }, { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WWW-Mechanize-1.92/t/image-new.t new/WWW-Mechanize-1.94/t/image-new.t --- old/WWW-Mechanize-1.92/t/image-new.t 2019-08-24 03:00:40.000000000 +0200 +++ new/WWW-Mechanize-1.94/t/image-new.t 2019-10-10 15:12:38.000000000 +0200 @@ -3,14 +3,14 @@ use warnings; use strict; -use Test::More tests => 12; +use Test::More tests => 15; BEGIN { use_ok( 'WWW::Mechanize::Image' ); } # test new style API -my $link = WWW::Mechanize::Image->new( { +my $img = WWW::Mechanize::Image->new( { url => 'url.html', base => 'http://base.example.com/', name => 'name', @@ -21,14 +21,26 @@ attrs => { id => 'id', class => 'foo bar' }, } ); -is( $link->url, 'url.html', 'url() works' ); -is( $link->base, 'http://base.example.com/', 'base() works' ); -is( $link->name, 'name', 'name() works' ); -is( $link->alt, 'alt', 'alt() works' ); -is( $link->tag, 'a', 'tag() works' ); -is( $link->height, 2112, 'height works' ); -is( $link->width, 5150, 'width works' ); -is( $link->attrs->{id}, 'id', 'attrs/id works' ); -is( $link->attrs->{class}, 'foo bar', 'attrs/class works' ); -is( $link->url_abs, 'http://base.example.com/url.html', 'url_abs works' ); -isa_ok( $link->URI, 'URI::URL', 'Returns an object' ); +is( $img->url, 'url.html', 'url() works' ); +is( $img->base, 'http://base.example.com/', 'base() works' ); +is( $img->name, 'name', 'name() works' ); +is( $img->alt, 'alt', 'alt() works' ); +is( $img->tag, 'a', 'tag() works' ); +is( $img->height, 2112, 'height works' ); +is( $img->width, 5150, 'width works' ); +is( $img->attrs->{id}, 'id', 'attrs/id works' ); +is( $img->attrs->{class}, 'foo bar', 'attrs/class works' ); +is( $img->url_abs, 'http://base.example.com/url.html', 'url_abs works' ); +isa_ok( $img->URI, 'URI::URL', 'Returns an object' ); + +my $img_no_src = WWW::Mechanize::Image->new( { + url => undef, + base => 'http://base.example.com/', + tag => 'img', + height => 123, + width => 321, +} ); + +isa_ok($img_no_src, 'WWW::Mechanize::Image'); +is( $img_no_src->url, undef, 'url() without url is undef'); +isa_ok( $img_no_src->URI, 'URI::URL', 'Returns an object' ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WWW-Mechanize-1.92/t/image-parse.html new/WWW-Mechanize-1.94/t/image-parse.html --- old/WWW-Mechanize-1.92/t/image-parse.html 2019-08-24 03:00:40.000000000 +0200 +++ new/WWW-Mechanize-1.94/t/image-parse.html 2019-10-10 15:12:38.000000000 +0200 @@ -13,7 +13,7 @@ <a href="link.htm"><img src="linked.gif"></a> </FORM> <A HREF="http://www.bbc.co.uk/" NAME="Wilma">BBC</A> - <A HREF="blongo.html">Blongo!</A><img src="hacktober.jpg" id="first-hacktober-image" class="my-class-1"><img src="hacktober.jpg" class="my-class-2 foo"><img src="hacktober.jpg" class="my-class-3 foo bar"><img src="http://example.org/abs.tif" id="absolute"> + <A HREF="blongo.html">Blongo!</A><img src="hacktober.jpg" id="first-hacktober-image" class="my-class-1"><img src="hacktober.jpg" class="my-class-2 foo"><img src="hacktober.jpg" class="my-class-3 foo bar"><img src="http://example.org/abs.tif" id="absolute"><img data-image="hacktober.jpg" id="no-src-regression-269"> </body> </html> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/WWW-Mechanize-1.92/t/image-parse.t new/WWW-Mechanize-1.94/t/image-parse.t --- old/WWW-Mechanize-1.92/t/image-parse.t 2019-08-24 03:00:40.000000000 +0200 +++ new/WWW-Mechanize-1.94/t/image-parse.t 2019-10-10 15:12:38.000000000 +0200 @@ -3,7 +3,7 @@ use warnings; use strict; -use Test::More tests => 30; +use Test::More tests => 33; use URI::file; BEGIN { @@ -20,7 +20,7 @@ ok( $mech->success, "Fetched $uri" ) or die 'Can\'t get test page'; my @images = $mech->images; -is( scalar @images, 7, 'Only seven images' ); +is( scalar @images, 8, 'Only eight images' ); my $first = $images[0]; is( $first->tag, 'img', 'img tag' ); @@ -58,4 +58,10 @@ is( $sixth->tag, 'img', 'input tag' ); is( $sixth->alt, undef, 'alt' ); is( $sixth->attrs->{id}, undef, 'id' ); -is( $sixth->attrs->{class}, 'my-class-3 foo bar', 'class' ); \ No newline at end of file +is( $sixth->attrs->{class}, 'my-class-3 foo bar', 'class' ); + +# regression github #269 +my $seventh = $images[7]; +is( $seventh->attrs->{id}, 'no-src-regression-269', 'Got the sevenths image'); +is( $seventh->url, undef, 'it has no URL'); +is( $seventh->attrs->{'data-image'}, 'hacktober.jpg', 'it has an extra attribute'); \ No newline at end of file
