primotexto 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/primotexto/client/http.rb +2 -1
- data/lib/primotexto/version.rb +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: 9a4899a47b2c75b059e02fd9d33f601ca0acc642
|
4
|
+
data.tar.gz: a117cd2cf28c84084de8c58030033708230791e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1da1beab9cbed76551a10e5e68af0b24e2e1c125468afd5b6f54817151e9eddf1104dc323c375777c2b08e305fb19967167b3237bb51809066d426ada7f9415e
|
7
|
+
data.tar.gz: 3546531b30ad56b17b2530a83c20bb3f88aba3297015dda5cb015cc34a50b6d0f372b0c07fcb7d2b5b10c7d5ee04aa5e14d38e86dabe1681de5660c6abf5c297
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'net/http'
|
2
2
|
require 'json'
|
3
3
|
require 'cgi'
|
4
|
+
require 'active_support/core_ext/object/try'
|
4
5
|
|
5
6
|
module Primotexto
|
6
7
|
class Client
|
@@ -46,7 +47,7 @@ module Primotexto
|
|
46
47
|
def parse(http_response)
|
47
48
|
case http_response
|
48
49
|
when Net::HTTPSuccess
|
49
|
-
if http_response['Content-Type'].split
|
50
|
+
if http_response['Content-Type'].try(:split, ';').try(:first) == 'application/json'
|
50
51
|
JSON.parse!(http_response.body, symbolize_names: true)
|
51
52
|
else
|
52
53
|
http_response.body
|
data/lib/primotexto/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: primotexto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sébastien Poudat
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|