umeng_push 0.0.1 → 0.0.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: ec75725da1a80dd8525417c31f0a1f7cb626d70b
4
- data.tar.gz: 195ffb32fd8984c1a5623c043d222274206dea17
3
+ metadata.gz: cc87ad2a6c763dfc7cca4769ba9f633f006267e9
4
+ data.tar.gz: d58be3dc5ae33cfd363f96d10cb8048d01792121
5
5
  SHA512:
6
- metadata.gz: 7749517290d6563f197a7db2c964b0f067b11620d22fd3b443bdfb384e13a8e33d53151a9f58c817c0e08d246dceaefadb7ea607f021f6f10c60799a5ccac37d
7
- data.tar.gz: af14130cdab8f5e1fb946818612e2df0f21ca1c82981af60ce9026f13e5a4b62d45ef44343be267aeb5a76ce0901396ccee4a4ce4c7c7f423f7012333cb9b8a4
6
+ metadata.gz: 3ee7b28e99ad191eedb1bb6af7b91126a63fb582ab6a57691cac3a8d1eee348214ec6bdecd4de7b332fd6a6d81d9bda6f0a74557c7bb1f39c37ef2971da7edb9
7
+ data.tar.gz: be1b02e9c938d13c310428280c9265a15b91df87c614f616f8438cfc1b4fc14300dc53d1241858c49d6003a7659fe4f59f0c705a2b1bbd396742f92d507c3bf2
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
1
  /.bundle/
2
2
  /Gemfile.lock
3
3
  /tmp/
4
+ *.gem
data/README.md CHANGED
@@ -19,18 +19,30 @@ Or install it yourself as:
19
19
  $ gem install umeng_push
20
20
 
21
21
  ## Usage
22
- rails generate umeng_push:install
23
- UmengPush::Client.iOS.send_message(options)
24
- UmengPush::Client.android.send_message(options)
25
- UmengPush::Client.iOS.unicast(device_token, options)
26
- UmengPush::Client.iOS.listcast(device_tokens, options)
27
- UmengPush::Client.iOS.broadcast(options)
28
- UmengPush::Client.iOS.groupcast(filter, options)
29
- UmengPush::Client.iOS.check_task(task_id)
30
- UmengPush::Client.iOS.cancel_task(task_id)
31
- 推送相关options参数请参看官方文档
32
- 返回结果失败 则抛出错误UmengPush::ResponseError
33
- 默认请求超时是3秒
22
+
23
+ rails generate umeng_push:install
24
+
25
+ UmengPush::Client.iOS.send_message(options)
26
+
27
+ UmengPush::Client.android.send_message(options)
28
+
29
+ UmengPush::Client.iOS.unicast(device_token, options)
30
+
31
+ UmengPush::Client.iOS.listcast(device_tokens, options)
32
+
33
+ UmengPush::Client.iOS.broadcast(options)
34
+
35
+ UmengPush::Client.iOS.groupcast(filter, options)
36
+
37
+ UmengPush::Client.iOS.check_task(task_id)
38
+
39
+ UmengPush::Client.iOS.cancel_task(task_id)
40
+
41
+ 推送相关options参数请参看官方文档
42
+
43
+ 返回结果失败 则抛出错误UmengPush::ResponseError
44
+
45
+ 默认请求超时是3秒
34
46
 
35
47
  ## Development
36
48
 
@@ -93,16 +93,12 @@ module UmengPush
93
93
  params = compact_params(payload)
94
94
  sign = sign(url, params)
95
95
  response = nil
96
- begin
97
- request = HTTPI::Request.new
98
- request.url = "#{UmengPush::HOST}#{url}?sign=#{sign}"
99
- request.open_timeout = 3
100
- request.read_timeout = 3
101
- request.body = params.to_json
102
- response = HTTPI.post(request)
103
- rescue => e
104
- raise ResponseError.new("0", data: {}, message: e.message)
105
- end
96
+ request = HTTPI::Request.new
97
+ request.url = "#{UmengPush::HOST}#{url}?sign=#{sign}"
98
+ request.open_timeout = 5
99
+ request.read_timeout = 5
100
+ request.body = params.to_json
101
+ response = HTTPI.post(request)
106
102
  response_body_json = JSON.load(response.body)
107
103
  check_response!(response_body_json)
108
104
  response_body_json
@@ -1,3 +1,3 @@
1
1
  module UmengPush
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: umeng_push
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - zhanglinjie
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-24 00:00:00.000000000 Z
11
+ date: 2016-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpi
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  version: '0'
124
124
  requirements: []
125
125
  rubyforge_project:
126
- rubygems_version: 2.5.1
126
+ rubygems_version: 2.5.2
127
127
  signing_key:
128
128
  specification_version: 4
129
129
  summary: The encapsulation of umeng push api.