pusher-push-notifications 0.3.0 → 0.3.1

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
- SHA1:
3
- metadata.gz: eda3cdb7f34c319c2fe1f8ab44547a1e26b246ec
4
- data.tar.gz: 4f9060aeb8ae3a31742262ebf31cfca16b9aad89
2
+ SHA256:
3
+ metadata.gz: f5f179801f663e3f2ef76bbad684fe37dfb003636ae39356f832565c351dccdc
4
+ data.tar.gz: 36b660566d424a15eeecf8d1c6d5731e3d7af4393b78318d677e7eec86eda2d6
5
5
  SHA512:
6
- metadata.gz: 25405a714c8111e4410ae6c8b8e72e3c37e38205e1572eba3632a5859f006ec561328f8846d7e311e2cf77e1702e44ff2623102148b594ff9113ec47ffed9c22
7
- data.tar.gz: 6bcb05ca8c75210f8171edddfd9f5872ec82d64e0f22a8acb0c422f6908bfa81f42de73c41544a94ff2fab76a07fb50616e24fac5190d67c1d3254138a476669
6
+ metadata.gz: d566ba46b0a2cbe7f784f1e3093aed15df19dabf68bad4a1e7df448e55e230b3136298595025429712ebe103998454d4504aaa82a2905223da52d8f25649c93a
7
+ data.tar.gz: ead9faa60b578fb70acc4ed8677e11c96a94bba9ed34994cfe0acee05d3e56b534f92a96cf1d492e5df24d231530ad15e3fec6d6d5b84ab86b3a3264712eec86
data/Gemfile CHANGED
@@ -6,3 +6,5 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
6
 
7
7
  # Specify your gem's dependencies in pusher-push_notifications.gemspec
8
8
  gemspec
9
+
10
+ gem 'codecov', :require => false, :group => :test
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pusher-push-notifications (0.3.0)
4
+ pusher-push-notifications (0.3.1)
5
5
  caze
6
6
  rest-client
7
7
 
@@ -19,6 +19,10 @@ GEM
19
19
  byebug (9.1.0)
20
20
  caze (0.2.2)
21
21
  activesupport (>= 3)
22
+ codecov (0.1.10)
23
+ json
24
+ simplecov
25
+ url
22
26
  coderay (1.1.2)
23
27
  concurrent-ruby (1.0.5)
24
28
  coveralls (0.8.21)
@@ -101,6 +105,7 @@ GEM
101
105
  unf_ext
102
106
  unf_ext (0.0.7.5)
103
107
  unicode-display_width (1.3.0)
108
+ url (0.3.2)
104
109
  vcr (3.0.3)
105
110
  webmock (3.1.1)
106
111
  addressable (>= 2.3.6)
@@ -112,6 +117,7 @@ PLATFORMS
112
117
 
113
118
  DEPENDENCIES
114
119
  bundler (~> 1.16)
120
+ codecov
115
121
  coveralls (~> 0.8.21)
116
122
  dotenv (~> 2.2, >= 2.2.1)
117
123
  pry-byebug
@@ -26,8 +26,12 @@ module Pusher
26
26
  payload: body, headers: headers
27
27
  ) do |response|
28
28
  status = response.code
29
- body = JSON.parse(response.body)
30
- Response.new(status, body, status == 200 ? true : false)
29
+ if json?(response.body)
30
+ body = JSON.parse(response.body)
31
+ Response.new(status, body, status == 200)
32
+ else
33
+ Response.new(500, nil, false)
34
+ end
31
35
  end
32
36
  end
33
37
 
@@ -47,6 +51,13 @@ module Pusher
47
51
  Authorization: "Bearer #{secret_key}"
48
52
  }
49
53
  end
54
+
55
+ def json?(response)
56
+ JSON.parse(response)
57
+ true
58
+ rescue JSON::ParserError
59
+ false
60
+ end
50
61
  end
51
62
  end
52
63
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Pusher
4
4
  module PushNotifications
5
- VERSION = '0.3.0'
5
+ VERSION = '0.3.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pusher-push-notifications
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lucas Medeiros
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-04-10 00:00:00.000000000 Z
12
+ date: 2018-05-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: caze
@@ -230,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
230
230
  version: '0'
231
231
  requirements: []
232
232
  rubyforge_project:
233
- rubygems_version: 2.6.14
233
+ rubygems_version: 2.7.6
234
234
  signing_key:
235
235
  specification_version: 4
236
236
  summary: Pusher Push Notifications Ruby server SDK