leancloud-ruby-client 0.1.0 → 0.1.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
2
  SHA1:
3
- metadata.gz: 3617333f35eb6f4b3a8aa0cba846a6535e09fa8b
4
- data.tar.gz: 4dd626cd22ccc2bfca31a8dbf796ed5e1c47c498
3
+ metadata.gz: f0f6ddb7c9aaecf3d268f9e43746e9bfb0324cbb
4
+ data.tar.gz: 919c6d72c97159bb8f972a83e7d92a9fe5a36c03
5
5
  SHA512:
6
- metadata.gz: 02f350d181fe0cfa4fe1e0b6d5096ebae8af189ead246e81eb55aea4b2f735da2b6738d1f5ba804e3a65ff1bf4cf0033c544db92cb97468cb6ace653d72d2a00
7
- data.tar.gz: 250894fa5df07bf30a2b4dad1cad27cd122af0080a231c4a72512169fa339307b60e63987cf30656667d3576aa4289a983973a3f5e66a3c075a8f6779c8538ee
6
+ metadata.gz: 4c5f6180c128109f51ede16c3d01e3bc114d9942ee2cd248b89ccf6c9016f3506e1909081e0e2d6bfaf154316455f8cdc9736501c26d342d43e3d5c1aac4c79a
7
+ data.tar.gz: 5fe2099925c23e41d0b5fbf60df9329ee75a84d9dbfafea733f37ce87bde139bf91a12f725094c1b7527b314eeb25aa1b454f0bb3e09962643dedcbd56ed0c38
data/README.md CHANGED
@@ -4,7 +4,7 @@ leancloud-ruby-client 从 [parse-ruby-client](https://github.com/adelevie/parse-
4
4
 
5
5
  除了简单的重命名和调用地址改动之外,还做了下列事情:
6
6
 
7
- * 增加短信 API `AV::Cloud.request_sms_code(params)`
7
+ * 增加短信 API `AV::Cloud.request_sms(params)` 和 `AV::Cloud.verify_sms_code(phone, code)`
8
8
  * 增加 CQL 调用 `AV::Query.do_cloud_query(cql, pvalues)`
9
9
  * 其他兼容性改进和测试,特别是文件
10
10
  * 推送增加可以指定 iOS 生产或者测试证书功能 `production` 属性,值为 `true/false`。
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -45,4 +45,47 @@ http_interactions:
45
45
  string: '{}'
46
46
  http_version:
47
47
  recorded_at: Fri, 10 Apr 2015 09:57:10 GMT
48
+ - request:
49
+ method: post
50
+ uri: https://api.leancloud.cn/1.1/verifySmsCode/123456
51
+ body:
52
+ encoding: UTF-8
53
+ string: '{"mobilePhoneNumber":"18668012283"}'
54
+ headers:
55
+ User-Agent:
56
+ - Parse for Ruby, 0.0
57
+ Content-Type:
58
+ - application/json
59
+ X-Avoscloud-Application-Id:
60
+ - <X-AVOSCloud-Application-Id>
61
+ X-Avoscloud-Application-Key:
62
+ - <X-AVOSCloud-Application-Key>
63
+ Accept-Encoding:
64
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
65
+ Accept:
66
+ - '*/*'
67
+ response:
68
+ status:
69
+ code: 400
70
+ message: Bad Request
71
+ headers:
72
+ Server:
73
+ - Tengine
74
+ Date:
75
+ - Tue, 16 Jun 2015 08:19:09 GMT
76
+ Content-Type:
77
+ - application/json;charset=utf-8
78
+ Content-Length:
79
+ - '71'
80
+ Connection:
81
+ - keep-alive
82
+ Cache-Control:
83
+ - no-cache,no-store
84
+ Pragma:
85
+ - no-cache
86
+ body:
87
+ encoding: UTF-8
88
+ string: '{"code":603,"error":"\u65e0\u6548\u7684\u77ed\u4fe1\u9a8c\u8bc1\u7801"}'
89
+ http_version:
90
+ recorded_at: Tue, 16 Jun 2015 08:19:09 GMT
48
91
  recorded_with: VCR 2.4.0
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "leancloud-ruby-client"
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Alan deLevie", "Adam Alpern", "Dennis Zhuang"]
12
- s.date = "2015-04-10"
12
+ s.date = "2015-06-16"
13
13
  s.description = "A simple Ruby client for the leancloud.cn REST API"
14
14
  s.email = "killme2008@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -21,8 +21,12 @@ module AV
21
21
  end
22
22
 
23
23
  def self.request_sms(params)
24
- response = AV.client.post("/#{Protocol::VERSION}/requestSmsCode", params.to_json)
25
- return response == {}
24
+ AV.client.post("/#{Protocol::VERSION}/requestSmsCode", params.to_json)
25
+ end
26
+
27
+ def self.verify_sms_code(phone, code)
28
+ params = { mobilePhoneNumber: phone}
29
+ AV.client.post("/#{Protocol::VERSION}/verifySmsCode/#{code}", params.to_json)
26
30
  end
27
31
  end
28
32
  end
data/test/test_cloud.rb CHANGED
@@ -14,7 +14,8 @@ class TestCloud < AVTestCase
14
14
 
15
15
  def test_request_sms
16
16
  VCR.use_cassette('test_request_sms', :record => :new_episodes) do
17
- assert_true AV::Cloud.request_sms :mobilePhoneNumber => "18668012283",:op => "test",:ttl => 5
17
+ assert_equal (AV::Cloud.request_sms :mobilePhoneNumber => "18668012283",:op => "test",:ttl => 5), {}
18
+ puts AV::Cloud.verify_sms_code('18668012283', '123456').inspect
18
19
  end
19
20
  end
20
21
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leancloud-ruby-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alan deLevie
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-04-10 00:00:00.000000000 Z
13
+ date: 2015-06-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday