baidu_lbs 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +31 -0
  6. data/Rakefile +9 -0
  7. data/baidu_lbs.gemspec +30 -0
  8. data/lib/baidu_lbs/client.rb +7 -0
  9. data/lib/baidu_lbs/configurable.rb +17 -0
  10. data/lib/baidu_lbs/geo_data/column.rb +25 -0
  11. data/lib/baidu_lbs/geo_data/geotable.rb +31 -0
  12. data/lib/baidu_lbs/geo_data/job.rb +13 -0
  13. data/lib/baidu_lbs/geo_data/poi.rb +30 -0
  14. data/lib/baidu_lbs/geo_search.rb +20 -0
  15. data/lib/baidu_lbs/request.rb +39 -0
  16. data/lib/baidu_lbs/version.rb +3 -0
  17. data/lib/baidu_lbs.rb +13 -0
  18. data/test/baidu_lbs/geodata/column_test.rb +49 -0
  19. data/test/baidu_lbs/geodata/geotable_test.rb +44 -0
  20. data/test/baidu_lbs/geodata/job_test.rb +19 -0
  21. data/test/baidu_lbs/geodata/poi_test.rb +54 -0
  22. data/test/baidu_lbs/version_test.rb +8 -0
  23. data/test/fixtures/poi_list.csv +1 -0
  24. data/test/fixtures/vcr_cassettes/geo_search_test.rb +5 -0
  25. data/test/fixtures/vcr_cassettes/geodata/column/create.yml +51 -0
  26. data/test/fixtures/vcr_cassettes/geodata/column/delete.yml +51 -0
  27. data/test/fixtures/vcr_cassettes/geodata/column/detail.yml +50 -0
  28. data/test/fixtures/vcr_cassettes/geodata/column/list.yml +50 -0
  29. data/test/fixtures/vcr_cassettes/geodata/column/update.yml +51 -0
  30. data/test/fixtures/vcr_cassettes/geodata/geotable/create.yml +51 -0
  31. data/test/fixtures/vcr_cassettes/geodata/geotable/delete.yml +51 -0
  32. data/test/fixtures/vcr_cassettes/geodata/geotable/detail.yml +50 -0
  33. data/test/fixtures/vcr_cassettes/geodata/geotable/list.yml +50 -0
  34. data/test/fixtures/vcr_cassettes/geodata/geotable/update.yml +51 -0
  35. data/test/fixtures/vcr_cassettes/geodata/job/detail.yml +49 -0
  36. data/test/fixtures/vcr_cassettes/geodata/job/list.yml +56 -0
  37. data/test/fixtures/vcr_cassettes/geodata/poi/create.yml +51 -0
  38. data/test/fixtures/vcr_cassettes/geodata/poi/delete.yml +50 -0
  39. data/test/fixtures/vcr_cassettes/geodata/poi/detail.yml +50 -0
  40. data/test/fixtures/vcr_cassettes/geodata/poi/list.yml +52 -0
  41. data/test/fixtures/vcr_cassettes/geodata/poi/update.yml +51 -0
  42. data/test/fixtures/vcr_cassettes/geodata/poi/upload.yml +65 -0
  43. data/test/test_helper.rb +15 -0
  44. metadata +210 -0
@@ -0,0 +1,51 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://api.map.baidu.com/geodata/v3/poi/update
6
+ body:
7
+ encoding: UTF-8
8
+ string: ak=KmMATCZL0fakL8XkCWZsuS0K&geotable_id=78835&id=499219466&title=cool_poi
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.0
12
+ Content-Type:
13
+ - application/x-www-form-urlencoded
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Http-X-Bd-Logid:
24
+ - '2715158707'
25
+ Http-X-Bd-Logid64:
26
+ - '7221380810980043122'
27
+ Http-X-Bd-Product:
28
+ - map
29
+ Http-X-Bd-Subsys:
30
+ - apimap
31
+ Set-Cookie:
32
+ - BAIDUID=7AEBE492210E2B2AE6FDD2D88AF7B89E:FG=1; max-age=31536000; expires=Sat,
33
+ 19-Sep-15 18:13:00 GMT; domain=.baidu.com; path=/; version=1
34
+ P3p:
35
+ - CP=" OTI DSP COR IVA OUR IND COM "
36
+ Content-Type:
37
+ - text/javascript; charset=UTF-8
38
+ Vary:
39
+ - Accept-Encoding
40
+ Content-Length:
41
+ - '72'
42
+ Date:
43
+ - Fri, 19 Sep 2014 18:13:00 GMT
44
+ Server:
45
+ - apache
46
+ body:
47
+ encoding: UTF-8
48
+ string: '{"status":0,"id":499219466,"message":"\u6210\u529f"}'
49
+ http_version:
50
+ recorded_at: Fri, 19 Sep 2014 18:13:01 GMT
51
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,65 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://api.map.baidu.com/geodata/v3/poi/upload
6
+ body:
7
+ encoding: ASCII-8BIT
8
+ string: !binary |-
9
+ LS0tLS0tLS0tLS0tLVJ1YnlNdWx0aXBhcnRQb3N0DQpDb250ZW50LURpc3Bv
10
+ c2l0aW9uOiBmb3JtLWRhdGE7IG5hbWU9Imdlb3RhYmxlX2lkIg0KDQo3ODgz
11
+ NQ0KLS0tLS0tLS0tLS0tLVJ1YnlNdWx0aXBhcnRQb3N0DQpDb250ZW50LURp
12
+ c3Bvc2l0aW9uOiBmb3JtLWRhdGE7IG5hbWU9InBvaV9saXN0IjsgZmlsZW5h
13
+ bWU9InBvaV9saXN0LmNzdiINCkNvbnRlbnQtTGVuZ3RoOiAyOQ0KQ29udGVu
14
+ dC1UeXBlOiBhcHBsaWNhdGlvbi9jc3YNCkNvbnRlbnQtVHJhbnNmZXItRW5j
15
+ b2Rpbmc6IGJpbmFyeQ0KDQphd2Vzb21lX3BvaSzmtZnmsZ8sMTAwLDEwMCwx
16
+ Cg0KLS0tLS0tLS0tLS0tLVJ1YnlNdWx0aXBhcnRQb3N0DQpDb250ZW50LURp
17
+ c3Bvc2l0aW9uOiBmb3JtLWRhdGE7IG5hbWU9ImFrIg0KDQpLbU1BVENaTDBm
18
+ YWtMOFhrQ1dac3VTMEsNCi0tLS0tLS0tLS0tLS1SdWJ5TXVsdGlwYXJ0UG9z
19
+ dC0tDQoNCg==
20
+ headers:
21
+ User-Agent:
22
+ - Faraday v0.9.0
23
+ Content-Type:
24
+ - multipart/form-data; boundary=-----------RubyMultipartPost
25
+ Content-Length:
26
+ - '457'
27
+ Accept-Encoding:
28
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
29
+ Accept:
30
+ - "*/*"
31
+ response:
32
+ status:
33
+ code: 200
34
+ message: OK
35
+ headers:
36
+ Http-X-Bd-Logid:
37
+ - '1312357144'
38
+ Http-X-Bd-Logid64:
39
+ - '3481408162793458727'
40
+ Http-X-Bd-Product:
41
+ - map
42
+ Http-X-Bd-Subsys:
43
+ - apimap
44
+ Set-Cookie:
45
+ - BAIDUID=1DCFC5615AFEE0E0DC7C68C3C4A70EC0:FG=1; max-age=31536000; expires=Sat,
46
+ 19-Sep-15 17:58:56 GMT; domain=.baidu.com; path=/; version=1
47
+ P3p:
48
+ - CP=" OTI DSP COR IVA OUR IND COM "
49
+ Content-Type:
50
+ - text/javascript; charset=UTF-8
51
+ Vary:
52
+ - Accept-Encoding
53
+ Transfer-Encoding:
54
+ - chunked
55
+ Date:
56
+ - Fri, 19 Sep 2014 17:58:56 GMT
57
+ Server:
58
+ - apache
59
+ body:
60
+ encoding: UTF-8
61
+ string: '{"status":0,"job_id":"541c6ee0ba6000ac648b4567","total":0,"time":0,"message":"\u6587\u4ef6\u4e0a\u4f20\u6210\u529f,
62
+ \u53ef\u4ee5\u6839\u636ejob_id\u5229\u7528job\u7684listimportdata\u63a5\u53e3\u67e5\u8be2job\u7684\u72b6\u6001\uff0c\u5177\u4f53\u8bf7\u53c2\u8003\u5b98\u7f51\u6587\u6863"}'
63
+ http_version:
64
+ recorded_at: Fri, 19 Sep 2014 17:58:56 GMT
65
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,15 @@
1
+ require 'minitest/autorun'
2
+ require 'baidu_lbs'
3
+ require 'vcr'
4
+
5
+
6
+ BaiduLBS.configure do |config|
7
+ config.ak = 'KmMATCZL0fakL8XkCWZsuS0K'
8
+ end
9
+
10
+
11
+ VCR.configure do |config|
12
+ config.cassette_library_dir = 'test/fixtures/vcr_cassettes'
13
+ config.hook_into :webmock
14
+ end
15
+
metadata ADDED
@@ -0,0 +1,210 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: baidu_lbs
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Meck
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-09-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: faraday
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.9.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.9.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: faraday_middleware
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.9.1
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.9.1
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.7'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.7'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '10.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '10.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: minitest
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 5.4.1
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 5.4.1
83
+ - !ruby/object:Gem::Dependency
84
+ name: vcr
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 2.9.3
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 2.9.3
97
+ - !ruby/object:Gem::Dependency
98
+ name: webmock
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 1.18.0
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 1.18.0
111
+ description: Baidu LBS ruby wrapper
112
+ email:
113
+ - yesmeck@gmail.com
114
+ executables: []
115
+ extensions: []
116
+ extra_rdoc_files: []
117
+ files:
118
+ - ".gitignore"
119
+ - Gemfile
120
+ - LICENSE.txt
121
+ - README.md
122
+ - Rakefile
123
+ - baidu_lbs.gemspec
124
+ - lib/baidu_lbs.rb
125
+ - lib/baidu_lbs/client.rb
126
+ - lib/baidu_lbs/configurable.rb
127
+ - lib/baidu_lbs/geo_data/column.rb
128
+ - lib/baidu_lbs/geo_data/geotable.rb
129
+ - lib/baidu_lbs/geo_data/job.rb
130
+ - lib/baidu_lbs/geo_data/poi.rb
131
+ - lib/baidu_lbs/geo_search.rb
132
+ - lib/baidu_lbs/request.rb
133
+ - lib/baidu_lbs/version.rb
134
+ - test/baidu_lbs/geodata/column_test.rb
135
+ - test/baidu_lbs/geodata/geotable_test.rb
136
+ - test/baidu_lbs/geodata/job_test.rb
137
+ - test/baidu_lbs/geodata/poi_test.rb
138
+ - test/baidu_lbs/version_test.rb
139
+ - test/fixtures/poi_list.csv
140
+ - test/fixtures/vcr_cassettes/geo_search_test.rb
141
+ - test/fixtures/vcr_cassettes/geodata/column/create.yml
142
+ - test/fixtures/vcr_cassettes/geodata/column/delete.yml
143
+ - test/fixtures/vcr_cassettes/geodata/column/detail.yml
144
+ - test/fixtures/vcr_cassettes/geodata/column/list.yml
145
+ - test/fixtures/vcr_cassettes/geodata/column/update.yml
146
+ - test/fixtures/vcr_cassettes/geodata/geotable/create.yml
147
+ - test/fixtures/vcr_cassettes/geodata/geotable/delete.yml
148
+ - test/fixtures/vcr_cassettes/geodata/geotable/detail.yml
149
+ - test/fixtures/vcr_cassettes/geodata/geotable/list.yml
150
+ - test/fixtures/vcr_cassettes/geodata/geotable/update.yml
151
+ - test/fixtures/vcr_cassettes/geodata/job/detail.yml
152
+ - test/fixtures/vcr_cassettes/geodata/job/list.yml
153
+ - test/fixtures/vcr_cassettes/geodata/poi/create.yml
154
+ - test/fixtures/vcr_cassettes/geodata/poi/delete.yml
155
+ - test/fixtures/vcr_cassettes/geodata/poi/detail.yml
156
+ - test/fixtures/vcr_cassettes/geodata/poi/list.yml
157
+ - test/fixtures/vcr_cassettes/geodata/poi/update.yml
158
+ - test/fixtures/vcr_cassettes/geodata/poi/upload.yml
159
+ - test/test_helper.rb
160
+ homepage: https://github.com/yesmeck/baidu_lbs
161
+ licenses:
162
+ - MIT
163
+ metadata: {}
164
+ post_install_message:
165
+ rdoc_options: []
166
+ require_paths:
167
+ - lib
168
+ required_ruby_version: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - ">="
171
+ - !ruby/object:Gem::Version
172
+ version: '0'
173
+ required_rubygems_version: !ruby/object:Gem::Requirement
174
+ requirements:
175
+ - - ">="
176
+ - !ruby/object:Gem::Version
177
+ version: '0'
178
+ requirements: []
179
+ rubyforge_project:
180
+ rubygems_version: 2.2.2
181
+ signing_key:
182
+ specification_version: 4
183
+ summary: Baidu LBS ruby wrapper
184
+ test_files:
185
+ - test/baidu_lbs/geodata/column_test.rb
186
+ - test/baidu_lbs/geodata/geotable_test.rb
187
+ - test/baidu_lbs/geodata/job_test.rb
188
+ - test/baidu_lbs/geodata/poi_test.rb
189
+ - test/baidu_lbs/version_test.rb
190
+ - test/fixtures/poi_list.csv
191
+ - test/fixtures/vcr_cassettes/geo_search_test.rb
192
+ - test/fixtures/vcr_cassettes/geodata/column/create.yml
193
+ - test/fixtures/vcr_cassettes/geodata/column/delete.yml
194
+ - test/fixtures/vcr_cassettes/geodata/column/detail.yml
195
+ - test/fixtures/vcr_cassettes/geodata/column/list.yml
196
+ - test/fixtures/vcr_cassettes/geodata/column/update.yml
197
+ - test/fixtures/vcr_cassettes/geodata/geotable/create.yml
198
+ - test/fixtures/vcr_cassettes/geodata/geotable/delete.yml
199
+ - test/fixtures/vcr_cassettes/geodata/geotable/detail.yml
200
+ - test/fixtures/vcr_cassettes/geodata/geotable/list.yml
201
+ - test/fixtures/vcr_cassettes/geodata/geotable/update.yml
202
+ - test/fixtures/vcr_cassettes/geodata/job/detail.yml
203
+ - test/fixtures/vcr_cassettes/geodata/job/list.yml
204
+ - test/fixtures/vcr_cassettes/geodata/poi/create.yml
205
+ - test/fixtures/vcr_cassettes/geodata/poi/delete.yml
206
+ - test/fixtures/vcr_cassettes/geodata/poi/detail.yml
207
+ - test/fixtures/vcr_cassettes/geodata/poi/list.yml
208
+ - test/fixtures/vcr_cassettes/geodata/poi/update.yml
209
+ - test/fixtures/vcr_cassettes/geodata/poi/upload.yml
210
+ - test/test_helper.rb