yhsd_api 0.0.3

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.
Files changed (73) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +15 -0
  3. data/.travis.yml +5 -0
  4. data/ChangeLog.md +54 -0
  5. data/Gemfile +4 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +242 -0
  8. data/Rakefile +2 -0
  9. data/lib/yhsd_api/configuration.rb +48 -0
  10. data/lib/yhsd_api/exception.rb +41 -0
  11. data/lib/yhsd_api/helper.rb +78 -0
  12. data/lib/yhsd_api/http.rb +135 -0
  13. data/lib/yhsd_api/private_app.rb +114 -0
  14. data/lib/yhsd_api/public_app.rb +124 -0
  15. data/lib/yhsd_api/resources/account.rb +25 -0
  16. data/lib/yhsd_api/resources/asset.rb +37 -0
  17. data/lib/yhsd_api/resources/base.rb +25 -0
  18. data/lib/yhsd_api/resources/city.rb +25 -0
  19. data/lib/yhsd_api/resources/country.rb +25 -0
  20. data/lib/yhsd_api/resources/customer.rb +43 -0
  21. data/lib/yhsd_api/resources/customer_address.rb +43 -0
  22. data/lib/yhsd_api/resources/district.rb +25 -0
  23. data/lib/yhsd_api/resources/metafield.rb +55 -0
  24. data/lib/yhsd_api/resources/open_payment.rb +31 -0
  25. data/lib/yhsd_api/resources/order.rb +31 -0
  26. data/lib/yhsd_api/resources/page.rb +43 -0
  27. data/lib/yhsd_api/resources/payment.rb +25 -0
  28. data/lib/yhsd_api/resources/payment_method.rb +25 -0
  29. data/lib/yhsd_api/resources/product.rb +43 -0
  30. data/lib/yhsd_api/resources/product_image.rb +43 -0
  31. data/lib/yhsd_api/resources/product_variant.rb +43 -0
  32. data/lib/yhsd_api/resources/province.rb +25 -0
  33. data/lib/yhsd_api/resources/redirect.rb +43 -0
  34. data/lib/yhsd_api/resources/script_tag.rb +43 -0
  35. data/lib/yhsd_api/resources/shipment.rb +37 -0
  36. data/lib/yhsd_api/resources/shipment_supplier.rb +25 -0
  37. data/lib/yhsd_api/resources/shop.rb +13 -0
  38. data/lib/yhsd_api/resources/theme.rb +37 -0
  39. data/lib/yhsd_api/resources/webhook.rb +45 -0
  40. data/lib/yhsd_api/resources.rb +2 -0
  41. data/lib/yhsd_api/version.rb +3 -0
  42. data/lib/yhsd_api.rb +16 -0
  43. data/spec/configuration_spec.rb +49 -0
  44. data/spec/helper_spec.rb +75 -0
  45. data/spec/private_app_spec.rb +68 -0
  46. data/spec/public_app_spec.rb +93 -0
  47. data/spec/resources/account_spec.rb +31 -0
  48. data/spec/resources/asset_spec.rb +56 -0
  49. data/spec/resources/city_spec.rb +30 -0
  50. data/spec/resources/country_spec.rb +28 -0
  51. data/spec/resources/customer_address_spec.rb +66 -0
  52. data/spec/resources/customer_spec.rb +67 -0
  53. data/spec/resources/district_spec.rb +31 -0
  54. data/spec/resources/metafield_spec.rb +79 -0
  55. data/spec/resources/open_payment_spec.rb +40 -0
  56. data/spec/resources/order_spec.rb +41 -0
  57. data/spec/resources/page_spec.rb +54 -0
  58. data/spec/resources/payment_method_spec.rb +28 -0
  59. data/spec/resources/payment_spec.rb +29 -0
  60. data/spec/resources/product_image_spec.rb +59 -0
  61. data/spec/resources/product_spec.rb +123 -0
  62. data/spec/resources/product_variant_spec.rb +74 -0
  63. data/spec/resources/province_spec.rb +29 -0
  64. data/spec/resources/redirect_spec.rb +58 -0
  65. data/spec/resources/script_tag_spec.rb +54 -0
  66. data/spec/resources/shipment_spec.rb +43 -0
  67. data/spec/resources/shipment_supplier_spec.rb +31 -0
  68. data/spec/resources/shop_spec.rb +18 -0
  69. data/spec/resources/theme_spec.rb +38 -0
  70. data/spec/resources/webhook_spec.rb +54 -0
  71. data/spec/spec_helper.rb +9 -0
  72. data/yhsd_api.gemspec +26 -0
  73. metadata +217 -0
@@ -0,0 +1,59 @@
1
+ require 'spec_helper'
2
+
3
+ describe YhsdApi::ProductVariant do
4
+
5
+ before(:each) do
6
+ @token = '44e8d8f52062453b8fe7342c618d1aef'
7
+ YhsdApi.configure do |config|
8
+ config.call_limit_protect = true
9
+ end
10
+ @product_id = 1111
11
+ @id = 1028
12
+ end
13
+
14
+ it "get all product image must be success" do
15
+ code, body, header = YhsdApi::ProductImage.all(@token, @product_id)
16
+ expect([200, 422]).to include(code)
17
+ end
18
+
19
+ it "get all product image count must be success" do
20
+ code, body, header = YhsdApi::ProductImage.count(@token, @product_id)
21
+ expect([200, 422]).to include(code)
22
+ end
23
+
24
+ it "get single product image info must be success" do
25
+ params = {
26
+ :fields => 'id,name'
27
+ }
28
+ code, body, header = YhsdApi::ProductImage.find(@token, @product_id, @id, params)
29
+ expect([200, 422]).to include(code)
30
+ end
31
+
32
+ it "create a product image must be success" do
33
+ params = {
34
+ "image": {
35
+ "file_name": "商品图片-10098.jpg",
36
+ "attachment": "data:image/gif;base64,R0lGODlhAQABAID/AP///wAAACwAAAAAAQABAAACAkQBADs="
37
+ }
38
+ }
39
+ code, body, header = YhsdApi::ProductImage.create(@token, @product_id, params)
40
+ expect([200, 422]).to include(code)
41
+ end
42
+
43
+ it "update a product image must be success" do
44
+ params = {
45
+ "image": {
46
+ "alt": "自定义描述",
47
+ "file_name": "商品图片-98.jpg"
48
+ }
49
+ }
50
+ code, body, header = YhsdApi::ProductImage.update(@token, @product_id, @id, params)
51
+ expect([200, 422]).to include(code)
52
+ end
53
+
54
+ it "delete a product image must be success" do
55
+ code, body, header = YhsdApi::ProductImage.delete(@token, @product_id, 243)
56
+ expect([200, 422]).to include(code)
57
+ end
58
+
59
+ end
@@ -0,0 +1,123 @@
1
+ require 'spec_helper'
2
+
3
+ describe YhsdApi::Product do
4
+
5
+ before(:each) do
6
+ @token = '44e8d8f52062453b8fe7342c618d1aef'
7
+ YhsdApi.configure do |config|
8
+ config.call_limit_protect = true
9
+ end
10
+ @id = 1111
11
+ end
12
+
13
+ it "get all product must be success" do
14
+ code, body, header = YhsdApi::Product.all(@token)
15
+ expect([200, 422]).to include(code)
16
+ end
17
+
18
+ it "get all product count must be success" do
19
+ code, body, header = YhsdApi::Product.count(@token)
20
+ expect([200, 422]).to include(code)
21
+ end
22
+
23
+ it "get single product info must be success" do
24
+ params = {
25
+ :fields => 'id,name'
26
+ }
27
+ code, body, header = YhsdApi::Product.find(@token, @id, params)
28
+ expect([200, 422]).to include(code)
29
+ end
30
+
31
+ it "create a product must be success" do
32
+ params = {
33
+ "product": {
34
+ "name": "API商品样例",
35
+ "page_title": "API商品样例",
36
+ "page_description": "API商品样例",
37
+ "body_html": "<p>API商品样例</p>",
38
+ "vendor": {
39
+ "name": "商品品牌样例"
40
+ },
41
+ "types": [
42
+ {
43
+ "name": "商品分类1"
44
+ },
45
+ {
46
+ "name": "商品分类2"
47
+ }
48
+ ],
49
+ "options": [
50
+ {
51
+ "name": "颜色"
52
+ },
53
+ {
54
+ "name": "尺寸"
55
+ }
56
+ ],
57
+ "variants": [
58
+ {
59
+ "option_1": "白",
60
+ "option_2": "XL",
61
+ "option_3": nil,
62
+ "price": 10,
63
+ "compare_price": 0,
64
+ "stock": 9,
65
+ "sale": 0,
66
+ "weight": 40,
67
+ "volume": 0,
68
+ "barcode": "I2008X03",
69
+ "image_id": nil
70
+ },
71
+ {
72
+ "option_1": "白",
73
+ "option_2": "X",
74
+ "option_3": nil,
75
+ "price": 10,
76
+ "compare_price": 1000,
77
+ "stock": 9,
78
+ "sale": 0,
79
+ "weight": 40,
80
+ "volume": 0,
81
+ "barcode": "I2008X01",
82
+ "image_id": nil
83
+ },
84
+ {
85
+ "option_1": "黑",
86
+ "option_2": "XL",
87
+ "option_3": nil,
88
+ "price": 10.01,
89
+ "compare_price": 0,
90
+ "stock": 9,
91
+ "sale": 0,
92
+ "weight": 40,
93
+ "volume": 0,
94
+ "barcode": "I2008X02",
95
+ "image_id": nil
96
+ }
97
+ ]
98
+ }
99
+ }
100
+ code, body, header = YhsdApi::Product.create(@token, params)
101
+ expect([200, 422]).to include(code)
102
+ end
103
+
104
+ it "update a product must be success" do
105
+ params = {
106
+ "product": {
107
+ "types": [
108
+ {
109
+ "name": "商品分类3"
110
+ }
111
+ ]
112
+ }
113
+ }
114
+ code, body, header = YhsdApi::Product.update(@token, @id, params)
115
+ expect([200, 422]).to include(code)
116
+ end
117
+
118
+ it "delete a product must be success" do
119
+ code, body, header = YhsdApi::Product.delete(@token, 243)
120
+ expect([200, 422]).to include(code)
121
+ end
122
+
123
+ end
@@ -0,0 +1,74 @@
1
+ require 'spec_helper'
2
+
3
+ describe YhsdApi::ProductVariant do
4
+
5
+ before(:each) do
6
+ @token = '44e8d8f52062453b8fe7342c618d1aef'
7
+ YhsdApi.configure do |config|
8
+ config.call_limit_protect = true
9
+ end
10
+ @product_id = 1111
11
+ @id = 1375
12
+ end
13
+
14
+ it "get all product variant must be success" do
15
+ code, body, header = YhsdApi::ProductVariant.all(@token, @product_id)
16
+ expect([200, 422]).to include(code)
17
+ end
18
+
19
+ it "get all product count must be success" do
20
+ code, body, header = YhsdApi::ProductVariant.count(@token, @product_id)
21
+ expect([200, 422]).to include(code)
22
+ end
23
+
24
+ it "get single product variant info must be success" do
25
+ params = {
26
+ :fields => 'id,name'
27
+ }
28
+ code, body, header = YhsdApi::ProductVariant.find(@token, @product_id, @id, params)
29
+ expect([200, 422]).to include(code)
30
+ end
31
+
32
+ it "create a product variant must be success" do
33
+ params = {
34
+ "variant": {
35
+ "option_1": "白#{Random.rand(200)}",
36
+ "option_2": "萝卜",
37
+ "option_3": "XXL",
38
+ "price": Random.rand(200),
39
+ "compare_price": 0,
40
+ "stock": 9,
41
+ "weight": 4,
42
+ "volume": 1,
43
+ "barcode": "",
44
+ "image_id": nil
45
+ }
46
+ }
47
+ code, body, header = YhsdApi::ProductVariant.create(@token, @product_id, params)
48
+ expect([200, 422]).to include(code)
49
+ end
50
+
51
+ it "update a product variant must be success" do
52
+ params = {
53
+ "variant": {
54
+ "barcode": "IPSCCC0001",
55
+ "compare_price": Random.rand(200),
56
+ "option_1": "白#{Random.rand(200)}",
57
+ "option_2": "萝卜",
58
+ "option_3": "XXL",
59
+ "price": Random.rand(200),
60
+ "stock": 9,
61
+ "volume": 0,
62
+ "weight": 4
63
+ }
64
+ }
65
+ code, body, header = YhsdApi::ProductVariant.update(@token, @product_id, @id, params)
66
+ expect([200, 422]).to include(code)
67
+ end
68
+
69
+ it "delete a product variant must be success" do
70
+ code, body, header = YhsdApi::ProductVariant.delete(@token, @product_id, 243)
71
+ expect([200, 422]).to include(code)
72
+ end
73
+
74
+ end
@@ -0,0 +1,29 @@
1
+ require 'spec_helper'
2
+
3
+ describe YhsdApi::Province do
4
+
5
+ before(:each) do
6
+ @token = '44e8d8f52062453b8fe7342c618d1aef'
7
+ YhsdApi.configure do |config|
8
+ config.call_limit_protect = true
9
+ end
10
+ @country_id = 1
11
+ @id = 2
12
+ end
13
+
14
+ it "get all province must be success" do
15
+ code, body, header = YhsdApi::Province.all(@token, @country_id)
16
+ expect([200, 422]).to include(code)
17
+ end
18
+
19
+ it "get all province count must be success" do
20
+ code, body, header = YhsdApi::Province.count(@token, @country_id)
21
+ expect([200, 422]).to include(code)
22
+ end
23
+
24
+ it "get single province info" do
25
+ code, body, header = YhsdApi::Province.find(@token, @country_id, @id)
26
+ expect([200, 422]).to include(code)
27
+ end
28
+
29
+ end
@@ -0,0 +1,58 @@
1
+ require 'spec_helper'
2
+
3
+ describe YhsdApi::Redirect do
4
+
5
+ before(:each) do
6
+ @token = '44e8d8f52062453b8fe7342c618d1aef'
7
+ YhsdApi.configure do |config|
8
+ config.call_limit_protect = true
9
+ end
10
+ @id = 40
11
+ end
12
+
13
+ it "get all redirect must be success" do
14
+ code, body, header = YhsdApi::Redirect.all(@token)
15
+ expect([200, 422]).to include(code)
16
+ end
17
+
18
+ it "get all redirect count must be success" do
19
+ code, body, header = YhsdApi::Redirect.count(@token)
20
+ expect([200, 422]).to include(code)
21
+ end
22
+
23
+ it "get single redirect info must be success" do
24
+ params = {
25
+ :fields => 'id,name'
26
+ }
27
+ code, body, header = YhsdApi::Redirect.find(@token, @id, params)
28
+ expect([200, 422]).to include(code)
29
+ end
30
+
31
+ it "create a redirect must be success" do
32
+ params = {
33
+ "redirect": {
34
+ "path": "/#{Random.rand(2000)}",
35
+ "target": "/blogs"
36
+ }
37
+ }
38
+ code, body, header = YhsdApi::Redirect.create(@token, params)
39
+ expect([200, 422]).to include(code)
40
+ end
41
+
42
+ it "update a redirect must be success" do
43
+ params = {
44
+ "redirect": {
45
+ "path": "/12345",
46
+ "target": "/blogs"
47
+ }
48
+ }
49
+ code, body, header = YhsdApi::Redirect.update(@token, @id, params)
50
+ expect([200, 422]).to include(code)
51
+ end
52
+
53
+ it "delete a redirect must be success" do
54
+ code, body, header = YhsdApi::Redirect.delete(@token, 30)
55
+ expect([200, 422]).to include(code)
56
+ end
57
+
58
+ end
@@ -0,0 +1,54 @@
1
+ require 'spec_helper'
2
+
3
+ describe YhsdApi::ScriptTag do
4
+
5
+ before(:each) do
6
+ @token = '44e8d8f52062453b8fe7342c618d1aef'
7
+ YhsdApi.configure do |config|
8
+ config.call_limit_protect = true
9
+ end
10
+ @id = 12
11
+ end
12
+
13
+ it "get all script_tag must be success" do
14
+ code, body, header = YhsdApi::ScriptTag.all(@token)
15
+ expect([200, 422]).to include(code)
16
+ end
17
+
18
+ it "get all script_tag count must be success" do
19
+ code, body, header = YhsdApi::ScriptTag.count(@token)
20
+ expect([200, 422]).to include(code)
21
+ end
22
+
23
+ it "get single script_tag info" do
24
+ code, body, header = YhsdApi::ScriptTag.find(@token, @id)
25
+ expect([200, 422]).to include(code)
26
+ end
27
+
28
+ it "create a script_tag must be success" do
29
+ params = {
30
+ "script_tag": {
31
+ "event": "onload",
32
+ "src": "http://static.js.com/asset.js"
33
+ }
34
+ }
35
+ code, body, header = YhsdApi::ScriptTag.create(@token, params)
36
+ expect([200, 422]).to include(code)
37
+ end
38
+
39
+ it "update a script_tag must be success" do
40
+ params = {
41
+ "script_tag": {
42
+ "src": "http://change.js.com/asset.js"
43
+ }
44
+ }
45
+ code, body, header = YhsdApi::ScriptTag.update(@token, @id, params)
46
+ expect([200, 422]).to include(code)
47
+ end
48
+
49
+ it "delete a script_tag must be success" do
50
+ code, body, header = YhsdApi::ScriptTag.delete(@token, 1)
51
+ expect([200, 422]).to include(code)
52
+ end
53
+
54
+ end
@@ -0,0 +1,43 @@
1
+ require 'spec_helper'
2
+
3
+ describe YhsdApi::Shipment do
4
+
5
+ before(:each) do
6
+ @token = '44e8d8f52062453b8fe7342c618d1aef'
7
+ YhsdApi.configure do |config|
8
+ config.call_limit_protect = true
9
+ end
10
+ @id = 809
11
+ end
12
+
13
+ it "get all shipment must be success" do
14
+ code, body, header = YhsdApi::Shipment.all(@token)
15
+ expect([200, 422]).to include(code)
16
+ end
17
+
18
+ it "get all shipment count must be success" do
19
+ code, body, header = YhsdApi::Shipment.count(@token)
20
+ expect([200, 422]).to include(code)
21
+ end
22
+
23
+ it "get single shipment must be success" do
24
+ code, body, header = YhsdApi::Shipment.find(@token, @id)
25
+ expect([200, 422]).to include(code)
26
+ end
27
+
28
+ it "update shipment info must be success" do
29
+ params = {
30
+ "shipment": {
31
+ "shipment_supplier_id": 4
32
+ }
33
+ }
34
+ code, body, header = YhsdApi::Shipment.update(@token, @id, params)
35
+ expect([200, 422]).to include(code)
36
+ end
37
+
38
+ it "send shipment must be success" do
39
+ code, body, header = YhsdApi::Shipment.send(@token, @id)
40
+ expect([200, 422]).to include(code)
41
+ end
42
+
43
+ end
@@ -0,0 +1,31 @@
1
+ require 'spec_helper'
2
+
3
+ describe YhsdApi::ShipmentSupplier do
4
+
5
+ before(:each) do
6
+ @token = '44e8d8f52062453b8fe7342c618d1aef'
7
+ YhsdApi.configure do |config|
8
+ config.call_limit_protect = true
9
+ end
10
+ @id = 2
11
+ end
12
+
13
+ it "get all shipment supplier must be success" do
14
+ params = {
15
+ "limit" => 50
16
+ }
17
+ code, body, header = YhsdApi::ShipmentSupplier.all(@token, params)
18
+ expect([200, 422]).to include(code)
19
+ end
20
+
21
+ it "get all shipment supplier count must be success" do
22
+ code, body, header = YhsdApi::ShipmentSupplier.count(@token)
23
+ expect([200, 422]).to include(code)
24
+ end
25
+
26
+ it "get single shipment supplier must be success" do
27
+ code, body, header = YhsdApi::ShipmentSupplier.find(@token, @id)
28
+ expect([200, 422]).to include(code)
29
+ end
30
+
31
+ end
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+
3
+ describe YhsdApi::Shop do
4
+
5
+ before(:each) do
6
+ @token = '44e8d8f52062453b8fe7342c618d1aef'
7
+ YhsdApi.configure do |config|
8
+ config.call_limit_protect = true
9
+ end
10
+
11
+ end
12
+
13
+ it "get shop info will success" do
14
+ code, body, header = YhsdApi::Shop.info(@token)
15
+ expect([200, 422]).to include(code)
16
+ end
17
+
18
+ end
@@ -0,0 +1,38 @@
1
+ require 'spec_helper'
2
+
3
+ describe YhsdApi::Theme do
4
+
5
+ before(:each) do
6
+ @token = '44e8d8f52062453b8fe7342c618d1aef'
7
+ YhsdApi.configure do |config|
8
+ config.call_limit_protect = true
9
+ end
10
+ @id = 14130
11
+ end
12
+
13
+ it "get all theme info will success" do
14
+ code, body, header = YhsdApi::Theme.all(@token)
15
+ expect([200, 422]).to include(code)
16
+ end
17
+
18
+ it "get single theme info will success" do
19
+ code, body, header = YhsdApi::Theme.find(@token, @id)
20
+ expect([200, 422]).to include(code)
21
+ end
22
+
23
+ it "update a theme info will success" do
24
+ params = {
25
+ "theme": {
26
+ "name": "修改主题名#{Random.rand(100)}"
27
+ }
28
+ }
29
+ code, body, header = YhsdApi::Theme.update(@token, @id, params)
30
+ expect([200, 422]).to include(code)
31
+ end
32
+
33
+ it "delete a theme will success" do
34
+ code, body, header = YhsdApi::Theme.delete(@token, 1200)
35
+ expect([200, 422]).to include(code)
36
+ end
37
+
38
+ end
@@ -0,0 +1,54 @@
1
+ require 'spec_helper'
2
+
3
+ describe YhsdApi::Webhook do
4
+
5
+ before(:each) do
6
+ @token = '44e8d8f52062453b8fe7342c618d1aef'
7
+ YhsdApi.configure do |config|
8
+ config.call_limit_protect = true
9
+ end
10
+ @id = 31
11
+ end
12
+
13
+ it "get all webhook must be success" do
14
+ code, body, header = YhsdApi::Webhook.all(@token)
15
+ expect([200, 422]).to include(code)
16
+ end
17
+
18
+ it "get all webhook count must be success" do
19
+ code, body, header = YhsdApi::Webhook.count(@token)
20
+ expect([200, 422]).to include(code)
21
+ end
22
+
23
+ it "get single webhook info must be success" do
24
+ code, body, header = YhsdApi::Webhook.find(@token, @id)
25
+ expect([200, 422]).to include(code)
26
+ end
27
+
28
+ it "create a webhook must be success" do
29
+ params = {
30
+ "webhook": {
31
+ "address": "http://www.example.com/create_product",
32
+ "topic": "products/create"
33
+ }
34
+ }
35
+ code, body, header = YhsdApi::Webhook.create(@token, params)
36
+ expect([200, 422]).to include(code)
37
+ end
38
+
39
+ it "update a webhook must be success" do
40
+ params = {
41
+ "webhook": {
42
+ "address": "http://www.example.com/create_product_1"
43
+ }
44
+ }
45
+ code, body, header = YhsdApi::Webhook.update(@token, @id, params)
46
+ expect([200, 422]).to include(code)
47
+ end
48
+
49
+ it "delete a webhook must be success" do
50
+ code, body, header = YhsdApi::Webhook.delete(@token, 21)
51
+ expect([200, 422]).to include(code)
52
+ end
53
+
54
+ end
@@ -0,0 +1,9 @@
1
+ require 'bundler/setup'
2
+
3
+ Bundler.setup
4
+
5
+ require 'yhsd_api'
6
+
7
+ RSpec.configure do |config|
8
+
9
+ end
data/yhsd_api.gemspec ADDED
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'yhsd_api/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "yhsd_api"
8
+ spec.version = YhsdApi::VERSION
9
+ spec.authors = ["jinhua"]
10
+ spec.email = ["kg19902933@gmail.com"]
11
+ spec.summary = %q{The youhaosuda API gem provide developers quick use public API, Just need to do the configuration section.}
12
+ spec.description = %q{The youhaosuda API gem provide developers quick use public API, Just need to do the configuration section.}
13
+ spec.homepage = "https://www.youhaosuda.com"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.7"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ spec.add_development_dependency "rspec"
24
+ spec.add_runtime_dependency "rest-client"
25
+ spec.add_runtime_dependency "oj"
26
+ end