http-2 0.11.0 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -2
  3. data/lib/http/2/buffer.rb +6 -4
  4. data/lib/http/2/client.rb +5 -1
  5. data/lib/http/2/compressor.rb +42 -34
  6. data/lib/http/2/connection.rb +72 -86
  7. data/lib/http/2/emitter.rb +4 -1
  8. data/lib/http/2/error.rb +2 -0
  9. data/lib/http/2/flow_buffer.rb +8 -3
  10. data/lib/http/2/framer.rb +83 -94
  11. data/lib/http/2/huffman.rb +19 -17
  12. data/lib/http/2/server.rb +9 -7
  13. data/lib/http/2/stream.rb +48 -48
  14. data/lib/http/2/version.rb +3 -1
  15. data/lib/http/2.rb +2 -0
  16. metadata +7 -60
  17. data/.autotest +0 -20
  18. data/.coveralls.yml +0 -1
  19. data/.gitignore +0 -20
  20. data/.gitmodules +0 -3
  21. data/.rspec +0 -5
  22. data/.rubocop.yml +0 -93
  23. data/.rubocop_todo.yml +0 -131
  24. data/.travis.yml +0 -17
  25. data/Gemfile +0 -16
  26. data/Guardfile +0 -18
  27. data/Guardfile.h2spec +0 -12
  28. data/Rakefile +0 -49
  29. data/example/Gemfile +0 -3
  30. data/example/README.md +0 -44
  31. data/example/client.rb +0 -122
  32. data/example/helper.rb +0 -19
  33. data/example/keys/server.crt +0 -20
  34. data/example/keys/server.key +0 -27
  35. data/example/server.rb +0 -139
  36. data/example/upgrade_client.rb +0 -153
  37. data/example/upgrade_server.rb +0 -203
  38. data/http-2.gemspec +0 -22
  39. data/lib/tasks/generate_huffman_table.rb +0 -166
  40. data/spec/buffer_spec.rb +0 -28
  41. data/spec/client_spec.rb +0 -188
  42. data/spec/compressor_spec.rb +0 -666
  43. data/spec/connection_spec.rb +0 -681
  44. data/spec/emitter_spec.rb +0 -54
  45. data/spec/framer_spec.rb +0 -487
  46. data/spec/h2spec/h2spec.darwin +0 -0
  47. data/spec/h2spec/output/non_secure.txt +0 -317
  48. data/spec/helper.rb +0 -147
  49. data/spec/hpack_test_spec.rb +0 -84
  50. data/spec/huffman_spec.rb +0 -68
  51. data/spec/server_spec.rb +0 -52
  52. data/spec/stream_spec.rb +0 -878
  53. data/spec/support/deep_dup.rb +0 -55
  54. data/spec/support/duplicable.rb +0 -98
@@ -1,55 +0,0 @@
1
- # https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/object/deep_dup.rb
2
-
3
- require_relative 'duplicable'
4
-
5
- class Object
6
- # Returns a deep copy of object if it's duplicable. If it's
7
- # not duplicable, returns +self+.
8
- #
9
- # object = Object.new
10
- # dup = object.deep_dup
11
- # dup.instance_variable_set(:@a, 1)
12
- #
13
- # object.instance_variable_defined?(:@a) # => false
14
- # dup.instance_variable_defined?(:@a) # => true
15
- def deep_dup
16
- duplicable? ? dup : self
17
- end
18
- end
19
-
20
- class Array
21
- # Returns a deep copy of array.
22
- #
23
- # array = [1, [2, 3]]
24
- # dup = array.deep_dup
25
- # dup[1][2] = 4
26
- #
27
- # array[1][2] # => nil
28
- # dup[1][2] # => 4
29
- def deep_dup
30
- map(&:deep_dup)
31
- end
32
- end
33
-
34
- class Hash
35
- # Returns a deep copy of hash.
36
- #
37
- # hash = { a: { b: 'b' } }
38
- # dup = hash.deep_dup
39
- # dup[:a][:c] = 'c'
40
- #
41
- # hash[:a][:c] # => nil
42
- # dup[:a][:c] # => "c"
43
- def deep_dup
44
- hash = dup
45
- each_pair do |key, value|
46
- if key.frozen? && ::String == key # changed === to == for rubocop
47
- hash[key] = value.deep_dup
48
- else
49
- hash.delete(key)
50
- hash[key.deep_dup] = value.deep_dup
51
- end
52
- end
53
- hash
54
- end
55
- end
@@ -1,98 +0,0 @@
1
- #--
2
- # Most objects are cloneable, but not all. For example you can't dup +nil+:
3
- #
4
- # nil.dup # => TypeError: can't dup NilClass
5
- #
6
- # Classes may signal their instances are not duplicable removing +dup+/+clone+
7
- # or raising exceptions from them. So, to dup an arbitrary object you normally
8
- # use an optimistic approach and are ready to catch an exception, say:
9
- #
10
- # arbitrary_object.dup rescue object
11
- #
12
- # Rails dups objects in a few critical spots where they are not that arbitrary.
13
- # That rescue is very expensive (like 40 times slower than a predicate), and it
14
- # is often triggered.
15
- #
16
- # That's why we hardcode the following cases and check duplicable? instead of
17
- # using that rescue idiom.
18
- #++
19
- class Object
20
- # Can you safely dup this object?
21
- #
22
- # False for +nil+, +false+, +true+, symbol, number, method objects;
23
- # true otherwise.
24
- def duplicable?
25
- true
26
- end
27
- end
28
-
29
- class NilClass
30
- # +nil+ is not duplicable:
31
- #
32
- # nil.duplicable? # => false
33
- # nil.dup # => TypeError: can't dup NilClass
34
- def duplicable?
35
- false
36
- end
37
- end
38
-
39
- class FalseClass
40
- # +false+ is not duplicable:
41
- #
42
- # false.duplicable? # => false
43
- # false.dup # => TypeError: can't dup FalseClass
44
- def duplicable?
45
- false
46
- end
47
- end
48
-
49
- class TrueClass
50
- # +true+ is not duplicable:
51
- #
52
- # true.duplicable? # => false
53
- # true.dup # => TypeError: can't dup TrueClass
54
- def duplicable?
55
- false
56
- end
57
- end
58
-
59
- class Symbol
60
- # Symbols are not duplicable:
61
- #
62
- # :my_symbol.duplicable? # => false
63
- # :my_symbol.dup # => TypeError: can't dup Symbol
64
- def duplicable?
65
- false
66
- end
67
- end
68
-
69
- class Numeric
70
- # Numbers are not duplicable:
71
- #
72
- # 3.duplicable? # => false
73
- # 3.dup # => TypeError: can't dup Integer
74
- def duplicable?
75
- false
76
- end
77
- end
78
-
79
- require 'bigdecimal'
80
- class BigDecimal
81
- # BigDecimals are duplicable:
82
- #
83
- # BigDecimal.new("1.2").duplicable? # => true
84
- # BigDecimal.new("1.2").dup # => #<BigDecimal:...,'0.12E1',18(18)>
85
- def duplicable?
86
- true
87
- end
88
- end
89
-
90
- class Method
91
- # Methods are not duplicable:
92
- #
93
- # method(:puts).duplicable? # => false
94
- # method(:puts).dup # => TypeError: allocator undefined for Method
95
- def duplicable?
96
- false
97
- end
98
- end