Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Puma::Delegation [changelog skip] #2000

Merged
merged 2 commits into from Oct 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/puma/client.rb
Expand Up @@ -9,8 +9,8 @@ module WaitReadable
end

require 'puma/detect'
require 'puma/delegation'
require 'tempfile'
require 'forwardable'

if Puma::IS_JRUBY
# We have to work around some OpenSSL buffer/io-readiness bugs
Expand Down Expand Up @@ -41,7 +41,7 @@ class Client
EmptyBody = NullIO.new

include Puma::Const
extend Puma::Delegation
extend Forwardable

def initialize(io, env=nil)
@io = io
Expand Down Expand Up @@ -83,7 +83,7 @@ def initialize(io, env=nil)

attr_accessor :remote_addr_header

forward :closed?, :@io
def_delegators :@io, :closed?

def inspect
"#<Puma::Client:0x#{object_id.to_s(16)} @ready=#{@ready.inspect}>"
Expand Down
13 changes: 0 additions & 13 deletions lib/puma/delegation.rb

This file was deleted.

9 changes: 3 additions & 6 deletions lib/puma/server.rb
Expand Up @@ -9,13 +9,13 @@
require 'puma/reactor'
require 'puma/client'
require 'puma/binder'
require 'puma/delegation'
require 'puma/accept_nonblock'
require 'puma/util'

require 'puma/puma_http11'

require 'socket'
require 'forwardable'

module Puma

Expand All @@ -32,7 +32,7 @@ module Puma
class Server

include Puma::Const
extend Puma::Delegation
extend Forwardable

attr_reader :thread
attr_reader :events
Expand Down Expand Up @@ -89,10 +89,7 @@ def initialize(app, events=Events.stdio, options={})

attr_accessor :binder, :leak_stack_on_error, :early_hints

forward :add_tcp_listener, :@binder
forward :add_ssl_listener, :@binder
forward :add_unix_listener, :@binder
forward :connected_port, :@binder
def_delegators :@binder, :add_tcp_listener, :add_ssl_listener, :add_unix_listener, :connected_port

def inherit_binder(bind)
@binder = bind
Expand Down