sibit 0.20.2 → 0.20.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sibit/http.rb +2 -2
- data/lib/sibit/json.rb +11 -1
- data/lib/sibit/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a10cbcbf86d4a0c612ebba219e7e5d0a09480444280a106fd47bb41cbadd0405
|
4
|
+
data.tar.gz: 5c3ede973fe824a8f247099c6980b938dc83b07481553bf7925678837553d4ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bd040eb2e985bd9af773e4bcda1108939cecbcea6b4719f3779eba70a3ce3d2bd69c1deb5c8a748eaaeee85f98fcc6ac5f447189ef635befbd75d68abde6aff
|
7
|
+
data.tar.gz: ee1ba5bc4c7bd03d0f975a38c0d2f5d315804eb3444dad26b93511fed19ce3092420907d0a338d4d871dc1abc7fd9307bc3d9f4f7a97a46a6a5824be52c13c62
|
data/lib/sibit/http.rb
CHANGED
@@ -33,7 +33,7 @@ class Sibit
|
|
33
33
|
def client(uri)
|
34
34
|
http = Net::HTTP.new(uri.host, uri.port)
|
35
35
|
http.use_ssl = true
|
36
|
-
http.read_timeout =
|
36
|
+
http.read_timeout = 240
|
37
37
|
http
|
38
38
|
end
|
39
39
|
end
|
@@ -47,7 +47,7 @@ class Sibit
|
|
47
47
|
def client(uri)
|
48
48
|
http = Net::HTTP.new(uri.host, uri.port, @host, @port.to_i)
|
49
49
|
http.use_ssl = true
|
50
|
-
http.read_timeout =
|
50
|
+
http.read_timeout = 240
|
51
51
|
http
|
52
52
|
end
|
53
53
|
end
|
data/lib/sibit/json.rb
CHANGED
@@ -62,7 +62,7 @@ class Sibit
|
|
62
62
|
unless accept.include?(res.code.to_i)
|
63
63
|
raise Sibit::Error, "Failed to retrieve #{uri} (#{res.code}): #{res.body}"
|
64
64
|
end
|
65
|
-
@log.info("GET #{uri}: #{res.code}/#{res.body.length}
|
65
|
+
@log.info("GET #{uri}: #{res.code}/#{length(res.body.length)} in #{age(start)}")
|
66
66
|
JSON.parse(res.body)
|
67
67
|
end
|
68
68
|
|
@@ -91,6 +91,16 @@ class Sibit
|
|
91
91
|
"#{((Time.now - start) * 1000).round}ms"
|
92
92
|
end
|
93
93
|
|
94
|
+
def length(bytes)
|
95
|
+
if bytes > 1024 * 1024
|
96
|
+
"#{bytes / (1024 * 1024)}mb"
|
97
|
+
elsif bytes > 1024
|
98
|
+
"#{bytes / 1024}kb"
|
99
|
+
else
|
100
|
+
"#{bytes}b"
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
94
104
|
def user_agent
|
95
105
|
"Anonymous/#{Sibit::VERSION}"
|
96
106
|
end
|
data/lib/sibit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sibit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.20.
|
4
|
+
version: 0.20.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08
|
11
|
+
date: 2020-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: backtrace
|