cacho 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/lib/cacho.rb +12 -5
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5ca8cc9f078ae86e02bc6afb967b4e63596cbc6
|
4
|
+
data.tar.gz: 2dfd696b59443bd1077ec5dd614838f057a4c526
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f83a5f46beaf4a85ae194143f0c34e7c682f42b7d27e1a89a4837fbe554499ca0458ac1d01a6aa50ce82ebfd43e9a8fe8b3e7c35e012e3a0cf902dda5fb1d76
|
7
|
+
data.tar.gz: 91be7e3b2db90c242bcdb54fd1788640c2d7a0d0130565a7cfac8aa2ad1d184b1909fb92c5608cc2483e7338b049bb35885e6eac9a29aa037fbc508b8973d3b0
|
data/CHANGELOG.md
ADDED
data/lib/cacho.rb
CHANGED
@@ -7,7 +7,7 @@ require "csv"
|
|
7
7
|
require "fileutils"
|
8
8
|
|
9
9
|
class Cacho
|
10
|
-
VERSION = "0.1.
|
10
|
+
VERSION = "0.1.1"
|
11
11
|
|
12
12
|
attr_accessor :hasher
|
13
13
|
|
@@ -100,10 +100,17 @@ class Cacho::Client
|
|
100
100
|
body = Zlib::GzipReader.new(StringIO.new(body)).read
|
101
101
|
end
|
102
102
|
|
103
|
-
if res["Content-Type"]
|
104
|
-
|
105
|
-
|
106
|
-
|
103
|
+
if res["Content-Type"]
|
104
|
+
if charset = res["Content-Type"][/\bcharset=(.+)\b/, 1]
|
105
|
+
body.force_encoding(charset)
|
106
|
+
body.encode!(Encoding.default_external)
|
107
|
+
end
|
108
|
+
|
109
|
+
if res["Content-Type"].start_with?("application/json")
|
110
|
+
parsed = JSON.parse(body)
|
111
|
+
else
|
112
|
+
parsed = body
|
113
|
+
end
|
107
114
|
end
|
108
115
|
|
109
116
|
if @callbacks[:rate_limit_detector]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cacho
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Damian Janowski
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-11-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: net-http-persistent
|
@@ -34,6 +34,7 @@ extensions: []
|
|
34
34
|
extra_rdoc_files: []
|
35
35
|
files:
|
36
36
|
- ".gitignore"
|
37
|
+
- CHANGELOG.md
|
37
38
|
- README.md
|
38
39
|
- Rakefile
|
39
40
|
- UNLICENSE
|