Skip to content

Commit

Permalink
Fix type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ursm committed Dec 31, 2024
1 parent 18f5079 commit 11f0033
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 11 deletions.
15 changes: 8 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ PATH
GEM
remote: https://rubygems.org/
specs:
activesupport (7.2.2.1)
activesupport (8.0.1)
base64
benchmark (>= 0.3)
bigdecimal
Expand All @@ -24,18 +24,19 @@ GEM
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
ast (2.4.2)
base64 (0.2.0)
benchmark (0.4.0)
bigdecimal (3.1.8)
bigdecimal (3.1.9)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
csv (3.3.0)
csv (3.3.2)
diff-lcs (1.5.1)
drb (2.2.1)
ffi (1.17.1)
ffi (1.17.1-x86_64-linux-gnu)
fileutils (1.7.2)
fileutils (1.7.3)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
json (2.9.1)
Expand All @@ -48,7 +49,7 @@ GEM
minitest (5.25.4)
net-http (0.6.0)
uri
parser (3.3.5.0)
parser (3.3.6.0)
ast (~> 2.4.1)
racc
racc (1.8.1)
Expand All @@ -75,7 +76,7 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
securerandom (0.4.0)
securerandom (0.4.1)
singleton (0.3.0)
steep (1.9.3)
activesupport (>= 5.1)
Expand All @@ -93,7 +94,7 @@ GEM
strscan (>= 1.0.0)
terminal-table (>= 2, < 4)
uri (>= 0.12.0)
strscan (3.1.0)
strscan (3.1.2)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
tzinfo (2.0.6)
Expand Down
2 changes: 1 addition & 1 deletion lib/fetch/headers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def keys
end

def set(key, value)
@data[key.to_s.downcase] = [value]
@data[key.to_s.downcase] = [value.to_s]
end

def values
Expand Down
4 changes: 2 additions & 2 deletions lib/fetch/multi_map.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def values
@entries.map(&:last)
end

def each(&)
@entries.each(&)
def each(&block)
block ? @entries.each(&block) : @entries.each
end

private
Expand Down
2 changes: 2 additions & 0 deletions sig/fetch/client.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ module Fetch
class Client
include Singleton

def self.instance: () -> Client

def fetch: (
string,
method: String | Symbol,
Expand Down
2 changes: 2 additions & 0 deletions sig/fetch/connection_pool.rbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module Fetch
class ConnectionPool
@connections: Hash[String, [Net::HTTP, Time]]

def initialize: () -> void
def with_connection: [T] (URI::HTTP) { (Net::HTTP) -> T } -> T

Expand Down
2 changes: 2 additions & 0 deletions sig/fetch/headers.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ module Fetch
class Headers
include Enumerable[[String, String]]

@data: Hash[String, Array[String]]

def initialize: (_Each[[_ToS, _ToS]]) -> void
def append: (_ToS, _ToS) -> void
def delete: (_ToS) -> void
Expand Down
4 changes: 3 additions & 1 deletion sig/fetch/multi_map.rbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
module Fetch
class MultiMap[KIN, KOUT, VIN, VOUT]
class MultiMap[KIN, KOUT < Comparable, VIN, VOUT]
include Enumerable[[KOUT, VOUT]]

@entries: Array[[KOUT, VOUT]]

def initialize: () -> void
def append: (KIN, VIN) -> void
def delete: (KIN) -> void
Expand Down

0 comments on commit 11f0033

Please sign in to comment.