patron 0.13.4 → 1.0.0

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 (52) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +97 -0
  3. data/README.md +113 -50
  4. data/ext/patron/extconf.rb +55 -20
  5. data/ext/patron/session_ext.c +1092 -761
  6. data/lib/patron/compat.rb +57 -0
  7. data/lib/patron/error.rb +25 -13
  8. data/lib/patron/header_parser.rb +27 -25
  9. data/lib/patron/request.rb +98 -142
  10. data/lib/patron/response.rb +33 -24
  11. data/lib/patron/response_decoding.rb +60 -67
  12. data/lib/patron/session.rb +127 -104
  13. data/lib/patron/util.rb +14 -12
  14. data/lib/patron/version.rb +3 -1
  15. data/lib/patron.rb +9 -15
  16. metadata +12 -49
  17. data/.autotest +0 -15
  18. data/.github/workflows/ci.yml +0 -26
  19. data/.gitignore +0 -10
  20. data/.rspec +0 -0
  21. data/.travis.yml +0 -13
  22. data/.yardopts +0 -1
  23. data/Gemfile +0 -17
  24. data/Rakefile +0 -31
  25. data/ext/patron/.gitignore +0 -4
  26. data/ext/patron/membuffer.c +0 -85
  27. data/ext/patron/membuffer.h +0 -78
  28. data/ext/patron/sglib.h +0 -1952
  29. data/lib/patron/proxy_type.rb +0 -11
  30. data/patron.gemspec +0 -38
  31. data/pic.png +0 -0
  32. data/script/console +0 -11
  33. data/script/test_server +0 -7
  34. data/spec/header_parser_spec.rb +0 -101
  35. data/spec/patron_spec.rb +0 -28
  36. data/spec/request_spec.rb +0 -77
  37. data/spec/response_spec.rb +0 -145
  38. data/spec/sample_response_headers/headers_wetransfer.txt +0 -18
  39. data/spec/sample_response_headers/headers_wetransfer_with_proxy_status.txt +0 -20
  40. data/spec/sample_response_headers/headers_wetransfer_with_redirect.txt +0 -24
  41. data/spec/sample_response_headers/headers_with_set_cookie.txt +0 -9
  42. data/spec/sample_response_headers/sample_http2_header.txt +0 -16
  43. data/spec/sample_response_headers/webmock_headers_without_trailing_crlf.txt +0 -15
  44. data/spec/session_spec.rb +0 -698
  45. data/spec/session_ssl_spec.rb +0 -313
  46. data/spec/spec_helper.rb +0 -34
  47. data/spec/support/certs/cacert.pem +0 -36
  48. data/spec/support/certs/privkey.pem +0 -51
  49. data/spec/support/config.ru +0 -146
  50. data/spec/support/fork.rb +0 -70
  51. data/spec/support/test_server.rb +0 -26
  52. data/spec/util_spec.rb +0 -71
data/spec/util_spec.rb DELETED
@@ -1,71 +0,0 @@
1
- require File.expand_path("./spec") + '/spec_helper.rb'
2
-
3
- describe Patron::Util do
4
-
5
- describe :build_query_pairs_from_hash do
6
-
7
- it "correctly serializes a simple hash" do
8
- hash = {:foo => "bar", "baz" => 42}
9
- array = Patron::Util.build_query_pairs_from_hash(hash)
10
- expect(array.size).to be == 2
11
- expect(array).to include("foo=bar")
12
- expect(array).to include("baz=42")
13
- end
14
-
15
- it "correctly serializes a more complex hash" do
16
- hash = {
17
- :foo => "bar",
18
- :baz => {
19
- "quux" => {
20
- :zing => {
21
- :ying => 42
22
- }
23
- },
24
- :blargh => {
25
- :spaz => "sox",
26
- :razz => "matazz"
27
- }
28
- }
29
- }
30
- array = Patron::Util.build_query_pairs_from_hash(hash)
31
- expect(array.size).to be == 4
32
- expect(array).to include("foo=bar")
33
- expect(array).to include("baz[quux][zing][ying]=42")
34
- expect(array).to include("baz[blargh][spaz]=sox")
35
- expect(array).to include("baz[blargh][razz]=matazz")
36
- end
37
- end
38
-
39
- describe :build_query_string_from_hash do
40
- it "correctly serializes a simple hash" do
41
- hash = {:foo => "bar", "baz" => 42}
42
- array = Patron::Util.build_query_string_from_hash(hash).split('&')
43
- expect(array.size).to be == 2
44
- expect(array).to include("foo=bar")
45
- expect(array).to include("baz=42")
46
- end
47
- it "correctly serializes a more complex hash" do
48
- hash = {
49
- :foo => "bar",
50
- :baz => {
51
- "quux" => {
52
- :zing => {
53
- :ying => 42
54
- }
55
- },
56
- :blargh => {
57
- :spaz => "sox",
58
- :razz => "matazz"
59
- }
60
- }
61
- }
62
- array = Patron::Util.build_query_string_from_hash(hash).split('&')
63
- expect(array.size).to be == 4
64
- expect(array).to include("foo=bar")
65
- expect(array).to include("baz[quux][zing][ying]=42")
66
- expect(array).to include("baz[blargh][spaz]=sox")
67
- expect(array).to include("baz[blargh][razz]=matazz")
68
- end
69
- end
70
-
71
- end