2011-01-17 16:15:07 +00:00
|
|
|
#
|
2011-11-17 15:56:06 +00:00
|
|
|
# spec file for package perl-WWW-Mechanize-TreeBuilder
|
2011-01-17 16:15:07 +00:00
|
|
|
#
|
2024-08-25 19:23:45 +00:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2011-01-17 16:15:07 +00:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2024-08-25 19:23:45 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2011-01-17 16:15:07 +00:00
|
|
|
#
|
|
|
|
|
2014-08-22 12:48:35 +00:00
|
|
|
|
2024-08-25 19:23:45 +00:00
|
|
|
%define cpan_name WWW-Mechanize-TreeBuilder
|
2011-01-17 16:15:07 +00:00
|
|
|
Name: perl-WWW-Mechanize-TreeBuilder
|
2024-08-25 19:23:45 +00:00
|
|
|
Version: 1.200.0
|
2012-02-10 12:20:35 +00:00
|
|
|
Release: 0
|
2024-08-25 19:23:45 +00:00
|
|
|
# 1.20000 -> normalize -> 1.200.0
|
|
|
|
%define cpan_version 1.20000
|
|
|
|
License: Artistic-1.0 OR GPL-1.0-or-later
|
|
|
|
Summary: Combine WWW::Mechanize and HTML::TreeBuilder in nice ways
|
|
|
|
URL: https://metacpan.org/release/%{cpan_name}
|
|
|
|
Source0: https://cpan.metacpan.org/authors/id/A/AS/ASH/%{cpan_name}-%{cpan_version}.tar.gz
|
2025-08-12 18:18:30 +02:00
|
|
|
Source100: README.md
|
2015-04-15 04:19:11 +00:00
|
|
|
BuildArch: noarch
|
2012-02-10 12:20:35 +00:00
|
|
|
BuildRequires: perl
|
|
|
|
BuildRequires: perl-macros
|
2024-08-25 19:23:45 +00:00
|
|
|
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.59
|
2011-01-17 16:15:07 +00:00
|
|
|
BuildRequires: perl(HTML::TreeBuilder)
|
2015-04-15 04:19:11 +00:00
|
|
|
BuildRequires: perl(Moose) >= 2.1200
|
2011-01-17 16:15:07 +00:00
|
|
|
BuildRequires: perl(MooseX::Role::Parameterized)
|
|
|
|
BuildRequires: perl(Test::WWW::Mechanize)
|
|
|
|
Requires: perl(HTML::TreeBuilder)
|
2015-04-15 04:19:11 +00:00
|
|
|
Requires: perl(Moose) >= 2.1200
|
2011-01-17 16:15:07 +00:00
|
|
|
Requires: perl(MooseX::Role::Parameterized)
|
2024-08-25 19:23:45 +00:00
|
|
|
Provides: perl(WWW::Mechanize::TreeBuilder) = %{version}
|
|
|
|
%undefine __perllib_provides
|
2011-01-17 16:15:07 +00:00
|
|
|
%{perl_requires}
|
|
|
|
|
|
|
|
%description
|
2024-08-25 19:23:45 +00:00
|
|
|
This module combines WWW::Mechanize and HTML::TreeBuilder. Why? Because
|
|
|
|
I've seen too much code like the following:
|
2011-01-17 16:15:07 +00:00
|
|
|
|
|
|
|
like($mech->content, qr{<p>some text</p>}, "Found the right tag");
|
|
|
|
|
|
|
|
Which is just all flavours of wrong - its akin to processing XML with
|
|
|
|
regexps. Instead, do it like the following:
|
|
|
|
|
|
|
|
ok($mech->look_down(_tag => 'p', sub { $_[0]->as_trimmed_text eq 'some text' })
|
|
|
|
|
|
|
|
The anon-sub there is a bit icky, but this means that anyone should happen
|
|
|
|
to add attributes to the '<p>' tag (such as an id or a class) it will still
|
|
|
|
work and find the right tag.
|
|
|
|
|
2024-08-25 19:23:45 +00:00
|
|
|
All of the methods available on HTML::Element (that aren't 'private' - i.e.
|
|
|
|
that don't begin with an underscore) such as 'look_down' or 'find' are
|
|
|
|
automatically delegated to '$mech->tree' through the magic of Moose.
|
2011-01-17 16:15:07 +00:00
|
|
|
|
|
|
|
%prep
|
2024-08-25 19:23:45 +00:00
|
|
|
%autosetup -n %{cpan_name}-%{cpan_version}
|
2011-01-17 16:15:07 +00:00
|
|
|
|
|
|
|
%build
|
2024-08-25 19:23:45 +00:00
|
|
|
PERL_USE_UNSAFE_INC=1 perl Makefile.PL INSTALLDIRS=vendor
|
|
|
|
%make_build
|
2011-01-17 16:15:07 +00:00
|
|
|
|
|
|
|
%check
|
2024-08-25 19:23:45 +00:00
|
|
|
make test
|
2011-01-17 16:15:07 +00:00
|
|
|
|
|
|
|
%install
|
|
|
|
%perl_make_install
|
|
|
|
%perl_process_packlist
|
|
|
|
%perl_gen_filelist
|
|
|
|
|
|
|
|
%files -f %{name}.files
|
|
|
|
%doc Changes
|
|
|
|
|
|
|
|
%changelog
|