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 +4 -4
- data/lib/nethttputils.rb +4 -2
- data/nethttputils.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a3bdaaec8992d13db534ec38ce63c28f303bc52
|
4
|
+
data.tar.gz: 70adf066cd7c2d63247da3955057b9872a3d1a4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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.
|
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.
|
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:
|
11
|
+
date: 2022-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|