nethttputils 0.4.3.0 → 0.4.3.2

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: ecb7a8e00f832f9c1fa1f79610772f8f955a177f
4
- data.tar.gz: ee617bf653fca7736e95e257929ebb7a597872a1
3
+ metadata.gz: 8a3bdaaec8992d13db534ec38ce63c28f303bc52
4
+ data.tar.gz: 70adf066cd7c2d63247da3955057b9872a3d1a4f
5
5
  SHA512:
6
- metadata.gz: e3632e1d20d3d853f2b7542364785ce5ba4ca8b4ff25aa2304856061bbe133cdd145ac18843a1bd52af275939e9f8354223c0d37dac6d64df5791dc2f21fc9db
7
- data.tar.gz: 90e9b8a75802bd2d48cb727cf5c28ac4aa1c481e4af0afdc90d4e5b0f251e36293867819ef788774db550b92c0796482024913d313b7475e82737440c2685197
6
+ metadata.gz: adbfb02313e49c395e8f44b25d2f5f7cbfaa749220d61d855e1e29f5b3c656797347a802acbda55b40afcceb05ffa65b77ae90339f59ac12f55a9a2b88737f23
7
+ data.tar.gz: 37f2b5b2ea2db8620558444a21eaeeac9b15d4dcaba06d3007e7b112db84d91869a0238560c3c834f725386b64a17a377e2e4bbe081002ae7b5861b3ef93ec24
data/lib/nethttputils.rb CHANGED
@@ -1,9 +1,9 @@
1
1
  require "net/http"
2
+ require "cgi"
2
3
  require "openssl"
3
4
 
4
5
  require "logger"
5
6
 
6
-
7
7
  module NetHTTPUtils
8
8
  class << self
9
9
  attr_accessor :logger
@@ -16,8 +16,10 @@ module NetHTTPUtils
16
16
 
17
17
  class Error < RuntimeError
18
18
  attr_reader :code
19
+ attr_reader :body
19
20
  def initialize body, code = nil
20
21
  @code = code
22
+ @body = body
21
23
  body = body[0...997] + "..." if body.size > 1000
22
24
  super "HTTP error ##{code.inspect} #{body}"
23
25
  end
@@ -40,7 +42,7 @@ module NetHTTPUtils
40
42
  URI url
41
43
  url
42
44
  rescue URI::InvalidURIError
43
- URI.escape url
45
+ CGI.escape url
44
46
  end unless url.is_a? URI::HTTP
45
47
  delay = 5
46
48
  begin
data/nethttputils.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "nethttputils"
3
- spec.version = "0.4.3.0"
3
+ spec.version = "0.4.3.2"
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.4.3.0
4
+ version: 0.4.3.2
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: 2021-10-16 00:00:00.000000000 Z
11
+ date: 2022-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable