chinacity 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +45 -0
- data/Rakefile +1 -0
- data/areas.csv +3516 -0
- data/areas.json +14068 -0
- data/bin/chinacity +6 -0
- data/chinacity.gemspec +27 -0
- data/lib/chinacity/cli.rb +107 -0
- data/lib/chinacity/version.rb +3 -0
- data/lib/chinacity.rb +28 -0
- metadata +140 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 6c20e53e1d7c0c5baa1c7a65db6fc0652f0b2720
|
4
|
+
data.tar.gz: d16986e754e8dab7791477ac04bb2a3e2aff1df9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f2d7ca2d97496a7b8b350dcdfebcc8d48cd49f77b1e9ae0fb20ba8242861914f99d7d89a9c3d40b815ca87719a720a7f1b6f22aee4677f8b10507d39d5f42823
|
7
|
+
data.tar.gz: 130877256dd2a75c24a309c45c0347597463b97bc88e7bdde1e974140342c19b5a863f43d011bf8446bd324ce16072a03a5c6c0689d5f980c61633f0a7e0f79b
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Ryan Wang
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# Chinacity
|
2
|
+
|
3
|
+
Get the lastest China cities data from official site.
|
4
|
+
Output is supporting json and csv format.
|
5
|
+
Json format is totally compatible with the areas.json data of gem `china_city`.
|
6
|
+
|
7
|
+
Also support output the short yinpin name of city name, like `BJS` for `北京市`.
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
Add this line to your application's Gemfile:
|
12
|
+
|
13
|
+
gem 'chinacity'
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install chinacity
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
Check out the command help with
|
26
|
+
|
27
|
+
$ chinacity --help
|
28
|
+
|
29
|
+
Usage: chinacity [options]
|
30
|
+
|
31
|
+
options:
|
32
|
+
-s, --short Short name, First charactor of every word in pinyin
|
33
|
+
-c, --csv Output CSV format
|
34
|
+
|
35
|
+
Output China cities data to a json file. The format is totally compatible with https://github.com/saberma/china_city/blob/master/db/areas.json
|
36
|
+
|
37
|
+
$ chinacity > areas.json
|
38
|
+
|
39
|
+
## Contributing
|
40
|
+
|
41
|
+
1. Fork it ( http://github.com/<my-github-username>/chinacity/fork )
|
42
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
43
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
44
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
45
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|