httply 0.1.4 → 0.1.9

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f4f94c9f550d3248f2461513736182b62fea724bf6afbd183d84576d2f1e8db8
4
- data.tar.gz: 7dc91382584aa43a6b9c4ec2291b029c17d267bac38d6705df03ec79c3c236d1
3
+ metadata.gz: b7a4ab9b01b8b05a2b6719e008577e909f7d34abf8b8fe119d2ae29760eca61b
4
+ data.tar.gz: d2acbc10fa201caffa6f5c0d827dd5b1abfa036ac91a31914d0ef22e863e01d2
5
5
  SHA512:
6
- metadata.gz: 78d8610e593ecf6fc2068b17f779ed6895c8eccc8f289f4ccf1967c44aea1b3e240d09417d863eb95b7a512eb7a46f495c362ecef2b00d7800244a4a78e743eb
7
- data.tar.gz: 4190a58a8f1c10a6a09635eb9d8478b6762083e7ee1a27e8b4ac4634d586296bfdce67f1ad7547e2aab9aabadad9ed107375cfffebf9182885359cd7aaa6e473
6
+ metadata.gz: e04a34309d5a77fd04f1418c96f03ef77034c247f8d33a397ba824cfdac10c9c38bca2ea4c665ed7278e7e29ed52ca940ce197d1e77bb8a218c7edcd518618dd
7
+ data.tar.gz: 877de8c7af979b63c1aec8b69e56ef3a06bdb750f3f39cd6bfd828bc14ca48f14ab3b6ce92afe0f85fb10ef6d76d6696c464d51d432a267a1958a80e1ace7e6e
data/.gitignore CHANGED
@@ -9,6 +9,8 @@
9
9
 
10
10
  /spec/data/
11
11
 
12
+ .ruby-version
13
+
12
14
  /bin/.pry_history
13
15
  .pry_history
14
16
 
@@ -1,56 +1,56 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- httply (0.1.1)
5
- agents (>= 0.1.4)
6
- faraday (>= 0.15.4)
7
- faraday_middleware (>= 0.13.1)
4
+ httply (0.1.9)
5
+ agents (~> 0.1.4)
6
+ faraday (~> 1.0, >= 1.0.1)
7
+ faraday_middleware (~> 1.0)
8
+ multi_xml (~> 0.6.0)
8
9
 
9
10
  GEM
10
11
  remote: https://rubygems.org/
11
12
  specs:
12
13
  agents (0.1.4)
13
- coderay (1.1.2)
14
- diff-lcs (1.3)
15
- faraday (0.15.4)
14
+ coderay (1.1.3)
15
+ diff-lcs (1.4.4)
16
+ faraday (1.0.1)
16
17
  multipart-post (>= 1.2, < 3)
17
- faraday_middleware (0.13.1)
18
- faraday (>= 0.7.4, < 1.0)
19
- method_source (0.9.2)
18
+ faraday_middleware (1.0.0)
19
+ faraday (~> 1.0)
20
+ method_source (1.0.0)
20
21
  mini_portile2 (2.4.0)
21
22
  multi_xml (0.6.0)
22
23
  multipart-post (2.1.1)
23
- nokogiri (1.10.3)
24
+ nokogiri (1.10.10)
24
25
  mini_portile2 (~> 2.4.0)
25
- pry (0.12.2)
26
- coderay (~> 1.1.0)
27
- method_source (~> 0.9.0)
28
- rake (10.5.0)
29
- rspec (3.8.0)
30
- rspec-core (~> 3.8.0)
31
- rspec-expectations (~> 3.8.0)
32
- rspec-mocks (~> 3.8.0)
33
- rspec-core (3.8.0)
34
- rspec-support (~> 3.8.0)
35
- rspec-expectations (3.8.3)
26
+ pry (0.13.1)
27
+ coderay (~> 1.1)
28
+ method_source (~> 1.0)
29
+ rake (13.0.1)
30
+ rspec (3.9.0)
31
+ rspec-core (~> 3.9.0)
32
+ rspec-expectations (~> 3.9.0)
33
+ rspec-mocks (~> 3.9.0)
34
+ rspec-core (3.9.2)
35
+ rspec-support (~> 3.9.3)
36
+ rspec-expectations (3.9.2)
36
37
  diff-lcs (>= 1.2.0, < 2.0)
37
- rspec-support (~> 3.8.0)
38
- rspec-mocks (3.8.0)
38
+ rspec-support (~> 3.9.0)
39
+ rspec-mocks (3.9.1)
39
40
  diff-lcs (>= 1.2.0, < 2.0)
40
- rspec-support (~> 3.8.0)
41
- rspec-support (3.8.0)
41
+ rspec-support (~> 3.9.0)
42
+ rspec-support (3.9.3)
42
43
 
43
44
  PLATFORMS
44
45
  ruby
45
46
 
46
47
  DEPENDENCIES
47
- bundler (~> 1.17)
48
+ bundler (~> 2.1, >= 2.1.4)
48
49
  httply!
49
- multi_xml (~> 0.6.0)
50
- nokogiri (~> 1.10)
51
- pry (~> 0.12.2)
52
- rake (~> 10.0)
53
- rspec (~> 3.0)
50
+ nokogiri (~> 1.10, >= 1.10.10)
51
+ pry (~> 0.13.1)
52
+ rake (~> 13.0, >= 13.0.1)
53
+ rspec (~> 3.9)
54
54
 
55
55
  BUNDLED WITH
56
- 1.17.2
56
+ 2.1.4
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Httply is a lightweight wrapper around Faraday to support automatic randomization of proxies and user agents, amongst other things.
4
4
 
5
- Randomized proxy switching support is provided by the [proxied](https://github.com/SebastianJ/proxied) gem and randomized user agent is provided by the [agents](https://github.com/SebastianJ/agents) gem.
5
+ Randomized proxy switching support is provided by the [proxied](https://github.com/SebastianJ/proxied) gem and randomized user agent support is provided by the [agents](https://github.com/SebastianJ/agents) gem.
6
6
 
7
7
  Randomized/automatic proxy switching is currently only supported in conjunction with the [proxied](https://github.com/SebastianJ/proxied) gem. Manual proxy support is obviously supported irregardless of using [proxied](https://github.com/SebastianJ/proxied) or not.
8
8
 
@@ -26,16 +26,25 @@ Or install it yourself as:
26
26
 
27
27
  ### Instance
28
28
 
29
- Httply can either be used as an instance, e.g:
29
+ Httply can be used as an instance:
30
30
 
31
31
  ```ruby
32
32
  client = Httply::Client.new(host: "https://www.google.com")
33
33
  response = client.get("/webhp", parameters: {hl: :en})
34
34
  ```
35
35
 
36
+ Httply can also memoize the Faraday connection (e.g. if you're invoking an API and using the same proxy and user agent for every request):
37
+
38
+ ```ruby
39
+ client = Httply::Client.new(host: "https://www.google.com", memoize: true)
40
+ response = client.get("/webhp", parameters: {hl: :en})
41
+ ```
42
+
43
+ The difference is that for the first example user-agent and proxy will automatically be rotated (if not providing a specifc user-agent or proxy) on every request whereas in the second example the user-agent and proxy will be kept for every request.
44
+
36
45
  ### Class method
37
46
 
38
- Or directly as a class method:
47
+ Httply can also be invoked on a class level:
39
48
 
40
49
  ```ruby
41
50
  response = Httply.get("https://www.google.com/webhp", parameters: {hl: :en})
@@ -45,10 +54,10 @@ response = Httply.get("https://www.google.com/webhp", parameters: {hl: :en})
45
54
 
46
55
  HTML parsing requires that Nokogiri has been required elsewhere and is accessible for Httply.
47
56
 
48
- You can also force parsing responses as HTML using Nokogiri:
57
+ If Nokogiri is available "text/html" responses will automatically be parsed by Nokogiri.
49
58
 
50
59
  ```ruby
51
- response = Httply.get("https://www.google.com/webhp", parameters: {hl: :en}, as: :html)
60
+ response = Httply.get("https://www.google.com/webhp", parameters: {hl: :en})
52
61
  ```
53
62
 
54
63
  response.body will now return a Nokogiri::HTML::Document
@@ -23,16 +23,16 @@ Gem::Specification.new do |spec|
23
23
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
24
  spec.require_paths = ["lib"]
25
25
 
26
- spec.add_dependency "faraday", ">= 0.15.4"
27
- spec.add_dependency "faraday_middleware", ">= 0.13.1"
28
- spec.add_dependency "agents", ">= 0.1.4"
26
+ spec.add_dependency 'faraday', '~> 1.0', '>= 1.0.1'
27
+ spec.add_dependency 'faraday_middleware', '~> 1.0'
28
+ spec.add_dependency 'agents', '~> 0.1.4'
29
+ spec.add_dependency 'multi_xml', '~> 0.6.0'
29
30
 
30
- spec.add_development_dependency "bundler", "~> 1.17"
31
- spec.add_development_dependency "rake", "~> 10.0"
32
- spec.add_development_dependency "rspec", "~> 3.0"
31
+ spec.add_development_dependency 'bundler', '~> 2.1', '>= 2.1.4'
32
+ spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.1'
33
+ spec.add_development_dependency 'rspec', '~> 3.9'
33
34
 
34
- spec.add_development_dependency "pry", "~> 0.12.2"
35
+ spec.add_development_dependency 'pry', '~> 0.13.1'
35
36
 
36
- spec.add_development_dependency "nokogiri", "~> 1.10"
37
- spec.add_development_dependency "multi_xml", "~> 0.6.0"
37
+ spec.add_development_dependency 'nokogiri', '~> 1.10', '>= 1.10.10'
38
38
  end
@@ -2,11 +2,16 @@ require "faraday"
2
2
  require "faraday_middleware"
3
3
  require "agents"
4
4
 
5
+ require "uri"
6
+
5
7
  require "httply/version"
6
8
  require "httply/configuration"
7
9
 
8
10
  require "httply/middlewares/html"
9
11
 
12
+ require "httply/utilities/uri"
13
+
14
+ require "httply/response"
10
15
  require "httply/proxies"
11
16
  require "httply/client"
12
17
 
@@ -29,8 +34,9 @@ module Httply
29
34
  end
30
35
 
31
36
  [:get, :head, :post, :put, :patch, :delete].each do |http_verb|
32
- define_method(http_verb) do |path, args|
33
- ::Httply::Client.new.send(http_verb, path, **args)
37
+ define_method(http_verb) do |path, *args|
38
+ args = args.any? ? args.flatten.first : {}
39
+ ::Httply::Client.new.send(http_verb, path, args)
34
40
  end
35
41
  end
36
42
 
@@ -1,100 +1,117 @@
1
1
  module Httply
2
2
  class Client
3
3
  attr_accessor :host, :configuration
4
+ attr_accessor :memoize, :connection
4
5
 
5
6
  include ::Httply::Proxies
6
7
 
7
- def initialize(host: nil, configuration: ::Httply.configuration)
8
- self.host = host
8
+ def initialize(host: nil, configuration: ::Httply.configuration, memoize: false)
9
+ self.host = ::Httply::Utilities::Uri.correct_host(host)
9
10
  self.configuration = configuration
11
+ self.memoize = memoize
12
+ self.connection = nil
10
13
  end
11
14
 
12
- def to_uri(path)
13
- path = path.gsub(/^\//i, "")
14
-
15
- if path !~ /^http(s)?:\/\// && !self.host.to_s.empty?
16
- host_part = self.host =~ /^http(s)?:\/\// ? self.host : "https://#{self.host}"
17
- path = "#{host_part}/#{path}"
18
- end
19
-
20
- return path
15
+ def setup(host: nil, headers: {}, options: {})
16
+ self.connection ||= configure(host: host, headers: headers, options: options)
21
17
  end
22
18
 
23
- def get(path, parameters: {}, headers: {}, options: {}, as: nil)
24
- request path, method: :get, parameters: parameters, headers: headers, options: options, as: as
19
+ def get(path, parameters: {}, headers: {}, options: {}, format: nil)
20
+ request path, method: :get, parameters: parameters, headers: headers, options: options, format: format
25
21
  end
26
22
 
27
- def head(path, parameters: {}, headers: {}, options: {}, as: nil)
28
- request path, method: :head, parameters: parameters, headers: headers, options: options, as: as
23
+ def head(path, parameters: {}, headers: {}, options: {}, format: nil)
24
+ request path, method: :head, parameters: parameters, headers: headers, options: options, format: format
29
25
  end
30
26
 
31
- def post(path, parameters: {}, data: {}, headers: {}, options: {}, as: nil)
32
- request path, method: :post, parameters: parameters, data: data, headers: headers, options: options, as: as
27
+ def post(path, parameters: {}, data: {}, headers: {}, options: {}, format: nil)
28
+ request path, method: :post, parameters: parameters, data: data, headers: headers, options: options, format: format
33
29
  end
34
30
 
35
- def put(path, parameters: {}, data: {}, headers: {}, options: {}, as: nil)
36
- request path, method: :put, parameters: parameters, data: data, headers: headers, options: options, as: as
31
+ def put(path, parameters: {}, data: {}, headers: {}, options: {}, format: nil)
32
+ request path, method: :put, parameters: parameters, data: data, headers: headers, options: options, format: format
37
33
  end
38
34
 
39
- def patch(path, parameters: {}, data: {}, headers: {}, options: {}, as: nil)
40
- request path, method: :patch, parameters: parameters, data: data, headers: headers, options: options, as: as
35
+ def patch(path, parameters: {}, data: {}, headers: {}, options: {}, format: nil)
36
+ request path, method: :patch, parameters: parameters, data: data, headers: headers, options: options, format: format
41
37
  end
42
38
 
43
- def delete(path, parameters: {}, data: {}, headers: {}, options: {}, as: nil)
44
- request path, method: :delete, parameters: parameters, data: data, headers: headers, options: options, as: as
39
+ def delete(path, parameters: {}, data: {}, headers: {}, options: {}, format: nil)
40
+ request path, method: :delete, parameters: parameters, data: data, headers: headers, options: options, format: format
45
41
  end
46
42
 
47
- def request(path, method: :get, parameters: {}, data: {}, headers: {}, options: {}, as: nil)
48
- connection = setup(path, method: method, headers: headers, options: options, as: as)
43
+ def request(path, method: :get, parameters: {}, data: {}, headers: {}, options: {}, format: nil)
44
+ host = !self.host.to_s.empty? ? self.host : ::Httply::Utilities::Uri.parse_host(path)
45
+ path = ::Httply::Utilities::Uri.to_path(path)
46
+ connection = self.memoize ? setup(host: host, headers: headers, options: options) : configure(host: host, headers: headers, options: options)
49
47
 
50
48
  response = case method
51
49
  when :get
52
50
  connection.get do |request|
51
+ request.url path
53
52
  request.params = parameters if parameters && !parameters.empty?
54
53
  end
55
54
  when :head
56
55
  connection.head do |request|
56
+ request.url path
57
57
  request.params = parameters if parameters && !parameters.empty?
58
58
  end
59
59
  when :post, :put, :patch, :delete
60
60
  connection.send(method) do |request|
61
+ request.url path
61
62
  request.body = data if data && !data.empty?
62
63
  request.params = parameters if parameters && !parameters.empty?
63
64
  end
64
65
  end
65
66
 
67
+ response = ::Httply::Response.new(response)
68
+ response = force_format(response, format) unless format.to_s.empty?
69
+
66
70
  return response
67
71
  end
68
72
 
69
- def setup(path, method: :get, headers: {}, options: {}, as: nil)
73
+ def force_format(response, format)
74
+ case format.to_sym
75
+ when :json
76
+ response.body = ::JSON.parse(response.body)
77
+ when :xml
78
+ response.body = ::MultiXml.parse(response.body)
79
+ when :html
80
+ response.body = ::Nokogiri::HTML(response.body, nil, "utf-8")
81
+ end
82
+
83
+ return response
84
+ end
85
+
86
+ def configure(host:, headers: {}, options: {})
70
87
  client_options = options.fetch(:client, {})
71
- follow_redirects = options.fetch(:follow_redirects, true)
72
- redirect_limit = options.fetch(:redirects_limit, 10)
73
- proxy = determine_proxy(options.fetch(:proxy, nil))
74
88
 
75
- url = to_uri(path)
89
+ request_options = options.fetch(:request, {})
90
+ redirects = request_options.fetch(:redirects, 10)
91
+
92
+ proxy = determine_proxy(options.fetch(:proxy, nil))
76
93
 
77
- headers = {"User-Agent" => ::Agents.random_user_agent(options.fetch(:user_agent_device, :desktop))}.merge(headers)
94
+ headers["User-Agent"] = headers.fetch("User-Agent", ::Agents.random_user_agent(options.fetch(:user_agent_device, :desktop)))
78
95
 
79
- connection = ::Faraday.new(url, client_options) do |builder|
96
+ connection = ::Faraday.new(host, client_options) do |builder|
80
97
  builder.options[:timeout] = options.fetch(:timeout, nil) if options.fetch(:timeout, nil)
81
98
  builder.options[:open_timeout] = options.fetch(:open_timeout, nil) if options.fetch(:open_timeout, nil)
82
99
 
83
100
  builder.headers = headers
84
101
 
85
- builder.request :url_encoded if [:post, :put, :patch, :delete].include?(method)
102
+ builder.request :url_encoded if request_options.fetch(:url_encoded, false)
103
+ builder.request :json if request_options.fetch(:json, false)
86
104
 
87
- builder.response :logger if self.configuration.verbose
105
+ builder.response :logger if self.configuration.verbose
106
+ builder.response :xml, content_type: /\bxml$/
107
+ builder.response :json, content_type: /\bjson$/
108
+ builder.use ::Httply::Middlewares::ParseHtml, content_type: /\btext\/html$/
88
109
 
89
- builder.response :xml, content_type: /\bxml$/ if as.eql?(:xml)
90
- builder.response :json, content_type: /\bjson$/ if as.eql?(:json)
91
- builder.use ::Httply::Middlewares::ParseHtml if as.eql?(:html)
110
+ builder.use ::FaradayMiddleware::FollowRedirects, limit: redirects if redirects && redirects > 0
92
111
 
93
- builder.use ::FaradayMiddleware::FollowRedirects, limit: redirect_limit if follow_redirects && redirect_limit && redirect_limit > 0
94
-
95
- if proxy
96
- builder.proxy = generate_faraday_proxy(proxy)
97
- puts "[Httply::Client] - Will use proxy: #{builder.proxy.inspect}" if self.configuration.verbose
112
+ if proxy && !proxy.empty?
113
+ builder.proxy = proxy
114
+ log("Will use proxy: #{builder.proxy.inspect}")
98
115
  end
99
116
 
100
117
  builder.adapter self.configuration.faraday.fetch(:adapter, ::Faraday.default_adapter)
@@ -103,5 +120,9 @@ module Httply
103
120
  return connection
104
121
  end
105
122
 
123
+ def log(message)
124
+ puts "[Httply::Client] - #{message}" if self.configuration.verbose
125
+ end
126
+
106
127
  end
107
128
  end
@@ -19,6 +19,10 @@ module Httply
19
19
  elsif proxy_model_defined? && options.is_a?(::Proxy)
20
20
  proxy = proxy_from_object(options, proxy)
21
21
  end
22
+
23
+ if proxy && !proxy.empty?
24
+ proxy = proxy.has_key?(:uri) ? proxy : generate_faraday_proxy(proxy)
25
+ end
22
26
  end
23
27
 
24
28
  return proxy
@@ -37,25 +41,28 @@ module Httply
37
41
  end
38
42
 
39
43
  def proxy_from_hash(options, proxy)
40
- host = options.fetch(:host, nil)
41
- port = options.fetch(:port, nil)
42
-
43
- username = options.fetch(:username, nil)
44
- password = options.fetch(:password, nil)
45
-
46
- randomize = options.fetch(:randomize, true)
44
+ randomize = options.fetch(:randomize, false)
47
45
  type = options.fetch(:type, :all)
48
- protocol = options.fetch(:protocol, :all)
46
+ protocol = options.fetch(:protocol, :http)
49
47
 
50
48
  if randomize && proxy_model_defined?
51
49
  proxy_object = ::Proxy.get_random_proxy(protocol: protocol, proxy_type: type)
52
50
  proxy = proxy_from_object(proxy_object, proxy)
53
51
  else
54
- if host && port
55
- proxy[:host] = host
56
- proxy[:port] = port
52
+ uri = options.fetch(:uri, nil)
53
+
54
+ if uri.to_s.empty?
55
+ host = options.fetch(:host, nil)
56
+ port = options.fetch(:port, nil)
57
+
58
+ username = options.fetch(:username, nil)
59
+ password = options.fetch(:password, nil)
57
60
 
58
- proxy = set_credentials(username, password, proxy)
61
+ if !host.to_s.empty? && !port.to_s.empty?
62
+ proxy[:host] = host
63
+ proxy[:port] = port
64
+ proxy = set_credentials(username, password, proxy)
65
+ end
59
66
  end
60
67
  end
61
68
 
@@ -0,0 +1,11 @@
1
+ module Httply
2
+ class Response
3
+ attr_accessor :response, :body
4
+
5
+ def initialize(response)
6
+ self.response = response
7
+ self.body = response.body
8
+ end
9
+
10
+ end
11
+ end
@@ -0,0 +1,33 @@
1
+ module Httply
2
+ module Utilities
3
+ class Uri
4
+ class << self
5
+
6
+ def correct_host(host)
7
+ if !host.to_s.empty?
8
+ host = host =~ /^http(s)?:\/\//i ? host : "https://#{host}"
9
+ end
10
+
11
+ return host
12
+ end
13
+
14
+ def parse_host(url)
15
+ host = nil
16
+
17
+ if host.to_s.empty? && url =~ /^http(s)?:\/\//
18
+ uri = URI(url)
19
+ host = "#{uri.scheme}://#{uri.host}"
20
+ end
21
+
22
+ return host
23
+ end
24
+
25
+ def to_path(path)
26
+ path = path =~ /^http(s)?:\/\// ? URI(path).path : path
27
+ path = path =~ /^\// ? path : "/#{path}"
28
+ end
29
+
30
+ end
31
+ end
32
+ end
33
+ end
@@ -1,3 +1,3 @@
1
1
  module Httply
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.9"
3
3
  end
metadata CHANGED
@@ -1,141 +1,165 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httply
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Johnsson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-05-22 00:00:00.000000000 Z
11
+ date: 2020-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
17
20
  - - ">="
18
21
  - !ruby/object:Gem::Version
19
- version: 0.15.4
22
+ version: 1.0.1
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '1.0'
24
30
  - - ">="
25
31
  - !ruby/object:Gem::Version
26
- version: 0.15.4
32
+ version: 1.0.1
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: faraday_middleware
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
- - - ">="
37
+ - - "~>"
32
38
  - !ruby/object:Gem::Version
33
- version: 0.13.1
39
+ version: '1.0'
34
40
  type: :runtime
35
41
  prerelease: false
36
42
  version_requirements: !ruby/object:Gem::Requirement
37
43
  requirements:
38
- - - ">="
44
+ - - "~>"
39
45
  - !ruby/object:Gem::Version
40
- version: 0.13.1
46
+ version: '1.0'
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: agents
43
49
  requirement: !ruby/object:Gem::Requirement
44
50
  requirements:
45
- - - ">="
51
+ - - "~>"
46
52
  - !ruby/object:Gem::Version
47
53
  version: 0.1.4
48
54
  type: :runtime
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
51
57
  requirements:
52
- - - ">="
58
+ - - "~>"
53
59
  - !ruby/object:Gem::Version
54
60
  version: 0.1.4
55
61
  - !ruby/object:Gem::Dependency
56
- name: bundler
62
+ name: multi_xml
57
63
  requirement: !ruby/object:Gem::Requirement
58
64
  requirements:
59
65
  - - "~>"
60
66
  - !ruby/object:Gem::Version
61
- version: '1.17'
62
- type: :development
67
+ version: 0.6.0
68
+ type: :runtime
63
69
  prerelease: false
64
70
  version_requirements: !ruby/object:Gem::Requirement
65
71
  requirements:
66
72
  - - "~>"
67
73
  - !ruby/object:Gem::Version
68
- version: '1.17'
74
+ version: 0.6.0
69
75
  - !ruby/object:Gem::Dependency
70
- name: rake
76
+ name: bundler
71
77
  requirement: !ruby/object:Gem::Requirement
72
78
  requirements:
73
79
  - - "~>"
74
80
  - !ruby/object:Gem::Version
75
- version: '10.0'
81
+ version: '2.1'
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: 2.1.4
76
85
  type: :development
77
86
  prerelease: false
78
87
  version_requirements: !ruby/object:Gem::Requirement
79
88
  requirements:
80
89
  - - "~>"
81
90
  - !ruby/object:Gem::Version
82
- version: '10.0'
91
+ version: '2.1'
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: 2.1.4
83
95
  - !ruby/object:Gem::Dependency
84
- name: rspec
96
+ name: rake
85
97
  requirement: !ruby/object:Gem::Requirement
86
98
  requirements:
87
99
  - - "~>"
88
100
  - !ruby/object:Gem::Version
89
- version: '3.0'
101
+ version: '13.0'
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: 13.0.1
90
105
  type: :development
91
106
  prerelease: false
92
107
  version_requirements: !ruby/object:Gem::Requirement
93
108
  requirements:
94
109
  - - "~>"
95
110
  - !ruby/object:Gem::Version
96
- version: '3.0'
111
+ version: '13.0'
112
+ - - ">="
113
+ - !ruby/object:Gem::Version
114
+ version: 13.0.1
97
115
  - !ruby/object:Gem::Dependency
98
- name: pry
116
+ name: rspec
99
117
  requirement: !ruby/object:Gem::Requirement
100
118
  requirements:
101
119
  - - "~>"
102
120
  - !ruby/object:Gem::Version
103
- version: 0.12.2
121
+ version: '3.9'
104
122
  type: :development
105
123
  prerelease: false
106
124
  version_requirements: !ruby/object:Gem::Requirement
107
125
  requirements:
108
126
  - - "~>"
109
127
  - !ruby/object:Gem::Version
110
- version: 0.12.2
128
+ version: '3.9'
111
129
  - !ruby/object:Gem::Dependency
112
- name: nokogiri
130
+ name: pry
113
131
  requirement: !ruby/object:Gem::Requirement
114
132
  requirements:
115
133
  - - "~>"
116
134
  - !ruby/object:Gem::Version
117
- version: '1.10'
135
+ version: 0.13.1
118
136
  type: :development
119
137
  prerelease: false
120
138
  version_requirements: !ruby/object:Gem::Requirement
121
139
  requirements:
122
140
  - - "~>"
123
141
  - !ruby/object:Gem::Version
124
- version: '1.10'
142
+ version: 0.13.1
125
143
  - !ruby/object:Gem::Dependency
126
- name: multi_xml
144
+ name: nokogiri
127
145
  requirement: !ruby/object:Gem::Requirement
128
146
  requirements:
129
147
  - - "~>"
130
148
  - !ruby/object:Gem::Version
131
- version: 0.6.0
149
+ version: '1.10'
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: 1.10.10
132
153
  type: :development
133
154
  prerelease: false
134
155
  version_requirements: !ruby/object:Gem::Requirement
135
156
  requirements:
136
157
  - - "~>"
137
158
  - !ruby/object:Gem::Version
138
- version: 0.6.0
159
+ version: '1.10'
160
+ - - ">="
161
+ - !ruby/object:Gem::Version
162
+ version: 1.10.10
139
163
  description: Httply is a lightweight wrapper around Faraday to support automatic randomization
140
164
  of proxies and user agents, amongst other things.
141
165
  email:
@@ -146,7 +170,6 @@ extra_rdoc_files: []
146
170
  files:
147
171
  - ".gitignore"
148
172
  - ".rspec"
149
- - ".ruby-version"
150
173
  - ".travis.yml"
151
174
  - CODE_OF_CONDUCT.md
152
175
  - Gemfile
@@ -162,6 +185,8 @@ files:
162
185
  - lib/httply/configuration.rb
163
186
  - lib/httply/middlewares/html.rb
164
187
  - lib/httply/proxies.rb
188
+ - lib/httply/response.rb
189
+ - lib/httply/utilities/uri.rb
165
190
  - lib/httply/version.rb
166
191
  homepage: https://github.com/SebastianJ/httply
167
192
  licenses:
@@ -182,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
207
  - !ruby/object:Gem::Version
183
208
  version: '0'
184
209
  requirements: []
185
- rubygems_version: 3.0.3
210
+ rubygems_version: 3.1.2
186
211
  signing_key:
187
212
  specification_version: 4
188
213
  summary: Httply - lightweight Faraday wrapper
@@ -1 +0,0 @@
1
- 2.6.3