yahns Ruby server user/dev discussion
 help / color / mirror / code / Atom feed
* [PATCH] fix some unused variables
@ 2017-11-15  0:08 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2017-11-15  0:08 UTC (permalink / raw)
  To: yahns-public

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-11-15  0:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-15  0:08 [PATCH] fix some unused variables Eric Wong

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

	https://yhbt.net/yahns.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).