yahns Ruby server user/dev discussion
 help / color / Atom feed
From: Eric Wong <e@80x24.org>
To: yahns-public@yhbt.net
Subject: [PATCH] fix some unused variables
Date: Wed, 15 Nov 2017 00:08:55 +0000
Message-ID: <20171115000855.31674-1-e@80x24.org> (raw)

Current (tested r60757) ruby trunk warns in a few more places than
2.4.x did, so clean them up.
---
 extras/autoindex.rb    | 4 ++--
 test/test_mt_accept.rb | 2 --
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/extras/autoindex.rb b/extras/autoindex.rb
index 238edd9..45b80cf 100644
--- a/extras/autoindex.rb
+++ b/extras/autoindex.rb
@@ -56,7 +56,7 @@ def call(env)
     case env["REQUEST_METHOD"]
     when "GET", "HEAD"
       # try to serve the static file, first
-      status, headers, body = res = @app.call(env)
+      status, _, body = res = @app.call(env)
       return res if status.to_i != 404
 
       path_info = env["PATH_INFO"]
@@ -78,7 +78,7 @@ def call(env)
       tryenv = env.dup
       @index.each do |base|
         tryenv["PATH_INFO"] = "#{path_info}#{base}"
-        status, headers, body = res = @app.call(tryenv)
+        status, _, body = res = @app.call(tryenv)
         return res if status.to_i != 404
       end
 
diff --git a/test/test_mt_accept.rb b/test/test_mt_accept.rb
index aa2867f..321d46c 100644
--- a/test/test_mt_accept.rb
+++ b/test/test_mt_accept.rb
@@ -14,7 +14,6 @@ def test_mt_accept
     skip "Linux kernel required" unless RUBY_PLATFORM =~ /linux/
     skip "/proc not mounted" unless File.directory?("/proc")
     err, cfg, host, port = @err, Yahns::Config.new, @srv.addr[3], @srv.addr[1]
-    opts = { threads: 1 }
     cfg.instance_eval do
       GTL.synchronize do
         app(:rack, Rack::Lobster.new) { listen "#{host}:#{port}", threads: 1 }
@@ -29,7 +28,6 @@ def test_mt_accept
     quit_wait(pid)
 
     cfg = Yahns::Config.new
-    opts = { threads: 1 }
     cfg.instance_eval do
       GTL.synchronize do
         app(:rack, Rack::Lobster.new) { listen "#{host}:#{port}", threads: 2 }
-- 
EW


                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://yhbt.net/yahns/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171115000855.31674-1-e@80x24.org \
    --to=e@80x24.org \
    --cc=yahns-public@yhbt.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

yahns Ruby server user/dev discussion

Archives are clonable:
	git clone --mirror https://yhbt.net/yahns-public
	git clone --mirror http://ou63pmih66umazou.onion/yahns-public

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.lang.ruby.yahns
	nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.yahns

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git