debian/0000755000000000000000000000000012157702670007175 5ustar debian/copyright0000644000000000000000000000271712157451127011135 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: http_parser.rb Source: http://github.com/tmm1/http_parser.rb Files: * Copyright: 2010-2013 Aman Gupta 2009-2010 Marc-André Cournoyer License: MIT Files: debian/* Copyright: 2013 Praveen Arimbrathodiyil , 2013 Per Andersson License: MIT License: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. debian/control0000644000000000000000000000303412157672357010610 0ustar Source: ruby-http-parser.rb Section: ruby Priority: optional Maintainer: Debian Ruby Extras Maintainers Uploaders: Praveen Arimbrathodiyil , Per Andersson Build-Depends: debhelper (>= 7.0.50~), gem2deb (>= 0.4.1~), libhttp-parser-dev, rake, ruby-json, ruby-rspec, ruby-yajl Standards-Version: 3.9.4 Vcs-Git: git://anonscm.debian.org/pkg-ruby-extras/ruby-http-parser.rb.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-ruby-extras/ruby-http-parser.rb.git;a=summary Homepage: http://github.com/tmm1/http_parser.rb XS-Ruby-Versions: all Package: ruby-http-parser.rb Architecture: any XB-Ruby-Versions: ${ruby:Versions} Depends: ${shlibs:Depends}, ${misc:Depends}, ruby | ruby-interpreter Conflicts: ruby-http-parser Suggests: ruby-http-parser.rb-doc Description: Simple callback-based HTTP request/response parser A simple callback-based HTTP request/response parser for writing http servers, clients and proxies. . It is built on top of Joyent's libhttp-parser and it's Java port. Package: ruby-http-parser.rb-doc Architecture: all Section: doc Depends: ${misc:Depends}, libjs-jquery Suggests: ruby-http-parser.rb Description: Simple callback-based HTTP request/response parser (documentation) A simple callback-based HTTP request/response parser for writing http servers, clients and proxies. . It is built on top of Joyent's libhttp-parser and it's Java port. . This package contains the html documentation for ruby-http-parser.rb. debian/patches/0000755000000000000000000000000012157672357010634 5ustar debian/patches/0001-fix-default-encoding.patch0000644000000000000000000000075312157461036016222 0ustar From: Debian Ruby Extras Maintainers Date: Mon, 17 Jun 2013 02:05:30 +0200 Subject: fix-default-encoding --- spec/parser_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/parser_spec.rb b/spec/parser_spec.rb index 7134476..f904185 100644 --- a/spec/parser_spec.rb +++ b/spec/parser_spec.rb @@ -1,3 +1,7 @@ +if defined? Encoding + Encoding.default_external = "UTF-8" +end + require "spec_helper" require "json" debian/patches/0003-Build-with-system-libhttp-parser.patch0000644000000000000000000001413012157461036020512 0ustar From: Per Andersson Date: Mon, 17 Jun 2013 02:09:37 +0200 Subject: Build with system libhttp-parser --- ext/ruby_http_parser/extconf.rb | 37 +++++++++++++++++---------------- ext/ruby_http_parser/ruby_http_parser.c | 28 ++++++++++++------------- 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/ext/ruby_http_parser/extconf.rb b/ext/ruby_http_parser/extconf.rb index d2f6e51..1d5ad3d 100644 --- a/ext/ruby_http_parser/extconf.rb +++ b/ext/ruby_http_parser/extconf.rb @@ -1,24 +1,25 @@ require 'mkmf' -# check out code if it hasn't been already -if Dir[File.expand_path('../vendor/http-parser/*', __FILE__)].empty? - Dir.chdir(File.expand_path('../../../', __FILE__)) do - xsystem 'git submodule init' - xsystem 'git submodule update' - end -end +## check out code if it hasn't been already +#if Dir[File.expand_path('../vendor/http-parser/*', __FILE__)].empty? +# Dir.chdir(File.expand_path('../../../', __FILE__)) do +# xsystem 'git submodule init' +# xsystem 'git submodule update' +# end +#end -# mongrel and http-parser both define http_parser_(init|execute), so we -# rename functions in http-parser before using them. -vendor_dir = File.expand_path('../vendor/http-parser/', __FILE__) -src_dir = File.expand_path('../', __FILE__) -%w[ http_parser.c http_parser.h ].each do |file| - File.open(File.join(src_dir, "ryah_#{file}"), 'w'){ |f| - f.write File.read(File.join(vendor_dir, file)).gsub('http_parser', 'ryah_http_parser') - } -end +## mongrel and http-parser both define http_parser_(init|execute), so we +## rename functions in http-parser before using them. +#vendor_dir = File.expand_path('../vendor/http-parser/', __FILE__) +#src_dir = File.expand_path('../', __FILE__) +#%w[ http_parser.c http_parser.h ].each do |file| +# File.open(File.join(src_dir, "ryah_#{file}"), 'w'){ |f| +# f.write File.read(File.join(vendor_dir, file)).gsub('http_parser', 'ryah_http_parser') +# } +#end -$CFLAGS << " -I#{src_dir}" +#$CFLAGS << " -I#{src_dir}" +$LDFLAGS << " -lhttp_parser" -dir_config("ruby_http_parser") +dir_config("ruby_http_parser", '/usr/include', '/usr/lib/http-parser') create_makefile("ruby_http_parser") diff --git a/ext/ruby_http_parser/ruby_http_parser.c b/ext/ruby_http_parser/ruby_http_parser.c index 5650652..3a447f5 100644 --- a/ext/ruby_http_parser/ruby_http_parser.c +++ b/ext/ruby_http_parser/ruby_http_parser.c @@ -1,6 +1,6 @@ #include "ruby.h" #include "ext_help.h" -#include "ryah_http_parser.h" +#include "http_parser.h" #define GET_WRAPPER(N, from) ParserWrapper *N = (ParserWrapper *)(from)->data; #define HASH_CAT(h, k, ptr, len) \ @@ -14,7 +14,7 @@ } while(0) typedef struct ParserWrapper { - ryah_http_parser parser; + http_parser parser; VALUE request_url; @@ -36,11 +36,11 @@ typedef struct ParserWrapper { VALUE last_field_name; VALUE curr_field_name; - enum ryah_http_parser_type type; + enum http_parser_type type; } ParserWrapper; void ParserWrapper_init(ParserWrapper *wrapper) { - ryah_http_parser_init(&wrapper->parser, wrapper->type); + http_parser_init(&wrapper->parser, wrapper->type); wrapper->parser.status_code = 0; wrapper->parser.http_major = 0; wrapper->parser.http_minor = 0; @@ -98,7 +98,7 @@ static VALUE Smixed; /** Callbacks **/ -int on_message_begin(ryah_http_parser *parser) { +int on_message_begin(http_parser *parser) { GET_WRAPPER(wrapper, parser); wrapper->request_url = rb_str_new2(""); @@ -121,13 +121,13 @@ int on_message_begin(ryah_http_parser *parser) { } } -int on_url(ryah_http_parser *parser, const char *at, size_t length) { +int on_url(http_parser *parser, const char *at, size_t length) { GET_WRAPPER(wrapper, parser); rb_str_cat(wrapper->request_url, at, length); return 0; } -int on_header_field(ryah_http_parser *parser, const char *at, size_t length) { +int on_header_field(http_parser *parser, const char *at, size_t length) { GET_WRAPPER(wrapper, parser); if (wrapper->curr_field_name == Qnil) { @@ -140,7 +140,7 @@ int on_header_field(ryah_http_parser *parser, const char *at, size_t length) { return 0; } -int on_header_value(ryah_http_parser *parser, const char *at, size_t length) { +int on_header_value(http_parser *parser, const char *at, size_t length) { GET_WRAPPER(wrapper, parser); int new_field = 0; @@ -186,7 +186,7 @@ int on_header_value(ryah_http_parser *parser, const char *at, size_t length) { return 0; } -int on_headers_complete(ryah_http_parser *parser) { +int on_headers_complete(http_parser *parser) { GET_WRAPPER(wrapper, parser); VALUE ret = Qnil; @@ -207,7 +207,7 @@ int on_headers_complete(ryah_http_parser *parser) { } } -int on_body(ryah_http_parser *parser, const char *at, size_t length) { +int on_body(http_parser *parser, const char *at, size_t length) { GET_WRAPPER(wrapper, parser); VALUE ret = Qnil; @@ -226,7 +226,7 @@ int on_body(ryah_http_parser *parser, const char *at, size_t length) { } } -int on_message_complete(ryah_http_parser *parser) { +int on_message_complete(http_parser *parser) { GET_WRAPPER(wrapper, parser); VALUE ret = Qnil; @@ -246,7 +246,7 @@ int on_message_complete(ryah_http_parser *parser) { } } -static ryah_http_parser_settings settings = { +static http_parser_settings settings = { .on_message_begin = on_message_begin, .on_url = on_url, .on_header_field = on_header_field, @@ -256,7 +256,7 @@ static ryah_http_parser_settings settings = { .on_message_complete = on_message_complete }; -VALUE Parser_alloc_by_type(VALUE klass, enum ryah_http_parser_type type) { +VALUE Parser_alloc_by_type(VALUE klass, enum http_parser_type type) { ParserWrapper *wrapper = ALLOC_N(ParserWrapper, 1); wrapper->type = type; wrapper->parser.data = wrapper; @@ -317,7 +317,7 @@ VALUE Parser_execute(VALUE self, VALUE data) { DATA_GET(self, ParserWrapper, wrapper); wrapper->stopped = Qfalse; - size_t nparsed = ryah_http_parser_execute(&wrapper->parser, &settings, ptr, len); + size_t nparsed = http_parser_execute(&wrapper->parser, &settings, ptr, len); if (wrapper->parser.upgrade) { if (RTEST(wrapper->stopped)) debian/patches/0002-Remove-git-ls-files-call-in-gemspec.patch0000644000000000000000000000140412157461036020711 0ustar From: Per Andersson Date: Mon, 17 Jun 2013 02:07:05 +0200 Subject: Remove git ls-files call in gemspec --- http_parser.rb.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http_parser.rb.gemspec b/http_parser.rb.gemspec index 3cff960..0f6be7a 100644 --- a/http_parser.rb.gemspec +++ b/http_parser.rb.gemspec @@ -8,7 +8,7 @@ Gem::Specification.new do |s| s.email = ["macournoyer@gmail.com", "aman@tmm1.net"] s.homepage = "http://github.com/tmm1/http_parser.rb" - s.files = `git ls-files`.split("\n") + Dir['ext/ruby_http_parser/vendor/**/*'] +# s.files = `git ls-files`.split("\n") + Dir['ext/ruby_http_parser/vendor/**/*'] s.require_paths = ["lib"] s.extensions = ["ext/ruby_http_parser/extconf.rb"] debian/patches/0004-Do-not-overload-loadpath.patch0000644000000000000000000000052012157672357016776 0ustar Description: do not modify $LOAD_PATH to find C extension Ruby knwos where to find it Author: Cédric Boutillier Forwarded: not-needed Last-Update: 2013-06-17 --- a/lib/http_parser.rb +++ b/lib/http_parser.rb @@ -1,4 +1,3 @@ -$:.unshift File.expand_path('../', __FILE__) require 'ruby_http_parser' Http = HTTP debian/patches/series0000644000000000000000000000023712157672357012053 0ustar 0001-fix-default-encoding.patch 0002-Remove-git-ls-files-call-in-gemspec.patch 0003-Build-with-system-libhttp-parser.patch 0004-Do-not-overload-loadpath.patch debian/ruby-http-parser.rb-doc.doc-base0000644000000000000000000000077112157451127015174 0ustar Document: ruby-http-parser.rb-doc Title: Debian ruby-http-parser.rb manual Author: Aman Gupta, Marc-André Cournoyer Abstract: Simple callback-based HTTP request/response parser A simple callback-based HTTP request/response parser for writing http servers, clients and proxies. . It is built on top of Joyent's libhttp-parser and it's Java port. Section: Programming/Ruby Format: HTML Index: /usr/share/doc/ruby-http-parser.rb-doc/html/index.html Files: /usr/share/doc/ruby-http-parser.rb-doc/html/* debian/changelog0000644000000000000000000000025312157701104011036 0ustar ruby-http-parser.rb (0.6.0~beta.2-1) unstable; urgency=low * Initial release (Closes: #711595) -- Per Andersson Mon, 17 Jun 2013 23:40:17 +0200 debian/rules0000755000000000000000000000226412157701006010251 0ustar #!/usr/bin/make -f #export DH_VERBOSE=1 # # Uncomment to ignore all test failures (but the tests will run anyway) #export DH_RUBY_IGNORE_TESTS=all # # Uncomment to ignore some test failures (but the tests will run anyway). # Valid values: #export DH_RUBY_IGNORE_TESTS=ruby1.8 ruby1.9.1 require-rubygems # # If you need to specify the .gemspec (eg there is more than one) #export DH_RUBY_GEMSPEC=gem.gemspec BINARY_PKG := ruby-http-parser.rb %: dh $@ --buildsystem=ruby --with ruby override_dh_auto_clean: dh_auto_clean rm -rf doc override_dh_auto_build: dh_auto_build # build documentation rdoc --main=README.md lib rm -f doc/js/jquery.js override_dh_auto_install: # use utf-8 locale so test cases work LC_ALL=C.UTF-8 dh_auto_install override_dh_install: # install docs dh_install --package=$(BINARY_PKG)-doc doc/* \ usr/share/doc/$(BINARY_PKG)-doc/html/ override_dh_link: # link to jquery.js dh_link --package=$(BINARY_PKG)-doc usr/share/javascript/jquery/jquery.js \ usr/share/doc/$(BINARY_PKG)-doc/html/js/jquery.js override_dh_compress: # binary package ends with .rb, and, due to dh sequencer -X.rb nothing is # compressed, hence, call dh_compress manually dh_compress debian/watch0000644000000000000000000000012312157451074010221 0ustar version=3 http://githubredir.debian.net/github/tmm1/http_parser.rb/ v(.*)\.tar\.gz debian/source/0000755000000000000000000000000012156432725010475 5ustar debian/source/format0000644000000000000000000000001412156432725011703 0ustar 3.0 (quilt) debian/ruby-http-parser.rb.docs0000644000000000000000000000001212156432725013672 0ustar README.md debian/ruby-tests.rake0000644000000000000000000000020012157672357012162 0ustar require "rspec/core/rake_task" RSpec::Core::RakeTask.new(:spec) do |t| t.rspec_opts = %w(-fs -c) end task :default => :spec debian/compat0000644000000000000000000000000212156432725010373 0ustar 7