rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: rack-devel@googlegroups.com
Subject: [PATCH] webrick: remove concurrent-ruby dev dependency
Date: Fri, 29 Dec 2017 06:34:27 +0000	[thread overview]
Message-ID: <20171229063427.GA30037@starla> (raw)

Using the Queue class in stdlib is sufficient for this test,
so there's no need for a new development dependency.

And one big reason I like webrick is it's bundled with
Ruby and has no 3rd-party C ext dependencies; so having
to download and install one is a bummer.
---
  If you prefer to use "git pull":

  The following changes since commit ab008307cbb805585449145966989d5274fbe1e4:

    Add test to make sure `Rack::Builder#call` always create a new app (2017-11-06 23:27:12 -0500)

  are available in the Git repository at:

    git://80x24.org/rack.git webrick-devdep

  for you to fetch changes up to 64349662ac18f52849cc215494d77e3719dfa2a7:

    webrick: remove concurrent-ruby dev dependency (2017-12-29 06:25:29 +0000)

  ----------------------------------------------------------------
  Eric Wong (1):
        webrick: remove concurrent-ruby dev dependency

   rack.gemspec         |  1 -
   test/spec_webrick.rb | 11 +++++------
   2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/rack.gemspec b/rack.gemspec
index ec2b79f6..d8374287 100644
--- a/rack.gemspec
+++ b/rack.gemspec
@@ -30,6 +30,5 @@ EOF
 
   s.add_development_dependency 'minitest', "~> 5.0"
   s.add_development_dependency 'minitest-sprint'
-  s.add_development_dependency 'concurrent-ruby'
   s.add_development_dependency 'rake'
 end
diff --git a/test/spec_webrick.rb b/test/spec_webrick.rb
index e3050f6f..855fa9eb 100644
--- a/test/spec_webrick.rb
+++ b/test/spec_webrick.rb
@@ -1,6 +1,6 @@
 require 'minitest/autorun'
 require 'rack/mock'
-require 'concurrent/atomic/event'
+require 'thread'
 require File.expand_path('../testrequest', __FILE__)
 
 Thread.abort_on_exception = true
@@ -119,7 +119,7 @@ describe Rack::Handler::WEBrick do
   end
 
   it "provide a .run" do
-    latch = Concurrent::Event.new
+    queue = Queue.new
 
     t = Thread.new do
       Rack::Handler::WEBrick.run(lambda {},
@@ -129,13 +129,12 @@ describe Rack::Handler::WEBrick do
                                    :Logger => WEBrick::Log.new(nil, WEBrick::BasicLog::WARN),
                                    :AccessLog => []}) { |server|
         assert_kind_of WEBrick::HTTPServer, server
-        @s = server
-        latch.set
+        queue.push(server)
       }
     end
 
-    latch.wait
-    @s.shutdown
+    server = queue.pop
+    server.shutdown
     t.join
   end
 
-- 
EW

-- 

--- 
You received this message because you are subscribed to the Google Groups "Rack Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rack-devel+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

             reply	other threads:[~2017-12-29  6:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-29  6:34 Eric Wong [this message]
2017-12-29  7:25 ` [PATCH] webrick: remove concurrent-ruby dev dependency James Tucker
2018-01-03 20:01 ` Rafael Mendonça França

Reply instructions:

You may reply publicly 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-list from there: mbox

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

  List information: https://groups.google.com/group/rack-devel

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

  git send-email \
    --in-reply-to=20171229063427.GA30037@starla \
    --to=rack-devel@googlegroups.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).