primotexto 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 76f0e403cc818bc34074d2c133f6c6364d6b7a30
4
- data.tar.gz: bc35eaf8b1cb39460a041a34d98aaffb7b0ec858
3
+ metadata.gz: 9a4899a47b2c75b059e02fd9d33f601ca0acc642
4
+ data.tar.gz: a117cd2cf28c84084de8c58030033708230791e4
5
5
  SHA512:
6
- metadata.gz: 48ffcd5fe10be32969ee1cb8b63f6572603b84ee8cbc877ece3b49d41de462f15053c8c87414f2f50e2720d701d055b4dd81ffb48a02d016867ebbfd9a2b2346
7
- data.tar.gz: 8297adaeea726ef22edf747c28d896fb011e74bae4b48ec5d03471526ddcb8f4246add46eee8efee8723f469be4e1afd6887f7f1b99e0ea09ee537e0bdcdf29b
6
+ metadata.gz: 1da1beab9cbed76551a10e5e68af0b24e2e1c125468afd5b6f54817151e9eddf1104dc323c375777c2b08e305fb19967167b3237bb51809066d426ada7f9415e
7
+ data.tar.gz: 3546531b30ad56b17b2530a83c20bb3f88aba3297015dda5cb015cc34a50b6d0f372b0c07fcb7d2b5b10c7d5ee04aa5e14d38e86dabe1681de5660c6abf5c297
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Gem Version](https://badge.fury.io/rb/primotexto.svg)](https://badge.fury.io/rb/primotexto)
2
+
1
3
  # Primotexto
2
4
 
3
5
  This is an unofficial Ruby client for the [Primotexto API](https://www.primotexto.com/api/).
@@ -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(';').first == 'application/json'
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
@@ -1,3 +1,3 @@
1
1
  module Primotexto
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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.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-03-25 00:00:00.000000000 Z
11
+ date: 2016-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport