rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / code / Atom feed
* [PATCH] webrick: remove concurrent-ruby dev dependency
@ 2017-12-29  6:34 Eric Wong
  2017-12-29  7:25 ` James Tucker
  2018-01-03 20:01 ` Rafael Mendonça França
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Wong @ 2017-12-29  6:34 UTC (permalink / raw)
  To: rack-devel

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] webrick: remove concurrent-ruby dev dependency
  2017-12-29  6:34 [PATCH] webrick: remove concurrent-ruby dev dependency Eric Wong
@ 2017-12-29  7:25 ` James Tucker
  2018-01-03 20:01 ` Rafael Mendonça França
  1 sibling, 0 replies; 3+ messages in thread
From: James Tucker @ 2017-12-29  7:25 UTC (permalink / raw)
  To: Rack Development

[-- Attachment #1: Type: text/plain, Size: 3177 bytes --]

+1

On Dec 28, 2017 10:34 PM, "Eric Wong" <e@80x24.org> wrote:

> 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 ab008307cbb805585449145966989d
> 5274fbe1e4:
>
>     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.
>

-- 

--- 
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.

[-- Attachment #2: Type: text/html, Size: 4403 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] webrick: remove concurrent-ruby dev dependency
  2017-12-29  6:34 [PATCH] webrick: remove concurrent-ruby dev dependency Eric Wong
  2017-12-29  7:25 ` James Tucker
@ 2018-01-03 20:01 ` Rafael Mendonça França
  1 sibling, 0 replies; 3+ messages in thread
From: Rafael Mendonça França @ 2018-01-03 20:01 UTC (permalink / raw)
  To: Rack Development


[-- Attachment #1.1: Type: text/plain, Size: 3044 bytes --]

Thank you Eric. This patch was applied at 
2e92a25342b5d51f4094366c3b8dd797cbd208a4.

On Friday, December 29, 2017 at 1:34:30 AM UTC-5, Eric Wong wrote:
>
> 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.

[-- Attachment #1.2: Type: text/html, Size: 4415 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-03 20:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-29  6:34 [PATCH] webrick: remove concurrent-ruby dev dependency Eric Wong
2017-12-29  7:25 ` James Tucker
2018-01-03 20:01 ` Rafael Mendonça França

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

	https://80x24.org/mirrors/rack.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).