diff options
Diffstat (limited to 'lib/plum')
-rw-r--r-- | lib/plum/binary_string.rb | 2 | ||||
-rw-r--r-- | lib/plum/connection.rb | 4 | ||||
-rw-r--r-- | lib/plum/frame.rb | 4 | ||||
-rw-r--r-- | lib/plum/server/http_connection.rb | 4 |
4 files changed, 7 insertions, 7 deletions
diff --git a/lib/plum/binary_string.rb b/lib/plum/binary_string.rb index 43051ef..02b417b 100644 --- a/lib/plum/binary_string.rb +++ b/lib/plum/binary_string.rb @@ -66,7 +66,7 @@ module Plum end else Enumerator.new do |y| - each_byteslice(n) {|ss| y << ss } + each_byteslice(n) { |ss| y << ss } end # I want to write `enum_for(__method__, n)`! end diff --git a/lib/plum/connection.rb b/lib/plum/connection.rb index 0268487..0ba5989 100644 --- a/lib/plum/connection.rb +++ b/lib/plum/connection.rb @@ -26,8 +26,8 @@ module Plum def initialize(writer, local_settings = {}) @state = :open @writer = writer - @local_settings = Hash.new {|hash, key| DEFAULT_SETTINGS[key] }.merge!(local_settings) - @remote_settings = Hash.new {|hash, key| DEFAULT_SETTINGS[key] } + @local_settings = Hash.new { |hash, key| DEFAULT_SETTINGS[key] }.merge!(local_settings) + @remote_settings = Hash.new { |hash, key| DEFAULT_SETTINGS[key] } @buffer = String.new @streams = {} @hpack_decoder = HPACK::Decoder.new(@local_settings[:header_table_size]) diff --git a/lib/plum/frame.rb b/lib/plum/frame.rb index 93f0a4c..bf61629 100644 --- a/lib/plum/frame.rb +++ b/lib/plum/frame.rb @@ -116,8 +116,8 @@ module Plum def flags fs = FRAME_FLAGS[type] [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80] - .select {|v| @flags_value & v > 0 } - .map {|val| fs && fs.key(val) || ("unknown_%02x" % val).to_sym } + .select { |v| @flags_value & v > 0 } + .map { |val| fs && fs.key(val) || ("unknown_%02x" % val).to_sym } end # Sets the frame flags. diff --git a/lib/plum/server/http_connection.rb b/lib/plum/server/http_connection.rb index 0834379..b257137 100644 --- a/lib/plum/server/http_connection.rb +++ b/lib/plum/server/http_connection.rb @@ -26,7 +26,7 @@ module Plum parser = HTTP::Parser.new parser.on_headers_complete = proc { |_headers| - headers = _headers.map {|n, v| [n.downcase, v] }.to_h + headers = _headers.map { |n, v| [n.downcase, v] }.to_h } parser.on_body = proc { |chunk| body << chunk } parser.on_message_complete = proc { |env| @@ -69,7 +69,7 @@ module Plum nheaders = headers.merge({ ":method" => parser.http_method, ":path" => parser.request_url, ":authority" => headers["host"] }) - .reject {|n, v| ["connection", "http2-settings", "upgrade", "host"].include?(n) } + .reject { |n, v| ["connection", "http2-settings", "upgrade", "host"].include?(n) } stream.receive_frame Frame.headers(1, encoder.encode(nheaders), end_headers: true) stream.receive_frame Frame.data(1, body, end_stream: true) |