Archive-RPM

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

Revision history for Archive-RPM

0.07 Sat Jun 19 2010
- make MooseX::Types::DateTimeX as an explicit dependency

0.06 Thu May 13 2010
- with MooseX::Traits now, the better to be TraitFor'ed with
- minor doc and code updates
- switch to MooseX::MarkAsMethods, to clean our namespaces while retaining our
  overloads

0.05 Sat Feb 13 21:05:55 PST 2010
- explicitly exclude 'nvr' from being handled by _handle; this was breaking
  with RPM 4.8.x

MANIFEST  view on Meta::CPAN

lib/Archive/RPM/ChangeLogEntry.pm
Makefile.PL
MANIFEST
META.yml
README
README.mkdn
t/00-load.t
t/100-archive-rpm.t
t/101-archive-srpm.t
t/102-changelog.t
t/perl-DateTime-Format-ISO8601-0.06-1.fc10.noarch.rpm
t/perl-DateTime-Format-ISO8601-0.06-1.fc10.src.rpm
TODO
xt/author/boilerplate.t
xt/author/no_smart_comments.t
xt/author/pod-coverage.t
xt/author/pod.t

META.yml  view on Meta::CPAN

    - t
    - xt
provides:
  Archive::RPM:
    file: lib/Archive/RPM.pm
    version: 0.07
  Archive::RPM::ChangeLogEntry:
    file: lib/Archive/RPM/ChangeLogEntry.pm
    version: 0.07
requires:
  DateTime: 0
  English: 0
  Moose: 0
  MooseX::AttributeHelpers: 0
  MooseX::MarkAsMethods: 0
  MooseX::Traits: 0
  MooseX::Types::DateTime: 0
  MooseX::Types::DateTimeX: 0
  MooseX::Types::Path::Class: 0
  Path::Class: 0
  RPM2: 0.68
resources:
  homepage: http://github.com/RsrchBoy/archive-rpm/tree
  license: http://opensource.org/licenses/lgpl-license.php
  repository: git://github.com/RsrchBoy/archive-rpm.git
version: 0.07

Makefile.PL  view on Meta::CPAN

all_from 'lib/Archive/RPM.pm';
author   'Chris Weyl <cweyl@alumni.drew.edu>';
license  'lgpl';

readme_from 'lib/Archive/RPM.pm';
readme_markdown_from 'lib/Archive/RPM.pm';

requires 'Moose';
requires 'MooseX::AttributeHelpers';
requires 'MooseX::MarkAsMethods';
requires 'MooseX::Types::DateTime';
requires 'MooseX::Types::DateTimeX';
requires 'MooseX::Types::Path::Class';
requires 'MooseX::Traits';

requires 'DateTime';
requires 'English';
requires 'Path::Class';
requires 'RPM2' => '0.68';

requires_external_bin 'rpm2cpio';
requires_external_bin 'cpio';

test_requires 'Test::More';

extra_tests;

lib/Archive/RPM/ChangeLogEntry.pm  view on Meta::CPAN

# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
#############################################################################

package Archive::RPM::ChangeLogEntry;

use Moose;
use MooseX::MarkAsMethods autoclean => 1;
use MooseX::Types::DateTimeX ':all';

use overload '""' => sub { shift->as_string };

use DateTime;

our $VERSION = '0.07';

has text => (is => 'ro', isa => 'Str', required => 1);
has time => (is => 'ro', isa => DateTime, coerce => 1, required => 1);
has name => (is => 'ro', isa => 'Str', required => 1);

sub as_string {
    my $self = shift @_;

    my ($name, $time) = ($self->name, $self->time);

    return "* $time $name\n" . $self->text;
}

t/100-archive-rpm.t  view on Meta::CPAN

use strict;
use warnings;

use English qw{ -no_match_vars };  # Avoids regex performance penalty

use Test::More tests => 12;

use Archive::RPM;
use FindBin;

my $test_rpm = 'perl-DateTime-Format-ISO8601-0.06-1.fc10.noarch.rpm';

=head2 Basic checks

Make sure we can open a rpm, create an object instance, methods, etc...

=cut

my $rpm = Archive::RPM->new("$FindBin::Bin/$test_rpm");

isa_ok($rpm => 'Archive::RPM');

t/100-archive-rpm.t  view on Meta::CPAN

ok  $rpm->can('tag') => 'method tag() OK';
#ok !$rpm->can('files') => 'no changelog()

=head2 Header checks

Poke at some of the RPM2-provided functionality.

=cut

# RPM2 header bits
is $rpm->name => 'perl-DateTime-Format-ISO8601',             'name OK';
is $rpm->nvre => 'perl-DateTime-Format-ISO8601-0.06-1.fc10', 'nvre OK';
is $rpm->nvr  => 'perl-DateTime-Format-ISO8601-0.06-1.fc10', 'nvr OK';
is $rpm->arch => 'noarch',                                   'noarch OK';

ok !$rpm->is_srpm, 'is rpm OK';

# our files bits
ok $rpm->has_files,       'we have files';
is $rpm->num_files => 19, 'file count OK';

my @files = $rpm->grep_files(sub { /LICENSE$/ });

t/101-archive-srpm.t  view on Meta::CPAN

use strict;
use warnings;

use English qw{ -no_match_vars };  # Avoids regex performance penalty

use Test::More tests => 11;

use Archive::RPM;
use FindBin;

my $test_srpm = 'perl-DateTime-Format-ISO8601-0.06-1.fc10.src.rpm';

=head2 Basic checks

Make sure we can open a rpm, create an object instance, methods, etc...

=cut

my $srpm = Archive::RPM->new("$FindBin::Bin/$test_srpm");

isa_ok($srpm => 'Archive::RPM');

t/101-archive-srpm.t  view on Meta::CPAN

ok  $srpm->can('tag') => 'method tag() OK';
#ok !$srpm->can('files') => 'no changelog()

=head2 Header checks

Poke at some of the RPM2-provided functionality.

=cut

# RPM2 header bits
is $srpm->name => 'perl-DateTime-Format-ISO8601',             'name OK';
is $srpm->nvre => 'perl-DateTime-Format-ISO8601-0.06-1.fc10', 'nvre OK';
is $srpm->nvr  => 'perl-DateTime-Format-ISO8601-0.06-1.fc10', 'nvr OK';

ok $srpm->is_srpm, 'is srpm OK';

# our files bits
ok $srpm->has_files,      'we have files';
is $srpm->num_files => 2, 'file count OK';

my @files = $srpm->grep_files(sub { /\.spec$/ });

is scalar @files => 1, 'found one spec';
is $files[0]->basename => 'perl-DateTime-Format-ISO8601.spec', 'spec found!';

=head2 changelog functionality

These tests exercise the changelog functionality.

=cut


my @cl = $srpm->changelog;
#use Smart::Comments '###', '####';

t/102-changelog.t  view on Meta::CPAN

* Thu Feb 05 2009 Chris Weyl <cweyl@alumni.drew.edu> 0.06-1
- update for submission
.
* Thu Feb 05 2009 Chris Weyl <cweyl@alumni.drew.edu> 0.06-0
- initial RPM packaging
- generated with cpan2dist (CPANPLUS::Dist::RPM version 0.0.8)

=cut


my $test_rpm = 'perl-DateTime-Format-ISO8601-0.06-1.fc10.noarch.rpm';

my $rpm = Archive::RPM->new("$FindBin::Bin/$test_rpm");

isa_ok($rpm => 'Archive::RPM');

is $rpm->num_changelog_entries => 2, 'count OK';

my $entry = $rpm->first_changelog_entry;
isa_ok $entry => 'Archive::RPM::ChangeLogEntry', 'isa A::RPM::CLE ok';



( run in 0.397 second using v1.01-cache-2.11-cpan-05444aca049 )