App-DocKnot

 view release on metacpan or  search on metacpan

bin/docknot  view on Meta::CPAN


=item B<-m> I<metadata>, B<--metdata>=I<metadata>

The path to the JSON metadata files for the package that should be converted
to the new YAML format.  This should be a directory containing all the package
metadata files required by App::DocKnot.  Default: F<docs/metadata> relative
to the current directory.

=item B<-o> I<output>, B<--output>=I<output>

The output file for the updated package configuration.  Default:
F<docs/docknot.yaml> relative to the current directory (which is the
recommended metadata path for a project).

=back

=head2 update-spin

=over 4

=item I<path>

lib/App/DocKnot/Config.pm  view on Meta::CPAN

If this is not specified, the B<-d> options to C<docknot dist> and C<docknot
release> is mandatory.

=item pgp_key

Sign distribution tarballs generated via C<docknot dist> with this PGP key.
Equivalent to the B<-p> option to C<docknot dist>.

=item versions

Path to the F<.versions> file that should be updated by C<docknot release>.  A
F<.versions> file records the versions and release dates of software packages.
See L<App::Docknot::Spin::Versions> for more information.

=back

=head1 CLASS METHODS

=over 4

=item new(ARGS)

t/data/perlcriticrc  view on Meta::CPAN

# -*- conf -*-
#
# Default configuration for perlcritic.  Be sure to copy this into the source
# for packages that run perlcritic tests automatically during the build for
# reproducible test results.
#
# This file has been updated to match perlcritic 1.134.
#
# The canonical version of this file is maintained in the rra-c-util package,
# which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
#
# Written by Russ Allbery <eagle@eyrie.org>
# Copyright 2018-2022 Russ Allbery <eagle@eyrie.org>
# Copyright 2011-2013
#     The Board of Trustees of the Leland Stanford Junior University
#
# Permission is hereby granted, free of charge, to any person obtaining a

t/data/spin/input/software/index.th  view on Meta::CPAN

    use.  Barring exceptional circumstances, there will not be any further
    releases of these packages, but they are still available for
    historical reference and in case someone else wants to pick them up.
]

\desclink[patches/][Patches][
    Patches to some packages that I don't maintain which may be of
    interest to others.  Things will come and go from this page as the
    patches are incorporated into the upstream software.  Patches may also
    be obsolete, if upstream has changed without incorporating my changes.
    The files here aren't checked or updated very often and are provided
    just in case they're of interest; you will probably have to do some
    work to use them.
]

\signature

t/data/spin/output/software/index.html  view on Meta::CPAN

    releases of these packages, but they are still available for
    historical reference and in case someone else wants to pick them up.
</p></dd>

<dt><strong><a href="patches/">Patches</a></strong></dt>
<dd><p>
    Patches to some packages that I don't maintain which may be of
    interest to others.  Things will come and go from this page as the
    patches are incorporated into the upstream software.  Patches may also
    be obsolete, if upstream has changed without incorporating my changes.
    The files here aren't checked or updated very often and are provided
    just in case they're of interest; you will probably have to do some
    work to use them.
</p></dd>
</dl>

<table class="navbar"><tr>
  <td class="navleft"></td>
  <td>
    <a href="../">Russ Allbery</a>
  </td>

t/lib/Test/RRA/ModuleVersion.pm  view on Meta::CPAN

            return $version;
        }
    }
    close($data);
    die "$0: cannot find version number in $file\n";
}

# Given a module file and the new version for that module, update the version
# in that module to the new one.
#
# $file    - Perl module file whose version should be updated
# $version - The new version number
#
# Returns: undef
#  Throws: Text exception on I/O failure or inability to find version
sub _update_module_version {
    my ($file, $version) = @_;

    # Scan for the version and replace it.
    open(my $in, q{<}, $file);
    open(my $out, q{>}, "$file.new");

t/release/basic.t  view on Meta::CPAN

    my $old = 'Empty-1.9.' . $ext;
    ok(!$archive_path->child('devel', $old)->is_file(), "Removed $old");
    ok(
        $archive_path->child('ARCHIVE', 'Empty', $old)->is_file(),
        "Archived $old",
    );
    my $link = 'Empty.' . $ext;
    is(readlink($archive_path->child('devel', $link)), $file, "Updated $link");
}

# Check that the version file was updated.
my $versions_line;
(undef, $versions_line) = $versions_path->lines_utf8();
my @versions = split(q{ }, $versions_line);
is($versions[0], 'empty', '.versions line');
is($versions[1], '1.10', '...version updated');
isnt(join(q{ }, @versions[2, 3]), '2022-01-01 16:00:00', '...date updated');
is($versions[4], 'software/empty/index.th', '...dependency unchanged');

# Check that the change was staged.
my $status = $repo->run('status', '-s');
is($status, ' M .versions', '.versions change was staged');

# Make an additional release with a v-based version number.
for my $ext (@extensions) {
    $dist_path->child('Empty-v2.0.0.' . $ext)->touch();
}

t/release/basic.t  view on Meta::CPAN

    my $old = 'Empty-1.10.' . $ext;
    ok(!$archive_path->child('devel', $old)->is_file(), "Removed $old");
    ok(
        $archive_path->child('ARCHIVE', 'Empty', $old)->is_file(),
        "Archived $old",
    );
    my $link = 'Empty.' . $ext;
    is(readlink($archive_path->child('devel', $link)), $file, "Updated $link");
}

# Check that the version file was updated.
(undef, $versions_line) = $versions_path->lines_utf8();
@versions = split(q{ }, $versions_line);
is($versions[1], 'v2.0.0', '...version updated');

t/update/basic.t  view on Meta::CPAN

local $ENV{XDG_CONFIG_DIRS} = '/nonexistent';

# Load the module.
BEGIN { use_ok('App::DocKnot::Update') }

# We have a set of test cases in the data directory.  Each of them contains
# an old directory for the old files and a docknot.yaml file for the results.
my $dataroot = path('t', 'data', 'update');
my @tests = map { $_->basename() } $dataroot->children();

# For each of those cases, initialize an object, generate the updated
# configuration, and compare it with the test output file.
my $tempdir = Path::Tiny->tempdir();
for my $test (@tests) {
    my $metadata_path = $dataroot->child($test, 'old');
    my $expected_path = $dataroot->child($test, 'docknot.yaml');
    my $output_path = $tempdir->child("$test.yaml");
    my $docknot = App::DocKnot::Update->new(
        { metadata => $metadata_path, output => $output_path },
    );
    isa_ok($docknot, 'App::DocKnot::Update', "for $test");

t/update/spin.t  view on Meta::CPAN

$repo->run(config => '--add', 'user.email', 'test@example.com');
$repo->run(add    => '-A', q{.});
$repo->run(commit => '-q', '-m', 'Initial commit');

# Update the tree.
my $update = App::DocKnot::Update->new();
$update->update_spin($tempdir);

# Check the resulting output.
my $expected = path('t', 'data', 'spin', 'update', 'output');
my $count = is_spin_output_tree("$tempdir", "$expected", 'Tree updated');
my @status = sort $repo->run('status', '-s');
my @changes = (
    'A  changes.spin',
    'A  license.spin',
    'A  module.spin',
    'A  racc.spin',
    'A  readme.spin',
    'A  script.spin',
    'D  changes.faq',
    'D  license.faq',



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