ethon 0.5.12 → 0.6.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 (66) hide show
  1. checksums.yaml +15 -0
  2. data/.gitignore +7 -0
  3. data/.rspec +3 -0
  4. data/.travis.yml +11 -0
  5. data/CHANGELOG.md +5 -0
  6. data/Gemfile +1 -1
  7. data/Guardfile +9 -0
  8. data/ethon.gemspec +26 -0
  9. data/lib/ethon/curl.rb +0 -12
  10. data/lib/ethon/curls/constants.rb +6 -22
  11. data/lib/ethon/curls/functions.rb +38 -41
  12. data/lib/ethon/curls/infos.rb +19 -0
  13. data/lib/ethon/curls/options.rb +416 -219
  14. data/lib/ethon/curls/settings.rb +1 -0
  15. data/lib/ethon/easy.rb +12 -18
  16. data/lib/ethon/easy/callbacks.rb +40 -6
  17. data/lib/ethon/easy/debug_info.rb +46 -0
  18. data/lib/ethon/easy/mirror.rb +39 -0
  19. data/lib/ethon/easy/options.rb +17 -1235
  20. data/lib/ethon/easy/queryable.rb +6 -8
  21. data/lib/ethon/easy/response_callbacks.rb +1 -1
  22. data/lib/ethon/version.rb +1 -1
  23. data/profile/benchmarks.rb +137 -0
  24. data/profile/memory_leaks.rb +113 -0
  25. data/profile/perf_spec_helper.rb +36 -0
  26. data/profile/support/memory_test_helpers.rb +75 -0
  27. data/profile/support/os_memory_leak_tracker.rb +47 -0
  28. data/profile/support/ruby_object_leak_tracker.rb +48 -0
  29. data/spec/ethon/curl_spec.rb +27 -0
  30. data/spec/ethon/easy/callbacks_spec.rb +31 -0
  31. data/spec/ethon/easy/debug_info_spec.rb +52 -0
  32. data/spec/ethon/easy/form_spec.rb +76 -0
  33. data/spec/ethon/easy/header_spec.rb +78 -0
  34. data/spec/ethon/easy/http/custom_spec.rb +176 -0
  35. data/spec/ethon/easy/http/delete_spec.rb +20 -0
  36. data/spec/ethon/easy/http/get_spec.rb +89 -0
  37. data/spec/ethon/easy/http/head_spec.rb +79 -0
  38. data/spec/ethon/easy/http/options_spec.rb +50 -0
  39. data/spec/ethon/easy/http/patch_spec.rb +50 -0
  40. data/spec/ethon/easy/http/post_spec.rb +220 -0
  41. data/spec/ethon/easy/http/put_spec.rb +124 -0
  42. data/spec/ethon/easy/http_spec.rb +44 -0
  43. data/spec/ethon/easy/informations_spec.rb +82 -0
  44. data/spec/ethon/easy/mirror_spec.rb +39 -0
  45. data/spec/ethon/easy/operations_spec.rb +251 -0
  46. data/spec/ethon/easy/options_spec.rb +135 -0
  47. data/spec/ethon/easy/queryable_spec.rb +188 -0
  48. data/spec/ethon/easy/response_callbacks_spec.rb +50 -0
  49. data/spec/ethon/easy/util_spec.rb +27 -0
  50. data/spec/ethon/easy_spec.rb +105 -0
  51. data/spec/ethon/libc_spec.rb +13 -0
  52. data/spec/ethon/loggable_spec.rb +21 -0
  53. data/spec/ethon/multi/operations_spec.rb +297 -0
  54. data/spec/ethon/multi/options_spec.rb +70 -0
  55. data/spec/ethon/multi/stack_spec.rb +79 -0
  56. data/spec/ethon/multi_spec.rb +21 -0
  57. data/spec/spec_helper.rb +27 -0
  58. data/spec/support/localhost_server.rb +94 -0
  59. data/spec/support/server.rb +114 -0
  60. metadata +91 -31
  61. data/lib/ethon/curls/auth_types.rb +0 -25
  62. data/lib/ethon/curls/http_versions.rb +0 -22
  63. data/lib/ethon/curls/postredir.rb +0 -15
  64. data/lib/ethon/curls/protocols.rb +0 -36
  65. data/lib/ethon/curls/proxy_types.rb +0 -25
  66. data/lib/ethon/curls/ssl_versions.rb +0 -23
@@ -1,25 +0,0 @@
1
- module Ethon
2
- module Curls # :nodoc:
3
-
4
- # This module contain available auth types.
5
- module AuthTypes
6
-
7
- # Return available auth types.
8
- #
9
- # @example Return auth types.
10
- # Ethon::Curl.auth_types
11
- #
12
- # @return [ Hash ] The auth types.
13
- def auth_types
14
- {
15
- :basic => 0x01,
16
- :digest => 0x02,
17
- :gssnegotiate => 0x04,
18
- :ntlm => 0x08,
19
- :digest_ie => 0x10,
20
- :auto => 0x1f
21
- }
22
- end
23
- end
24
- end
25
- end
@@ -1,22 +0,0 @@
1
- module Ethon
2
- module Curls
3
-
4
- # This module contains the available proxy types.
5
- module HttpVersions
6
-
7
- # Return http versions.
8
- #
9
- # @example Return http versions.
10
- # Ethon::Curl.http_versions
11
- #
12
- # @return [ Hash ] The http_versions.
13
- def http_versions
14
- {
15
- :none => 0,
16
- :httpv1_0 => 1,
17
- :httpv1_1 => 2
18
- }
19
- end
20
- end
21
- end
22
- end
@@ -1,15 +0,0 @@
1
- module Ethon
2
- module Curls
3
- module Postredir
4
- def postredir
5
- {
6
- :get_all => 0x00,
7
- :post_301 => 0x01,
8
- :post_302 => 0x02,
9
- :post_303 => 0x04,
10
- :post_all => 0x07
11
- }
12
- end
13
- end
14
- end
15
- end
@@ -1,36 +0,0 @@
1
- module Ethon
2
- module Curls
3
- module Protocols
4
- def protocols
5
- {
6
- :http => 0x00000001,
7
- :https => 0x00000002,
8
- :ftp => 0x00000004,
9
- :ftps => 0x00000008,
10
- :scp => 0x00000010,
11
- :sftp => 0x00000020,
12
- :telnet => 0x00000040,
13
- :ldap => 0x00000080,
14
- :ldaps => 0x00000100,
15
- :dict => 0x00001200,
16
- :file => 0x00001400,
17
- :tftp => 0x00001800,
18
- :imap => 0x00011000,
19
- :imaps => 0x00012000,
20
- :pop3 => 0x00014000,
21
- :pop3s => 0x00018000,
22
- :smtp => 0x00110000,
23
- :smtps => 0x00120000,
24
- :rtsp => 0x00140000,
25
- :rtmp => 0x00180000,
26
- :rtmpt => 0x02100000,
27
- :rtmpe => 0x02200000,
28
- :rtmpte => 0x02400000,
29
- :rtmps => 0x02800000,
30
- :rtmpts => 0x21000000,
31
- :gopher => 0x22000000,
32
- }
33
- end
34
- end
35
- end
36
- end
@@ -1,25 +0,0 @@
1
- module Ethon
2
- module Curls
3
-
4
- # This module contains the available proxy types.
5
- module ProxyTypes
6
-
7
- # Return proxy types.
8
- #
9
- # @example Return proxy types.
10
- # Ethon::Curl.proxy_types
11
- #
12
- # @return [ Hash ] The proxy_types.
13
- def proxy_types
14
- {
15
- :http => 0,
16
- :http_1_0 => 1,
17
- :socks4 => 4,
18
- :socks5 => 5,
19
- :socks4a => 6,
20
- :socks5_hostname =>7
21
- }
22
- end
23
- end
24
- end
25
- end
@@ -1,23 +0,0 @@
1
- module Ethon
2
- module Curls
3
-
4
- # This module contains the ssl version.
5
- module SslVersions
6
-
7
- # Return the ssl versions.
8
- #
9
- # @example Retur the ssl versions.
10
- # Ethon::Curl.ssl_versions
11
- #
12
- # @return [ Hash ] The versions.
13
- def ssl_versions
14
- {
15
- :default =>0,
16
- :tlsv1 => 1,
17
- :sslv2 => 2,
18
- :sslv3 => 3
19
- }
20
- end
21
- end
22
- end
23
- end