Hello community,
here is the log from the commit of package perl-Mojolicious-Plugin-CHI for
openSUSE:Factory checked in at 2018-09-24 13:13:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Mojolicious-Plugin-CHI (Old)
and /work/SRC/openSUSE:Factory/.perl-Mojolicious-Plugin-CHI.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Mojolicious-Plugin-CHI"
Mon Sep 24 13:13:59 2018 rev:10 rq:637207 version:0.18
Changes:
--------
---
/work/SRC/openSUSE:Factory/perl-Mojolicious-Plugin-CHI/perl-Mojolicious-Plugin-CHI.changes
2016-09-13 22:25:44.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.perl-Mojolicious-Plugin-CHI.new/perl-Mojolicious-Plugin-CHI.changes
2018-09-24 13:13:59.589630487 +0200
@@ -1,0 +2,6 @@
+Sat Sep 22 05:37:41 UTC 2018 - Stephan Kulow <[email protected]>
+
+- updated to 0.18
+ see /usr/share/doc/packages/perl-Mojolicious-Plugin-CHI/Changes
+
+-------------------------------------------------------------------
Old:
----
Mojolicious-Plugin-CHI-0.15.tar.gz
New:
----
Mojolicious-Plugin-CHI-0.18.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Mojolicious-Plugin-CHI.spec ++++++
--- /var/tmp/diff_new_pack.7iRzpk/_old 2018-09-24 13:13:59.993629787 +0200
+++ /var/tmp/diff_new_pack.7iRzpk/_new 2018-09-24 13:13:59.993629787 +0200
@@ -1,7 +1,7 @@
#
# spec file for package perl-Mojolicious-Plugin-CHI
#
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -12,19 +12,19 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: perl-Mojolicious-Plugin-CHI
-Version: 0.15
+Version: 0.18
Release: 0
%define cpan_name Mojolicious-Plugin-CHI
Summary: Use CHI Caches in Mojolicious
License: Artistic-2.0
Group: Development/Libraries/Perl
Url: http://search.cpan.org/dist/Mojolicious-Plugin-CHI/
-Source0:
http://www.cpan.org/authors/id/A/AK/AKRON/%{cpan_name}-%{version}.tar.gz
+Source0:
https://cpan.metacpan.org/authors/id/A/AK/AKRON/%{cpan_name}-%{version}.tar.gz
Source1: cpanspec.yml
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -33,6 +33,7 @@
BuildRequires: perl(CHI) >= 0.58
BuildRequires: perl(Digest::JHash) >= 0.05
BuildRequires: perl(Mojolicious) >= 4.77
+BuildRequires: perl(Test::Memory::Cycle) >= 1.06
BuildRequires: perl(Test::Output) >= 1
Requires: perl(CHI) >= 0.58
Requires: perl(Digest::JHash) >= 0.05
@@ -61,6 +62,7 @@
%files -f %{name}.files
%defattr(-,root,root,755)
-%doc Changes LICENSE
+%doc Changes
+%license LICENSE
%changelog
++++++ Mojolicious-Plugin-CHI-0.15.tar.gz -> Mojolicious-Plugin-CHI-0.18.tar.gz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-Plugin-CHI-0.15/Changes
new/Mojolicious-Plugin-CHI-0.18/Changes
--- old/Mojolicious-Plugin-CHI-0.15/Changes 2016-09-09 10:07:25.000000000
+0200
+++ new/Mojolicious-Plugin-CHI-0.18/Changes 2018-09-18 13:42:16.000000000
+0200
@@ -1,3 +1,13 @@
+0.18 2018-09-18
+ - Added support for CHI subclasses (rouzier++).
+ - Remove unnecessary file permissions (manwar++).
+
+0.17 2018-09-16
+ - Fix tests for Mojolicious 8 compatibility.
+
+0.16 2016-10-29
+ - Added Readme to MANIFEST.
+
0.15 2016-09-09
- Fixed command namespace pushing to be limited.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-Plugin-CHI-0.15/MANIFEST
new/Mojolicious-Plugin-CHI-0.18/MANIFEST
--- old/Mojolicious-Plugin-CHI-0.15/MANIFEST 2016-09-09 10:07:56.000000000
+0200
+++ new/Mojolicious-Plugin-CHI-0.18/MANIFEST 2018-09-18 13:42:52.000000000
+0200
@@ -5,7 +5,9 @@
t/CHI-Log.t
t/CHI-Command.t
t/CHI-NoIOLoop.t
+t/CHI-Class.t
Changes
+Readme.pod
MANIFEST
LICENSE
Makefile.PL
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-Plugin-CHI-0.15/META.json
new/Mojolicious-Plugin-CHI-0.18/META.json
--- old/Mojolicious-Plugin-CHI-0.15/META.json 2016-09-09 10:07:56.000000000
+0200
+++ new/Mojolicious-Plugin-CHI-0.18/META.json 2018-09-18 13:42:52.000000000
+0200
@@ -4,7 +4,7 @@
"Nils Diewald"
],
"dynamic_config" : 1,
- "generated_by" : "ExtUtils::MakeMaker version 7.1001, CPAN::Meta::Converter
version 2.150005",
+ "generated_by" : "ExtUtils::MakeMaker version 7.32, CPAN::Meta::Converter
version 2.150005",
"license" : [
"artistic_2"
],
@@ -22,6 +22,7 @@
"prereqs" : {
"build" : {
"requires" : {
+ "Test::Memory::Cycle" : "1.06",
"Test::More" : "0",
"Test::Output" : "1"
}
@@ -54,6 +55,6 @@
"web" : "https://github.com/Akron/Mojolicious-Plugin-CHI"
}
},
- "version" : "0.15",
+ "version" : "0.18",
"x_serialization_backend" : "JSON::PP version 2.27300"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-Plugin-CHI-0.15/META.yml
new/Mojolicious-Plugin-CHI-0.18/META.yml
--- old/Mojolicious-Plugin-CHI-0.15/META.yml 2016-09-09 10:07:56.000000000
+0200
+++ new/Mojolicious-Plugin-CHI-0.18/META.yml 2018-09-18 13:42:52.000000000
+0200
@@ -3,12 +3,13 @@
author:
- 'Nils Diewald'
build_requires:
+ Test::Memory::Cycle: '1.06'
Test::More: '0'
Test::Output: '1'
configure_requires:
ExtUtils::MakeMaker: '0'
dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 7.1001, CPAN::Meta::Converter
version 2.150005'
+generated_by: 'ExtUtils::MakeMaker version 7.32, CPAN::Meta::Converter version
2.150005'
license: artistic_2
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -27,5 +28,5 @@
bugtracker: https://github.com/Akron/Mojolicious-Plugin-CHI/issues
license: http://www.opensource.org/licenses/artistic-license-2.0
repository: https://github.com/Akron/Mojolicious-Plugin-CHI.git
-version: '0.15'
+version: '0.18'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-Plugin-CHI-0.15/Makefile.PL
new/Mojolicious-Plugin-CHI-0.18/Makefile.PL
--- old/Mojolicious-Plugin-CHI-0.15/Makefile.PL 2016-09-03 00:32:13.000000000
+0200
+++ new/Mojolicious-Plugin-CHI-0.18/Makefile.PL 2018-09-18 13:42:16.000000000
+0200
@@ -11,7 +11,8 @@
AUTHOR => 'Nils Diewald',
BUILD_REQUIRES => {
'Test::More' => 0,
- 'Test::Output' => 1.0
+ 'Test::Output' => 1.0,
+ 'Test::Memory::Cycle' => 1.06
},
PREREQ_PM => {
'Mojolicious' => 4.77,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-Plugin-CHI-0.15/Readme.pod
new/Mojolicious-Plugin-CHI-0.18/Readme.pod
--- old/Mojolicious-Plugin-CHI-0.15/Readme.pod 1970-01-01 01:00:00.000000000
+0100
+++ new/Mojolicious-Plugin-CHI-0.18/Readme.pod 2018-09-18 13:42:16.000000000
+0200
@@ -0,0 +1,191 @@
+=pod
+
+=encoding utf8
+
+=head1 NAME
+
+Mojolicious::Plugin::CHI - Use CHI Caches in 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 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.
+All cache handles are qualified L<CHI> namespaces.
+You can omit this mapping by passing a C<namespaces>
+parameter with a C<false> value.
+The handles have to be unique, i.e.
+you can't have multiple different C<default> caches in mounted
+applications using L<Mojolicious::Plugin::Mount>.
+Logging defaults to the application log, but can be
+overridden using L<on_get_error|CHI/CONSTRUCTOR> and
+L<on_set_error|CHI/CONSTRUCTOR>.
+
+All parameters can be set as part of the configuration
+file with the key C<CHI> or on registration
+(that can be overwritten by configuration).
+
+Use custom CHI subclasses by passing a C<chi_class>
+parameter with the class name of a CHI subclass.
+
+=head1 HELPERS
+
+=head2 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 COMMANDS
+
+The following commands are available
+when the plugin is registered.
+
+=head2 chi list
+
+ perl app.pl chi list
+
+List all CHI caches associated with your application.
+
+
+=head2 chi purge
+
+ perl app.pl chi purge mycache
+
+Remove all expired entries from the cache namespace.
+
+
+=head2 chi clear
+
+ perl app.pl chi clear mycache
+
+Remove all entries from the cache namespace.
+
+
+=head2 chi expire
+
+ perl app.pl chi expire mykey
+ perl app.pl chi expire mycache mykey
+
+Set the expiration date of a key to the past.
+This does not necessarily delete the data,
+but makes it unavailable using C<get>.
+
+
+=head2 chi remove
+
+ perl app.pl chi remove mykey
+ perl app.pl chi remove mycache mykey
+
+Remove a key from the cache.
+
+
+
+=head1 DEPENDENCIES
+
+L<Mojolicious>,
+L<CHI>.
+
+B<Note:> Old versions of L<CHI> had a lot of dependencies.
+It was thus not recommended to use this plugin in a CGI
+environment. Since new versions of CHI use L<Moo> instead of
+L<Moose>, more use cases may be possible.
+
+
+=head1 CONTRIBUTORS
+
+L<Boris Däppen|https://github.com/borisdaeppen>
+
+L<Renée Bäcker|https://github.com/reneeb>
+
+L<Rouzier|https://github.com/rouzier>
+
+L<Mohammad S Anwar|https://github.com/manwar>
+
+
+=head1 AVAILABILITY
+
+ https://github.com/Akron/Mojolicious-Plugin-CHI
+
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2012-2018, L<Nils Diewald|http://nils-diewald.de/>.
+
+This program is free software, you can redistribute it
+and/or modify it under the terms of the Artistic License version 2.0.
+
+=cut
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Mojolicious-Plugin-CHI-0.15/lib/Mojolicious/Plugin/CHI.pm
new/Mojolicious-Plugin-CHI-0.18/lib/Mojolicious/Plugin/CHI.pm
--- old/Mojolicious-Plugin-CHI-0.15/lib/Mojolicious/Plugin/CHI.pm
2016-09-09 10:07:25.000000000 +0200
+++ new/Mojolicious-Plugin-CHI-0.18/lib/Mojolicious/Plugin/CHI.pm
2018-09-18 13:42:16.000000000 +0200
@@ -3,7 +3,7 @@
use Scalar::Util 'weaken';
use CHI;
-our $VERSION = '0.15';
+our $VERSION = '0.18';
# Register Plugin
sub register {
@@ -32,6 +32,8 @@
$caches = $mojo->chi_handles;
};
+ # Support classes
+ my $chi_class = delete $param->{chi_class} // 'CHI';
# Support namespaces
my $ns = delete $param->{namespaces} // 1;
@@ -61,7 +63,7 @@
};
# Get CHI handle
- my $cache = CHI->new(
+ my $cache = $chi_class->new(
# Set logging routines
on_get_error => $log_ref,
@@ -200,6 +202,8 @@
file with the key C<CHI> or on registration
(that can be overwritten by configuration).
+Use custom CHI subclasses by passing a C<chi_class>
+parameter with the class name of a CHI subclass.
=head1 HELPERS
@@ -278,6 +282,10 @@
L<Renée Bäcker|https://github.com/reneeb>
+L<Rouzier|https://github.com/rouzier>
+
+L<Mohammad S Anwar|https://github.com/manwar>
+
=head1 AVAILABILITY
@@ -286,7 +294,7 @@
=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2012-2016, L<Nils Diewald|http://nils-diewald.de/>.
+Copyright (C) 2012-2018, L<Nils Diewald|http://nils-diewald.de/>.
This program is free software, you can redistribute it
and/or modify it under the terms of the Artistic License version 2.0.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-Plugin-CHI-0.15/t/CHI-Class.t
new/Mojolicious-Plugin-CHI-0.18/t/CHI-Class.t
--- old/Mojolicious-Plugin-CHI-0.15/t/CHI-Class.t 1970-01-01
01:00:00.000000000 +0100
+++ new/Mojolicious-Plugin-CHI-0.18/t/CHI-Class.t 2018-09-18
13:27:51.000000000 +0200
@@ -0,0 +1,38 @@
+#!/usr/bin/env perl
+package ChiTest;
+use base qw(CHI);
+
+package main;
+use Mojolicious::Lite;
+use Test::More;
+use Test::Mojo;
+use File::Temp qw/:POSIX tempdir/;
+
+use lib 'lib';
+use lib '../lib';
+
+use_ok 'Mojolicious::Plugin::CHI';
+
+my $t = Test::Mojo->new;
+my $app = $t->app;
+
+my $c = Mojolicious::Controller->new;
+$c->app($app);
+
+my $path = tempdir(CLEANUP => 1);
+
+$app->plugin(CHI => {
+ MyCache2 => {
+ driver => 'File',
+ root_dir => $path
+ },
+ namespaces => 1,
+ chi_class => 'ChiTest',
+});
+
+Mojo::IOLoop->start;
+
+my $my_cache = $c->chi('MyCache2');
+is($my_cache->chi_root_class, "ChiTest", 'use ChiTest as my root class');
+
+done_testing;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-Plugin-CHI-0.15/t/CHI-Command.t
new/Mojolicious-Plugin-CHI-0.18/t/CHI-Command.t
--- old/Mojolicious-Plugin-CHI-0.15/t/CHI-Command.t 2016-09-09
10:07:25.000000000 +0200
+++ new/Mojolicious-Plugin-CHI-0.18/t/CHI-Command.t 2018-09-16
14:57:20.000000000 +0200
@@ -22,11 +22,11 @@
CHI => {
first => {
driver => 'Memory',
- datastore => $hash1
+ datastore => $hash1
},
MySecondCache => {
driver => 'Memory',
- datastore => $hash2
+ datastore => $hash2
}
}
}
@@ -37,9 +37,15 @@
my $cmds = $app->commands;
ok(grep/::CHI/, @{$cmds->namespaces}, 'Namespace is set');
-is_deeply(
- $cmds->namespaces,
- [qw/Mojolicious::Command Mojolicious::Plugin::CHI/],
+is(
+ $cmds->namespaces->[0],
+ 'Mojolicious::Command',
+ 'Namespace is set'
+);
+
+is(
+ $cmds->namespaces->[-1],
+ 'Mojolicious::Plugin::CHI',
'Namespace is set'
);
@@ -96,9 +102,15 @@
});
$cmds = $app->commands;
-is_deeply(
- $cmds->namespaces,
- [qw/Mojolicious::Command Mojolicious::Plugin::CHI/],
+is(
+ $cmds->namespaces->[0],
+ 'Mojolicious::Command',
+ 'Namespace is set only once'
+);
+
+is(
+ $cmds->namespaces->[-1],
+ 'Mojolicious::Plugin::CHI',
'Namespace is set only once'
);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-Plugin-CHI-0.15/t/CHI.t
new/Mojolicious-Plugin-CHI-0.18/t/CHI.t
--- old/Mojolicious-Plugin-CHI-0.15/t/CHI.t 2014-04-17 14:48:55.000000000
+0200
+++ new/Mojolicious-Plugin-CHI-0.18/t/CHI.t 2018-08-11 12:36:01.000000000
+0200
@@ -1,12 +1,10 @@
#!/usr/bin/env perl
use Mojolicious::Lite;
-use Test::More tests => 17;
+use Test::More tests => 18;
use Test::Mojo;
+use Test::Memory::Cycle;
use File::Temp qw/:POSIX tempdir/;
-use lib 'lib';
-use lib '../lib';
-
use_ok 'Mojolicious::Plugin::CHI';
my $t = Test::Mojo->new;
@@ -60,3 +58,5 @@
is($c->chi->get('key_1'), '-Wert 1', '-Wert 1');
is($c->chi->get('key_2'), '-Wert 2', '-Wert 2');
is($c->chi->get('key_3'), '-Wert 3', '-Wert 3');
+
+memory_cycle_ok($app, 'Test for memory cycle');