nethttputils 0.2.5.0 → 0.2.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7bbc2695cb20cfc4890ebbac97ed54ed93cfe7d3
4
- data.tar.gz: bf55a158b9052a138a7c3f576e8a8b03f05790fa
3
+ metadata.gz: 269ae22d3a1414546520372460907dadc16eb58f
4
+ data.tar.gz: eefba89631efce4b2e0bd77ffa2cccaf18fc731a
5
5
  SHA512:
6
- metadata.gz: a827b0b0fcea495ae07a172989cdf1081242f9b8a7a68957de380d2854e2f7f1a0ff645fe5e1f7982b328b759bea29ae1c817c292e5491df51ef46dad1bd3fa3
7
- data.tar.gz: a64a7e7de953f7eb3fb719eeea5df12e9d69a245c2a824b8837c013b404029d23f077a16fbb8cf5d865ec6402dab825af600741b5fff71874fa3771443d654ac
6
+ metadata.gz: 891dbd459995733d28bd6acfd8203d73c72993b944847f4358ca74c10339eb6ddc9dbea4cc363739bf2aa39ba077be82cee8fe52b679645123e65bc1a63b7aa3
7
+ data.tar.gz: 0e444a896a600b407b479babebe8367069251d85eec796b864550c964e31df2f9f134b003866e535ba6de559cbdd9ee8f50c737669e544af5486cb2c106fe89e
data/lib/nethttputils.rb CHANGED
@@ -32,13 +32,13 @@ module NetHTTPUtils
32
32
 
33
33
  # TODO: make it private?
34
34
  def get_response url, mtd = :GET, type = :form, form: {}, header: {}, auth: nil, timeout: 30, max_timeout_retry_delay: 3600, max_sslerror_retry_delay: 3600, max_read_retry_delay: 3600, max_econnrefused_retry_delay: 3600, max_socketerror_retry_delay: 3600, patch_request: nil, &block
35
+ uri = url
35
36
  uri = URI.parse begin
36
37
  URI url
37
38
  url
38
39
  rescue URI::InvalidURIError
39
40
  URI.escape url
40
- end unless uri.is_a? URI::HTTP
41
-
41
+ end unless url.is_a? URI::HTTP
42
42
 
43
43
  logger.warn "Warning: query params included in `url` argument are discarded because `:form` isn't empty" if uri.query && !form.empty?
44
44
  # we can't just merge because URI fails to parse such queries as "/?1"
@@ -338,9 +338,10 @@ if $0 == __FILE__
338
338
  end
339
339
  %w{
340
340
  http://www.aeronautica.difesa.it/organizzazione/REPARTI/divolo/PublishingImages/6%C2%B0%20Stormo/2013-decollo%20al%20tramonto%20REX%201280.jpg
341
- }.each do |url| # TODO: test that setting user-agent header fixes this timeout
341
+ }.each do |url|
342
342
  begin
343
- fail NetHTTPUtils.request_data url, timeout: 5, max_read_retry_delay: -1
343
+ NetHTTPUtils.request_data url, timeout: 5, max_read_retry_delay: -1
344
+ fail
344
345
  rescue Net::ReadTimeout
345
346
  end
346
347
  end
data/nethttputils.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "nethttputils"
3
- spec.version = "0.2.5.0"
3
+ spec.version = "0.2.5.1"
4
4
  spec.summary = "this tool is like a pet that I adopted young and now I depend on, sorry"
5
5
  spec.description = <<-EOF
6
6
  Back in 2015 I was a guy automating things at my job and two scripts had a common need --
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nethttputils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5.0
4
+ version: 0.2.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Maslov aka Nakilon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-24 00:00:00.000000000 Z
11
+ date: 2018-11-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |2
14
14
  Back in 2015 I was a guy automating things at my job and two scripts had a common need --
@@ -51,7 +51,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
51
51
  version: '0'
52
52
  requirements: []
53
53
  rubyforge_project:
54
- rubygems_version: 2.6.14
54
+ rubygems_version: 2.5.2
55
55
  signing_key:
56
56
  specification_version: 4
57
57
  summary: this tool is like a pet that I adopted young and now I depend on, sorry