<commit_before>=pod

=encoding utf8

=head1 NAME

Mojolicious::Plugin::CHI - Use CHI caches within Mojolicious


=head1 SYNOPSIS

  # Mojolicious
  $app->plugin(CHI => {
    MyCache => {
      driver     => 'FastMmap',
      root_dir   => '/cache',
      cache_size => '20m'
    }
  });

  # Mojolicious::Lite
  plugin 'CHI' => {
    default => {
      driver => 'Memory',
      global => 1
    }
  };

  # In Controllers:
  $c->chi('MyCache')->set(my_key => 'This is my value');
  print $c->chi('MyCache')->get('my_key');

  # Using the default cache
  $c->chi->set(from_memory => 'With love!');
  print $c->chi->get('from_memory');


=head1 DESCRIPTION

L<Mojolicious::Plugin::CHI> is a simple plugin to work with
L<CHI> caches within Mojolicious.


=head1 METHODS

=head2 C<register>

  # Mojolicious
  $app->plugin(CHI => {
    MyCache => {
      driver     => 'FastMmap',
      root_dir   => '/cache',
      cache_size => '20m'
    },
    default => {
      driver => 'Memory',
      global => 1
    },
    namespaces => 1
  });

  # Mojolicious::Lite
  plugin 'CHI' => {
    default => { driver => 'Memory', global => 1 }
  };

  # Or in your config file
  {
    CHI => {
      default => {
        driver => 'Memory',
        global => 1
      }
    }
  }

Called when registering the plugin.
On creation, the plugin accepts a hash of cache names
associated with L<CHI> objects.
In addition to that, you can make all cache handles
qualified L<CHI> namespaces by setting the C<namespaces> parameter
to a true value.

All parameters can be set either on registration or
as part of the configuration file with the key C<CHI>.

B<Note:> Currently, the C<namespaces> flag is off by default
and cache handles are independent from namespaces.
This will change in an upcoming release.
To prevent cache rebuilding in the future, set C<namespaces>
to a true value.


=head1 HELPERS

=head2 C<chi>

  # In Controllers:
  $c->chi('MyCache')->set(my_key => 'This is my value', '10 min');
  print $c->chi('MyCache')->get('my_key');
  print $c->chi->get('from_default_cache');

Returns a L<CHI> handle if registered.
Accepts the name of the registered cache.
If no cache handle name is given, a cache handle name
C<default> is assumed.


=head1 DEPENDENCIES

L<Mojolicious>,
L<CHI>.

B<Note:> L<CHI> has a lot of dependencies. It is
thus not recommended to use this plugin in a CGI
environment.


=head1 CONTRIBUTORS

<NAME> (borisdaeppen)


=head1 AVAILABILITY

  https://github.com/Akron/Mojolicious-Plugin-CHI


=head1 COPYRIGHT AND LICENSE

Copyright (C) 2012, <NAME>.

This program is free software, you can redistribute it
and/or modify it under the same terms as Perl.

=cut
<commit_msg>CPAN preparation (2)<commit_after>=pod

=encoding utf8

=head1 NAME

Mojolicious::Plugin::CHI - Use CHI caches within Mojolicious


=head1 SYNOPSIS

  # Mojolicious
  $app->plugin(CHI => {
    MyCache => {
      driver     => 'FastMmap',
      root_dir   => '/cache',
      cache_size => '20m'
    }
  });

  # Mojolicious::Lite
  plugin 'CHI' => {
    default => {
      driver => 'Memory',
      global => 1
    }
  };

  # In Controllers:
  $c->chi('MyCache')->set(my_key => 'This is my value');
  print $c->chi('MyCache')->get('my_key');

  # Using the default cache
  $c->chi->set(from_memory => 'With love!');
  print $c->chi->get('from_memory');


=head1 DESCRIPTION

L<Mojolicious::Plugin::CHI> is a simple plugin to work with
L<CHI> caches within Mojolicious.


=head1 METHODS

=head2 C<register>

  # Mojolicious
  $app->plugin(CHI => {
    MyCache => {
      driver     => 'FastMmap',
      root_dir   => '/cache',
      cache_size => '20m'
    },
    default => {
      driver => 'Memory',
      global => 1
    },
    namespaces => 1
  });

  # Mojolicious::Lite
  plugin 'CHI' => {
    default => { driver => 'Memory', global => 1 }
  };

  # Or in your config file
  {
    CHI => {
      default => {
        driver => 'Memory',
        global => 1
      }
    }
  }

Called when registering the plugin.
On creation, the plugin accepts a hash of cache names
associated with L<CHI> objects.
In addition to that, you can make all cache handles
qualified L<CHI> namespaces by setting the C<namespaces> parameter
to a true value.

All parameters can be set either on registration or
as part of the configuration file with the key C<CHI>.

B<Note:> Currently, the C<namespaces> flag is off by default
and cache handles are independent from namespaces.
This will change in an upcoming release.
To prevent cache rebuilding in the future, set C<namespaces>
to a true value.


=head1 HELPERS

=head2 C<chi>

  # In Controllers:
  $c->chi('MyCache')->set(my_key => 'This is my value', '10 min');
  print $c->chi('MyCache')->get('my_key');
  print $c->chi->get('from_default_cache');

Returns a L<CHI> handle if registered.
Accepts the name of the registered cache.
If no cache handle name is given, a cache handle name
C<default> is assumed.


=head1 DEPENDENCIES

L<Mojolicious>,
L<CHI>.

B<Note:> L<CHI> has a lot of dependencies. It is
thus not recommended to use this plugin in a CGI
environment.


=head1 CONTRIBUTORS

<NAME> (borisdaeppen)

reneeb

=head1 AVAILABILITY

  https://github.com/Akron/Mojolicious-Plugin-CHI


=head1 COPYRIGHT AND LICENSE

Copyright (C) 2012, <NAME>.

This program is free software, you can redistribute it
and/or modify it under the same terms as Perl.

=cut

{'fraction_non_alphanumeric': 0.12625324916450056, 'fraction_numerical': 0.010211659858893428, 'mean_word_length': 3.1630602782071096, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 131, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3648549', 'n_tokens_mistral': 1886, 'n_tokens_neox': 1807, 'n_words': 601}