The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Data::Password::zxcvbn::AuthorTools::BuildAdjacencyGraphs - class to generate Data::Password::zxcvbn::*::AdjacencyGraph

VERSION

version 1.0.2

SYNOPSIS

In your distribution's maint/build-keyboard-adjacency-graphs:

    #!/usr/bin/env perl
    use strict;
    use warnings;
    use Data::Password::zxcvbn::AuthorTools::BuildAdjacencyGraphs;

    Data::Password::zxcvbn::AuthorTools::BuildAdjacencyGraphs->new({
        layouts => [
            { name => 'keypad', layout => <<'EOK', slanted => 0 },
      / * -
    7 8 9 +
    4 5 6
    1 2 3
      0 .
    EOK
            { name => 'qwerty', layout => <<'EOK', slanted => 1 },
    `~ 1! 2@ 3# 4$ 5% 6^ 7& 8* 9( 0) -_ =+
        qQ wW eE rR tT yY uU iI oO pP [{ ]} \|
         aA sS dD fF gG hH jJ kK lL ;: '"
          zZ xX cC vV bB nN mM ,< .> /?
    EOK
        ],
        package_name => 'Data::Password::zxcvbn::AdjacencyGraph::MyThing',
        package_abstract => 'adjacency graphs for my keyboards',
        package_description => <<'EOF',
    This is a data file used by L<<
    C<Data::Password::zxcvbn::Match::Spatial> >>, and is generated by
    the L<< C<build-keyboard-adjacency-graphs>|...>> program when
    building the distribution.
    EOF
    })->generate;

(a skeleton of such a file is generated when running dzil new -P zxcvbn Data::Password::zxcvbn::MyThing)

ATTRIBUTES

layouts

Arrayref of dictionaries (name, layout, slanted) defining the keyboards to analyse.

output_dir

Where to write the generated package. Defaults to $ARGV[1] or lib/; this supports running the main/build-keyboard-adjacency-graphs script manually and via the dist.ini file.

package_name

Name of the package to generate, required. Should start with Data::Password::zxcvbn::AdjacencyGraph::

package_version

Version of the package. Defaults to $ARGV[0] or undef; this supports running the main/build-keyboard-adjacency-graphs script manually and via the dist.ini file.

package_abstract

Abstract of the package, defaults to "adjacency graphs for common keyboards".

package_description

Description of the package, required.

METHODS

generate

Writes out the package.

AUTHOR

Gianni Ceccarelli <gianni.ceccarelli@broadbean.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2023 by BroadBean UK, a CareerBuilder Company.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.