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

stdlib: Separate types for net-protocol from net-http module #1559

Merged
merged 1 commit into from
Oct 30, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stdlib/net-http/0/manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dependencies:
- name: net-protocol
- name: uri
- name: timeout
49 changes: 0 additions & 49 deletions stdlib/net-http/0/net-http.rbs
Original file line number Diff line number Diff line change
@@ -1,59 +1,10 @@
module Net
class Protocol
VERSION: String
end

class ProtocolError < StandardError
end

class ProtoSyntaxError < ProtocolError
end

class ProtoFatalError < ProtocolError
end

class ProtoUnknownError < ProtocolError
end

class ProtoServerError < ProtocolError
end

class ProtoAuthError < ProtocolError
end

class ProtoCommandError < ProtocolError
end

class ProtoRetriableError < ProtocolError
end

class HTTPBadResponse < StandardError
end

class HTTPHeaderSyntaxError < StandardError
end

# <!-- rdoc-file=lib/net/protocol.rb -->
# OpenTimeout, a subclass of Timeout::Error, is raised if a connection cannot be
# created within the open_timeout.
#
class OpenTimeout < Timeout::Error
end

# <!-- rdoc-file=lib/net/protocol.rb -->
# ReadTimeout, a subclass of Timeout::Error, is raised if a chunk of the
# response cannot be read within the read_timeout.
#
class ReadTimeout < Timeout::Error
end

# <!-- rdoc-file=lib/net/protocol.rb -->
# WriteTimeout, a subclass of Timeout::Error, is raised if a chunk of the
# response cannot be written within the write_timeout. Not raised on Windows.
#
class WriteTimeout < Timeout::Error
end

# <!-- rdoc-file=lib/net/http.rb -->
# Class Net::HTTP provides a rich library that implements the client in a
# client-server model that uses the HTTP request-response protocol. For
Expand Down
2 changes: 2 additions & 0 deletions stdlib/net-protocol/0/manifest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dependencies:
- name: timeout
56 changes: 56 additions & 0 deletions stdlib/net-protocol/0/net-protocol.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
module Net
class Protocol
VERSION: String
end

class ProtocolError < StandardError
end

class ProtoSyntaxError < ProtocolError
end

class ProtoFatalError < ProtocolError
end

class ProtoUnknownError < ProtocolError
end

class ProtoServerError < ProtocolError
end

class ProtoAuthError < ProtocolError
end

class ProtoCommandError < ProtocolError
end

class ProtoRetriableError < ProtocolError
end

class HTTPBadResponse < StandardError
end

class HTTPHeaderSyntaxError < StandardError
end

# <!-- rdoc-file=lib/net/protocol.rb -->
# OpenTimeout, a subclass of Timeout::Error, is raised if a connection cannot be
# created within the open_timeout.
#
class OpenTimeout < Timeout::Error
end

# <!-- rdoc-file=lib/net/protocol.rb -->
# ReadTimeout, a subclass of Timeout::Error, is raised if a chunk of the
# response cannot be read within the read_timeout.
#
class ReadTimeout < Timeout::Error
end

# <!-- rdoc-file=lib/net/protocol.rb -->
# WriteTimeout, a subclass of Timeout::Error, is raised if a chunk of the
# response cannot be written within the write_timeout. Not raised on Windows.
#
class WriteTimeout < Timeout::Error
end
end