zipcode_zh_cn 0.1.1 → 0.1.2

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: fb9415dd4e87146c69e406bf2c6c257b739ce98d
4
- data.tar.gz: 3786053325166afb4fd63b2de5ac05eb3bebe109
3
+ metadata.gz: 8725460f66564a24abce078739ffc37ff124785a
4
+ data.tar.gz: a7d8cf2acc0513037ecfe9ab91ace587c43f50fb
5
5
  SHA512:
6
- metadata.gz: 3e7a0c638a4aee1d0ccbb53e6f6aa9653c1894c03fe7c8888c200e9106f4fa325f283dbc80cc7728d90bb03839ffab24dd0c201a23fdc093c5192cb516c106ea
7
- data.tar.gz: 610da2332a98acd0fb5352a33661e5aa03a876fa140ffa8e2036c2773eb17d5d49eb19a3352c9d13ae5a55d0b484e50546c8424617cc59fca704395e59bd4c8c
6
+ metadata.gz: 3e9366250f82e9a2c961bee5f84adbd51f706c2dceddefe497182ea33eafeab6d7dacd33f28cc7edc196c24fd4bccf00ae145b195edb0424bb6656b4c7acb257
7
+ data.tar.gz: 13cad9b9c3816ecd0ba9a02cd396177a40cf61d7235d370deaab2877483f37b26d043345a58db1fd76984f425808db7248ba8f0402eb08fa8360c4c32adb2314
data/exe/ZipcodeZhCN CHANGED
@@ -5,7 +5,7 @@ require "zipcode_zh_cn"
5
5
  if ARGV && ARGV.size > 0
6
6
  addr = ARGV[ 0 ].dup
7
7
  zipcode = ZipcodeZhCn.get_zipcode(addr)
8
- puts zipcode
8
+ puts zipcode if zipcode && zipcode != ''
9
9
  else
10
10
  puts "请输入您要查询的地址(只支持中国大陆地址)"
11
11
  end
data/lib/zipcode_zh_cn.rb CHANGED
@@ -36,18 +36,15 @@ module ZipcodeZhCn
36
36
  end
37
37
 
38
38
  if zipcode.length != 6
39
- puts "zipcode is not right "
39
+ puts "没有找到您要的邮编"
40
40
  end
41
41
  end
42
42
  rescue Exception => e
43
43
  if try_count < 6
44
44
  http.close if http
45
45
  http = HTTP.persistent ApiHost
46
- puts "try_count = #{try_count} :sleep #{try_count} seconds : Exception ====> #{e}"
47
46
  sleep(try_count)
48
47
  retry
49
- else
50
- puts "try out=>#{addr}"
51
48
  end
52
49
  end
53
50
 
@@ -1,3 +1,3 @@
1
1
  module ZipcodeZhCn
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - rubycat