kcar RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [ANN] kcar 0.6.0 - bytestream to Rack response converter
@ 2015-08-04 22:33  6% Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2015-08-04 22:33 UTC (permalink / raw)
  To: ruby-talk; +Cc: kcar-public

kcar features an HTTP parser that will convert a bytestream into a
3-element array suitable for use as a Rack response.  It is IO interface
agnostic, so it may be used with HTTP streams over Unix domain sockets,
regular files, FIFOs, StringIOs as well as traditional TCP sockets.

* homepage: http://bogomips.org/kcar/
* public mailing list: kcar-public@bogomips.org
* git clone git://bogomips.org/kcar.git
* mailing list archives: http://bogomips.org/kcar-public/

Changes:

    minor cleanups

    Minor reductions to bytecode sizes, a packaging cleanup
    but nothing interesting.

    shortlog since 0.5.0:
          GIT-VERSION-GEN: fix install for non-tag versions
          parser: shorten condition statement
          add gmane archival config for slrnpull
          kcar/response: remove const optimizations for Ruby < 2.1

^ permalink raw reply	[relevance 6%]

* [PATCH] parser: shorten condition statement
@ 2015-03-16 20:15  7% Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2015-03-16 20:15 UTC (permalink / raw)
  To: kcar-public

This saves 16 bytes on x86-64 (Ruby trunk r49982)
---
 lib/kcar/parser.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/kcar/parser.rb b/lib/kcar/parser.rb
index 4dd59e2..64fb43b 100644
--- a/lib/kcar/parser.rb
+++ b/lib/kcar/parser.rb
@@ -19,7 +19,7 @@ def extract_trailers(hdr)
           value.split(/\s*,+\s*/).each do |k|
             t[k] = true
           end
-        elsif false == t.empty? && key =~ /\A(#{t.keys.join('|')})\z/i
+        elsif !t.empty? && key =~ /\A(#{t.keys.join('|')})\z/i
           k = $1
           trailers.concat(value.split(/\n+/).map! { |v| [ k, v ] })
         end
-- 
EW


^ permalink raw reply related	[relevance 7%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2015-03-16 20:15  7% [PATCH] parser: shorten condition statement Eric Wong
2015-08-04 22:33  6% [ANN] kcar 0.6.0 - bytestream to Rack response converter Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/kcar.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).