biryani 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/lib/biryani/connection.rb +5 -6
  3. data/lib/biryani/data_buffer.rb +1 -1
  4. data/lib/biryani/frame/continuation.rb +4 -7
  5. data/lib/biryani/frame/data.rb +9 -12
  6. data/lib/biryani/frame/goaway.rb +6 -6
  7. data/lib/biryani/frame/headers.rb +25 -18
  8. data/lib/biryani/frame/ping.rb +5 -7
  9. data/lib/biryani/frame/priority.rb +6 -5
  10. data/lib/biryani/frame/push_promise.rb +14 -15
  11. data/lib/biryani/frame/rst_stream.rb +5 -5
  12. data/lib/biryani/frame/settings.rb +5 -5
  13. data/lib/biryani/frame/unknown.rb +0 -12
  14. data/lib/biryani/frame/window_update.rb +5 -5
  15. data/lib/biryani/frame.rb +5 -4
  16. data/lib/biryani/hpack/field.rb +42 -42
  17. data/lib/biryani/hpack/fields.rb +2 -1
  18. data/lib/biryani/hpack/huffman.rb +290 -21
  19. data/lib/biryani/hpack/integer.rb +10 -6
  20. data/lib/biryani/hpack/string.rb +6 -6
  21. data/lib/biryani/http_request.rb +1 -1
  22. data/lib/biryani/state.rb +2 -0
  23. data/lib/biryani/streams_context.rb +7 -7
  24. data/lib/biryani/version.rb +1 -1
  25. data/lib/biryani.rb +0 -1
  26. data/spec/connection/handle_data_spec.rb +2 -2
  27. data/spec/connection/handle_headers_spec.rb +1 -1
  28. data/spec/frame/continuation_spec.rb +2 -2
  29. data/spec/frame/data_spec.rb +1 -1
  30. data/spec/frame/goaway_spec.rb +1 -1
  31. data/spec/frame/headers_spec.rb +2 -2
  32. data/spec/frame/ping_spec.rb +1 -1
  33. data/spec/frame/priority_spec.rb +1 -1
  34. data/spec/frame/push_promise_spec.rb +1 -1
  35. data/spec/frame/rst_stream_spec.rb +1 -1
  36. data/spec/frame/settings_spec.rb +1 -1
  37. data/spec/frame/window_update_spec.rb +1 -1
  38. data/spec/hpack/field_spec.rb +10 -9
  39. data/spec/hpack/huffman_spec.rb +4 -4
  40. data/spec/hpack/integer_spec.rb +5 -5
  41. data/spec/hpack/string_spec.rb +2 -2
  42. metadata +1 -1
@@ -8,13 +8,13 @@ RSpec.describe HPACK::Huffman do
8
8
  end
9
9
 
10
10
  it 'should decode' do
11
- expect(HPACK::Huffman.decode("\xf1\xe3\xc2\xe5\xf2\x3a\x6b\xa0\xab\x90\xf4\xff".b)).to eq 'www.example.com'
12
- expect(HPACK::Huffman.decode("\xa8\xeb\x10\x64\x9c\xbf".b)).to eq 'no-cache'
11
+ expect(HPACK::Huffman.decode(IO::Buffer.for("\xf1\xe3\xc2\xe5\xf2\x3a\x6b\xa0\xab\x90\xf4\xff".b), 0, 12)).to eq 'www.example.com'
12
+ expect(HPACK::Huffman.decode(IO::Buffer.for("\xa8\xeb\x10\x64\x9c\xbf".b), 0, 6)).to eq 'no-cache'
13
13
  end
14
14
 
15
15
  it 'should not decode' do
16
- expect { HPACK::Huffman.decode("\xff\xff\xff\xff".b) }.to raise_error HPACK::Error::HuffmanDecodeError
17
- expect { HPACK::Huffman.decode("\xf8\xff".b) }.to raise_error HPACK::Error::HuffmanDecodeError
16
+ expect { HPACK::Huffman.decode(IO::Buffer.for("\xff\xff\xff\xff".b), 0, 4) }.to raise_error HPACK::Error::HuffmanDecodeError
17
+ expect { HPACK::Huffman.decode(IO::Buffer.for("\xf8\xff".b), 0, 2) }.to raise_error HPACK::Error::HuffmanDecodeError
18
18
  end
19
19
  end
20
20
  end
@@ -17,11 +17,11 @@ RSpec.describe HPACK::Integer do
17
17
  end
18
18
 
19
19
  it 'should decode' do
20
- expect(HPACK::Integer.decode("\x0a".b, 5, cursor)).to eq [10, 1]
21
- expect(HPACK::Integer.decode("\x1f\x9a\x0a".b, 5, cursor)).to eq [1337, 3]
22
- expect(HPACK::Integer.decode("\x2a".b, 8, cursor)).to eq [42, 1]
23
- expect(HPACK::Integer.decode("\x8a".b, 5, cursor)).to eq [10, 1]
24
- expect(HPACK::Integer.decode("\x0a\x0b".b, 5, 1)).to eq [11, 2]
20
+ expect(HPACK::Integer.decode(IO::Buffer.for("\x0a".b), 5, cursor)).to eq [10, 1]
21
+ expect(HPACK::Integer.decode(IO::Buffer.for("\x1f\x9a\x0a".b), 5, cursor)).to eq [1337, 3]
22
+ expect(HPACK::Integer.decode(IO::Buffer.for("\x2a".b), 8, cursor)).to eq [42, 1]
23
+ expect(HPACK::Integer.decode(IO::Buffer.for("\x8a".b), 5, cursor)).to eq [10, 1]
24
+ expect(HPACK::Integer.decode(IO::Buffer.for("\x0a\x0b".b), 5, 1)).to eq [11, 2]
25
25
  end
26
26
  end
27
27
  end
@@ -12,8 +12,8 @@ RSpec.describe HPACK::String do
12
12
  end
13
13
 
14
14
  it 'should decode' do
15
- expect(HPACK::String.decode("\x88\x25\xa8\x49\xe9\x5b\xa9\x7d\x7f".b, cursor)).to eq ['custom-key', 9]
16
- expect(HPACK::String.decode("\x01\x5c".b, cursor)).to eq ['\\', 2]
15
+ expect(HPACK::String.decode(IO::Buffer.for("\x88\x25\xa8\x49\xe9\x5b\xa9\x7d\x7f".b), cursor)).to eq ['custom-key', 9]
16
+ expect(HPACK::String.decode(IO::Buffer.for("\x01\x5c".b), cursor)).to eq ['\\', 2]
17
17
  end
18
18
  end
19
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: biryani
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - thekuwayama