Hello community,
here is the log from the commit of package perl-Mojolicious-Plugin-RenderFile
for openSUSE:Factory checked in at 2017-05-16 14:33:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Mojolicious-Plugin-RenderFile (Old)
and /work/SRC/openSUSE:Factory/.perl-Mojolicious-Plugin-RenderFile.new
(New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Mojolicious-Plugin-RenderFile"
Tue May 16 14:33:49 2017 rev:6 rq:489033 version:0.11
Changes:
--------
---
/work/SRC/openSUSE:Factory/perl-Mojolicious-Plugin-RenderFile/perl-Mojolicious-Plugin-RenderFile.changes
2015-12-29 12:59:34.000000000 +0100
+++
/work/SRC/openSUSE:Factory/.perl-Mojolicious-Plugin-RenderFile.new/perl-Mojolicious-Plugin-RenderFile.changes
2017-05-16 14:33:55.665776952 +0200
@@ -1,0 +2,10 @@
+Fri Apr 14 06:05:27 UTC 2017 - [email protected]
+
+- updated to 0.11
+ see /usr/share/doc/packages/perl-Mojolicious-Plugin-RenderFile/Changes
+
+
+ 0.11
+ Add "content_type" option
+
+-------------------------------------------------------------------
Old:
----
Mojolicious-Plugin-RenderFile-0.10.tar.gz
New:
----
Mojolicious-Plugin-RenderFile-0.11.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Mojolicious-Plugin-RenderFile.spec ++++++
--- /var/tmp/diff_new_pack.bMjviW/_old 2017-05-16 14:33:56.473663452 +0200
+++ /var/tmp/diff_new_pack.bMjviW/_new 2017-05-16 14:33:56.477662890 +0200
@@ -1,7 +1,7 @@
#
# spec file for package perl-Mojolicious-Plugin-RenderFile
#
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 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
@@ -17,7 +17,7 @@
Name: perl-Mojolicious-Plugin-RenderFile
-Version: 0.10
+Version: 0.11
Release: 0
#Upstream: CHECK(GPL-1.0+ or Artistic-1.0)
%define cpan_name Mojolicious-Plugin-RenderFile
@@ -25,7 +25,7 @@
License: GPL-1.0+ or Artistic-1.0
Group: Development/Libraries/Perl
Url: http://search.cpan.org/dist/Mojolicious-Plugin-RenderFile/
-Source0:
http://www.cpan.org/authors/id/K/KO/KOORCHIK/%{cpan_name}-%{version}.tar.gz
+Source0:
https://cpan.metacpan.org/authors/id/K/KO/KOORCHIK/%{cpan_name}-%{version}.tar.gz
Source1: cpanspec.yml
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
++++++ Mojolicious-Plugin-RenderFile-0.10.tar.gz ->
Mojolicious-Plugin-RenderFile-0.11.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-Plugin-RenderFile-0.10/Changes
new/Mojolicious-Plugin-RenderFile-0.11/Changes
--- old/Mojolicious-Plugin-RenderFile-0.10/Changes 2015-12-20
20:32:34.000000000 +0100
+++ new/Mojolicious-Plugin-RenderFile-0.11/Changes 2017-04-13
08:26:18.000000000 +0200
@@ -31,3 +31,6 @@
0.10
Do not include unicode in distro
+
+0.11
+ Add "content_type" option
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-Plugin-RenderFile-0.10/META.json
new/Mojolicious-Plugin-RenderFile-0.11/META.json
--- old/Mojolicious-Plugin-RenderFile-0.10/META.json 2015-12-20
20:33:32.000000000 +0100
+++ new/Mojolicious-Plugin-RenderFile-0.11/META.json 2017-04-13
08:27:51.000000000 +0200
@@ -4,7 +4,7 @@
"Viktor Turskyi <[email protected]>"
],
"dynamic_config" : 1,
- "generated_by" : "ExtUtils::MakeMaker version 7.0401, CPAN::Meta::Converter
version 2.150001",
+ "generated_by" : "ExtUtils::MakeMaker version 7.1001, CPAN::Meta::Converter
version 2.150005",
"license" : [
"unknown"
],
@@ -43,5 +43,6 @@
"url" : "https://github.com/koorchik/Mojolicious-Plugin-RenderFile"
}
},
- "version" : "0.10"
+ "version" : "0.11",
+ "x_serialization_backend" : "JSON::PP version 2.27300"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-Plugin-RenderFile-0.10/META.yml
new/Mojolicious-Plugin-RenderFile-0.11/META.yml
--- old/Mojolicious-Plugin-RenderFile-0.10/META.yml 2015-12-20
20:33:32.000000000 +0100
+++ new/Mojolicious-Plugin-RenderFile-0.11/META.yml 2017-04-13
08:27:51.000000000 +0200
@@ -7,7 +7,7 @@
configure_requires:
ExtUtils::MakeMaker: '0'
dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 7.0401, CPAN::Meta::Converter
version 2.150001'
+generated_by: 'ExtUtils::MakeMaker version 7.1001, CPAN::Meta::Converter
version 2.150005'
license: unknown
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -22,4 +22,5 @@
perl: '5.01'
resources:
repository: https://github.com/koorchik/Mojolicious-Plugin-RenderFile
-version: '0.10'
+version: '0.11'
+x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-Plugin-RenderFile-0.10/README.pod
new/Mojolicious-Plugin-RenderFile-0.11/README.pod
--- old/Mojolicious-Plugin-RenderFile-0.10/README.pod 2014-05-16
15:40:54.000000000 +0200
+++ new/Mojolicious-Plugin-RenderFile-0.11/README.pod 2017-04-13
08:14:38.000000000 +0200
@@ -63,6 +63,16 @@
By default "Content-Type" header is "application/x-download"
+You cannot pass both the "format" and the "content_type" option, as they are
mutually exclusive.
+
+=item C<content_type> (optional)
+
+With this option, the "Content-Type" can be set directly.
+
+By default "Content-Type" header is "application/x-download"
+
+You cannot pass both the "format" and the "content_type" option, as they are
mutually exclusive.
+
=item C<content_disposition> (optional)
Tells browser how to present the file.
@@ -103,4 +113,4 @@
See http://dev.perl.org/licenses/ for more information.
-=cut
\ No newline at end of file
+=cut
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Mojolicious-Plugin-RenderFile-0.10/lib/Mojolicious/Plugin/RenderFile.pm
new/Mojolicious-Plugin-RenderFile-0.11/lib/Mojolicious/Plugin/RenderFile.pm
--- old/Mojolicious-Plugin-RenderFile-0.10/lib/Mojolicious/Plugin/RenderFile.pm
2015-12-20 20:32:54.000000000 +0100
+++ new/Mojolicious-Plugin-RenderFile-0.11/lib/Mojolicious/Plugin/RenderFile.pm
2017-04-13 08:21:23.000000000 +0200
@@ -7,7 +7,7 @@
use Encode qw( encode decode_utf8 );
use Mojo::Util 'quote';
-our $VERSION = '0.10';
+our $VERSION = '0.11';
sub register {
my ( $self, $app ) = @_;
@@ -25,8 +25,11 @@
my $cleanup = $args{cleanup} // 0;
# Content type based on format
- my $content_type;
- $content_type = $c->app->types->type( $args{format} ) if $args{format};
+ $c->app->log->error('You cannot provide both "format" and
"content_type" option');
+ return if $args{format} && $args{content_type};
+
+ my $content_type = $args{content_type};
+ $content_type ||= $c->app->types->type( $args{format} ) if
$args{format};
$content_type ||= 'application/x-download';
# Create asset
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-Plugin-RenderFile-0.10/t/basic.t
new/Mojolicious-Plugin-RenderFile-0.11/t/basic.t
--- old/Mojolicious-Plugin-RenderFile-0.10/t/basic.t 2014-05-16
15:20:31.000000000 +0200
+++ new/Mojolicious-Plugin-RenderFile-0.11/t/basic.t 2017-04-13
08:25:59.000000000 +0200
@@ -24,6 +24,14 @@
$self->render_file( data => 'data to download', filename => 'sample.txt' );
};
+get '/data/custom_content_type' => sub {
+ my $self = shift;
+ $self->render_file(
+ data => 'data to download',
+ filename => 'sample.txt',
+ content_type => 'application/pdf'
+ );
+};
get '/data/no_filename' => sub {
my $self = shift;
@@ -41,6 +49,7 @@
);
};
+
my $t = Test::Mojo->new;
$t->get_ok('/default')
@@ -88,6 +97,12 @@
->content_type_is('application/x-download;name="sample.txt"')
->header_is( 'Content-Disposition' => 'attachment;filename="sample.txt"' );
+$t->get_ok('/data/custom_content_type' => { 'Range' => 'bytes=5-6' })
+ ->status_is(206)
+ ->content_is('to')
+ ->content_type_is('application/pdf;name="sample.txt"')
+ ->header_is( 'Content-Disposition' => 'attachment;filename="sample.txt"' );
+
$t->get_ok('/data/no_filename')
->status_is(200)
->content_is('data to download')