App-DocKnot

 view release on metacpan or  search on metacpan

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

# the output of an external converter.
sub _write_converter_output {
    my ($self, $page_ref, $output, $footer) = @_;
    my $page = $output->relative($self->{output});
    my $out_fh = $output->openw_utf8();

    # Grab the first few lines of input, looking for a blurb and Id string.
    # Give up if we encounter <body> first.  Also look for a </head> tag and
    # add the navigation link tags before it, if applicable.  Add the
    # navigation bar right at the beginning of the body.
    my ($blurb, $docid);
    while (defined(my $line = shift($page_ref->@*))) {
        if ($line =~ m{ <!-- \s* (\$Id.*?) \s* --> }xms) {
            $docid = $1;
        }
        if ($line =~ m{ <!-- \s* ( (?:Generated|Converted) .*? )\s* --> }xms) {
            $blurb = $1;

            # Only show the date of the output, not the time or time zone.
            $blurb =~ s{ [ ] \d\d:\d\d:\d\d [ ] -0000 }{}xms;

            # Strip the date from the converter version output.
            $blurb =~ s{ [ ] [(] \d{4}-\d\d-\d\d [)] }{}xms;
        }

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

    # Snarf input and write it to output until we see </body>, which is our
    # signal to start adding things.  We just got very confused if </body> was
    # on the same line as <body>, so don't do that.
    my $line;
    while (defined($line = shift($page_ref->@*))) {
        last if $line =~ m{ </body> }xmsi;
        print_fh($out_fh, $output, $line);
    }

    # Add the footer and finish with the output.
    print_fh($out_fh, $output, $footer->($blurb, $docid));
    if (defined($line)) {
        print_fh($out_fh, $output, $line, $page_ref->@*);
    }
    close($out_fh);
    return;
}

# These methods are all used, but are indirected through a table, so
# perlcritic gets confused.
#

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

#
# $action - String description of the action
# $output - Output file generated
sub _report_action {
    my ($self, $action, $output) = @_;
    my $shortout = $output->relative($self->{output});
    print_checked("$action .../$shortout\n");
    return;
}

# This routine is called for every file in the source tree.  It decides what
# to do with each file, whether spinning it or copying it.
#
# $input - Path::Tiny path to the input file
#
# Throws: Text exception on any processing error
#         autodie exception if files could not be accessed or written
sub _process_file {
    my ($self, $input) = @_;

    # Conversion rules for pointers.  The key is the extension, the first

lib/App/DocKnot/Spin/Text.pm  view on Meta::CPAN

#
# $paragraph - Paragraph to classify
#
# Returns: True if so, false otherwise
sub _is_bullet {
    my ($paragraph) = @_;
    return $paragraph =~ m{ \A \s* [-o*] \s }xms;
}

# Whether a line is centered (in 74 columns).  Also require at least 10 spaces
# of whitespace so that we don't catch accidentally centered paragraph lines
# by mistake.
#
# $line - Line to classify
#
# Returns: True if so, false otherwise
sub _is_centered {
    my ($line) = @_;
    return if $line !~ m{ \A (\s+) (.+) }xms;
    my ($space, $text) = ($1, $2);
    return if abs(74 - length($text) - length($space) * 2) >= 2;

lib/App/DocKnot/Spin/Text.pm  view on Meta::CPAN

# Whether a line is an RCS/CVS Id string that has been expanded.
#
# $line - Line to classify
#
# Returns: True if so, false otherise
sub _is_id {
    my ($line) = @_;
    return $line =~ m{ \A \s* [\$]Id: \N+ [\$] \s* \z }xms;
}

# Whether a paragraph should be a literal paragraph, decided based on whether
# it has internal whitespace.
#
# $paragraph - Paragraph to classify
#
# Returns: True if so, false otherwise
sub _is_literal {
    my ($paragraph) = @_;
    return $paragraph =~ m{
        \A [ \t]*
        \S \N*

t/data/generate/pam-krb5/docknot.yaml  view on Meta::CPAN

          account  required  pam_krb5.so minimum_uid=1000
          account  required  pam_unix.so
      ```

      in `/etc/pam.d/common-account`.  The `minimum_uid` setting tells the PAM
      module to pass on any users with a UID lower than 1000, thereby
      bypassing Kerberos authentication for the root account and any system
      accounts.  You normally want to do this since otherwise, if the network
      is down, the Kerberos authentication can time out and make it difficult
      to log in as root and fix matters.  This also avoids problems with
      Kerberos principals that happen to match system accounts accidentally
      getting access to those accounts.

      Be sure to include the module in the session group as well as the auth
      group.  Without the session entry, the user's ticket cache will not be
      created properly for ssh logins (among possibly others).

      If your users should normally all use Kerberos passwords exclusively,
      putting something like:

      ```

t/data/generate/pam-krb5/output/readme  view on Meta::CPAN


      account  required  pam_krb5.so minimum_uid=1000
      account  required  pam_unix.so

  in /etc/pam.d/common-account.  The minimum_uid setting tells the PAM
  module to pass on any users with a UID lower than 1000, thereby
  bypassing Kerberos authentication for the root account and any system
  accounts.  You normally want to do this since otherwise, if the network
  is down, the Kerberos authentication can time out and make it difficult
  to log in as root and fix matters.  This also avoids problems with
  Kerberos principals that happen to match system accounts accidentally
  getting access to those accounts.

  Be sure to include the module in the session group as well as the auth
  group.  Without the session entry, the user's ticket cache will not be
  created properly for ssh logins (among possibly others).

  If your users should normally all use Kerberos passwords exclusively,
  putting something like:

      password sufficient pam_krb5.so minimum_uid=1000

t/data/generate/pam-krb5/output/readme-md  view on Meta::CPAN

    account  required  pam_krb5.so minimum_uid=1000
    account  required  pam_unix.so
```

in `/etc/pam.d/common-account`.  The `minimum_uid` setting tells the PAM
module to pass on any users with a UID lower than 1000, thereby bypassing
Kerberos authentication for the root account and any system accounts.  You
normally want to do this since otherwise, if the network is down, the
Kerberos authentication can time out and make it difficult to log in as
root and fix matters.  This also avoids problems with Kerberos principals
that happen to match system accounts accidentally getting access to those
accounts.

Be sure to include the module in the session group as well as the auth
group.  Without the session entry, the user's ticket cache will not be
created properly for ssh logins (among possibly others).

If your users should normally all use Kerberos passwords exclusively,
putting something like:

```

t/data/update/pam-krb5/docknot.yaml  view on Meta::CPAN

        account  required  pam_krb5.so minimum_uid=1000
        account  required  pam_unix.so
    ```

    in `/etc/pam.d/common-account`.  The `minimum_uid` setting tells the PAM
    module to pass on any users with a UID lower than 1000, thereby bypassing
    Kerberos authentication for the root account and any system accounts.  You
    normally want to do this since otherwise, if the network is down, the
    Kerberos authentication can time out and make it difficult to log in as
    root and fix matters.  This also avoids problems with Kerberos principals
    that happen to match system accounts accidentally getting access to those
    accounts.

    Be sure to include the module in the session group as well as the auth
    group.  Without the session entry, the user's ticket cache will not be
    created properly for ssh logins (among possibly others).

    If your users should normally all use Kerberos passwords exclusively,
    putting something like:

    ```

t/data/update/pam-krb5/old/sections/configuring  view on Meta::CPAN

    account  required  pam_krb5.so minimum_uid=1000
    account  required  pam_unix.so
```

in `/etc/pam.d/common-account`.  The `minimum_uid` setting tells the PAM
module to pass on any users with a UID lower than 1000, thereby bypassing
Kerberos authentication for the root account and any system accounts.  You
normally want to do this since otherwise, if the network is down, the
Kerberos authentication can time out and make it difficult to log in as
root and fix matters.  This also avoids problems with Kerberos principals
that happen to match system accounts accidentally getting access to those
accounts.

Be sure to include the module in the session group as well as the auth
group.  Without the session entry, the user's ticket cache will not be
created properly for ssh logins (among possibly others).

If your users should normally all use Kerberos passwords exclusively,
putting something like:

```



( run in 0.470 second using v1.01-cache-2.11-cpan-de7293f3b23 )