pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/www/ruby-http-accept www/ruby-http-accept: add version...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/515976c73161
branches:  trunk
changeset: 410131:515976c73161
user:      taca <taca%pkgsrc.org@localhost>
date:      Sun Jan 19 08:23:06 2020 +0000

description:
www/ruby-http-accept: add version 2.1.1 package

Add ruby-http-accept version 2.1.1 package.

# HTTP::Accept

Provides a robust set of parsers for dealing with HTTP Accept,
Accept-Language, Accept-Encoding, Accept-Charset headers.

## Motivation

I've been developing some tools for building RESTful endpoints and part of
that involved versioning.  After reviewing the options, I settled on using
the Accept: application/json;version=1 method as outlined here.

The version=1 part of the media-type is a parameter as defined by RFC7231
Section 3.1.1.1.  After reviewing several existing different options for
parsing the Accept: header, I noticed a disturbing trend: header.split(',').
Because parameters may contain quoted strings which contain commas, this is
clearly not an appropriate way to parse the header.

I am concerned about correctness, security and performance.  As such, I
implemented this gem to provide a simple high level interface for both
parsing and correctly interpreting these headers.

diffstat:

 www/ruby-http-accept/DESCR    |  20 ++++++++++++++++++++
 www/ruby-http-accept/Makefile |  14 ++++++++++++++
 www/ruby-http-accept/PLIST    |  21 +++++++++++++++++++++
 www/ruby-http-accept/distinfo |   6 ++++++
 4 files changed, 61 insertions(+), 0 deletions(-)

diffs (77 lines):

diff -r 0b40015ac36a -r 515976c73161 www/ruby-http-accept/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/ruby-http-accept/DESCR        Sun Jan 19 08:23:06 2020 +0000
@@ -0,0 +1,20 @@
+# HTTP::Accept
+
+Provides a robust set of parsers for dealing with HTTP Accept,
+Accept-Language, Accept-Encoding, Accept-Charset headers.
+
+## Motivation
+
+I've been developing some tools for building RESTful endpoints and part of
+that involved versioning.  After reviewing the options, I settled on using
+the Accept: application/json;version=1 method as outlined here.
+
+The version=1 part of the media-type is a parameter as defined by RFC7231
+Section 3.1.1.1.  After reviewing several existing different options for
+parsing the Accept: header, I noticed a disturbing trend: header.split(',').
+Because parameters may contain quoted strings which contain commas, this is
+clearly not an appropriate way to parse the header.
+
+I am concerned about correctness, security and performance.  As such, I
+implemented this gem to provide a simple high level interface for both
+parsing and correctly interpreting these headers.
diff -r 0b40015ac36a -r 515976c73161 www/ruby-http-accept/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/ruby-http-accept/Makefile     Sun Jan 19 08:23:06 2020 +0000
@@ -0,0 +1,14 @@
+# $NetBSD: Makefile,v 1.1 2020/01/19 08:23:06 taca Exp $
+
+DISTNAME=      http-accept-2.1.1
+CATEGORIES=    www
+
+MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=      https://github.com/ioquatix/http-accept
+COMMENT=       Parse Accept and Accept-Language HTTP headers
+LICENSE=       mit
+
+USE_LANGUAGES= # none
+
+.include "../../lang/ruby/gem.mk"
+.include "../../mk/bsd.pkg.mk"
diff -r 0b40015ac36a -r 515976c73161 www/ruby-http-accept/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/ruby-http-accept/PLIST        Sun Jan 19 08:23:06 2020 +0000
@@ -0,0 +1,21 @@
+@comment $NetBSD: PLIST,v 1.1 2020/01/19 08:23:06 taca Exp $
+${GEM_HOME}/cache/${GEM_NAME}.gem
+${GEM_LIBDIR}/.gitignore
+${GEM_LIBDIR}/.rspec
+${GEM_LIBDIR}/.travis.yml
+${GEM_LIBDIR}/Gemfile
+${GEM_LIBDIR}/README.md
+${GEM_LIBDIR}/Rakefile
+${GEM_LIBDIR}/http-accept.gemspec
+${GEM_LIBDIR}/lib/http/accept.rb
+${GEM_LIBDIR}/lib/http/accept/charsets.rb
+${GEM_LIBDIR}/lib/http/accept/content_type.rb
+${GEM_LIBDIR}/lib/http/accept/encodings.rb
+${GEM_LIBDIR}/lib/http/accept/languages.rb
+${GEM_LIBDIR}/lib/http/accept/media_types.rb
+${GEM_LIBDIR}/lib/http/accept/media_types/map.rb
+${GEM_LIBDIR}/lib/http/accept/parse_error.rb
+${GEM_LIBDIR}/lib/http/accept/quoted_string.rb
+${GEM_LIBDIR}/lib/http/accept/sort.rb
+${GEM_LIBDIR}/lib/http/accept/version.rb
+${GEM_HOME}/specifications/${GEM_NAME}.gemspec
diff -r 0b40015ac36a -r 515976c73161 www/ruby-http-accept/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/ruby-http-accept/distinfo     Sun Jan 19 08:23:06 2020 +0000
@@ -0,0 +1,6 @@
+$NetBSD: distinfo,v 1.1 2020/01/19 08:23:06 taca Exp $
+
+SHA1 (http-accept-2.1.1.gem) = c0f1c4c89aa01e17d2d0f0f9077a7d5c21eb04a3
+RMD160 (http-accept-2.1.1.gem) = efa6ba902b31e927f18187dd5f81b5513f182595
+SHA512 (http-accept-2.1.1.gem) = 5bf72e0f2d1e5b7d6e4845fc1ec8431b3c390294b8f2590fce34afb637e76690d128140446cf4078bc451da966dc8abb7dea2c0408dab346d45d5f2c1ae301af
+Size (http-accept-2.1.1.gem) = 11776 bytes



Home | Main Index | Thread Index | Old Index