zipcode_zh_cn 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b27c2dc5d4e769bddafc8383d21109074bd3c79e
4
- data.tar.gz: b0da1cd4e31a9e16911a897dc6ad61251f6e4666
3
+ metadata.gz: fb9415dd4e87146c69e406bf2c6c257b739ce98d
4
+ data.tar.gz: 3786053325166afb4fd63b2de5ac05eb3bebe109
5
5
  SHA512:
6
- metadata.gz: 05008eaa280cf12726693007602f80443d9d1ec20cb2da4c083ef45ec74829e606b64fa9c501a44af12c728bbd56e0614e65fef5495e0575d9454097e2c61b8d
7
- data.tar.gz: 4a639ac0ef9246bb1e7c2e07447fdb976d30358984e85cfca46a5d41cde1a4d21ec29fc265cbdb78ab39c257909af6c9caf0ff74878722fa5c87bb3bae2b64cb
6
+ metadata.gz: 3e7a0c638a4aee1d0ccbb53e6f6aa9653c1894c03fe7c8888c200e9106f4fa325f283dbc80cc7728d90bb03839ffab24dd0c201a23fdc093c5192cb516c106ea
7
+ data.tar.gz: 610da2332a98acd0fb5352a33661e5aa03a876fa140ffa8e2036c2773eb17d5d49eb19a3352c9d13ae5a55d0b484e50546c8424617cc59fca704395e59bd4c8c
data/README.md CHANGED
@@ -13,6 +13,7 @@ ZipcodeZhCn.get_zip_code("your address")
13
13
  或者命令行:
14
14
 
15
15
  $ ZipcodeZhCN 昆山市
16
+ 215300
16
17
 
17
18
 
18
19
  ## Thanks
data/exe/ZipcodeZhCN ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "zipcode_zh_cn"
4
+
5
+ if ARGV && ARGV.size > 0
6
+ addr = ARGV[ 0 ].dup
7
+ zipcode = ZipcodeZhCn.get_zipcode(addr)
8
+ puts zipcode
9
+ else
10
+ puts "请输入您要查询的地址(只支持中国大陆地址)"
11
+ end
@@ -1,3 +1,3 @@
1
1
  module ZipcodeZhCn
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/zipcode_zh_cn.rb CHANGED
@@ -10,9 +10,8 @@ module ZipcodeZhCn
10
10
  DefaultZipCode = ""
11
11
 
12
12
  ## get zipcode by address string
13
- def self.get_zipcode(str, http = HTTP)
13
+ def self.get_zipcode(addr, http = HTTP)
14
14
  #special handle
15
- addr = str
16
15
  addr.gsub!('省直辖行政单位','')
17
16
  addr.gsub!('省直辖县级行政单位','')
18
17
  addr.gsub!('自治区直辖县级行政区划','')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zipcode_zh_cn
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
  - rubycat
@@ -83,7 +83,8 @@ dependencies:
83
83
  description: 'Zipcode data is fetched from Baidu '
84
84
  email:
85
85
  - chenxueping1819@gmail.com
86
- executables: []
86
+ executables:
87
+ - ZipcodeZhCN
87
88
  extensions: []
88
89
  extra_rdoc_files: []
89
90
  files:
@@ -96,6 +97,7 @@ files:
96
97
  - Rakefile
97
98
  - bin/console
98
99
  - bin/setup
100
+ - exe/ZipcodeZhCN
99
101
  - lib/zipcode_zh_cn.rb
100
102
  - lib/zipcode_zh_cn/version.rb
101
103
  - zipcode_zh_cn.gemspec