world_postal_codes 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +24 -6
- data/lib/world_postal_codes.rb +0 -17
- data/lib/world_postal_codes/identify.rb +3 -0
- data/lib/world_postal_codes/version.rb +1 -1
- metadata +1 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 288538377c418b4af26f417433be82aef04cc55c
|
4
|
+
data.tar.gz: e426a1041aa3fe9b3d91f17df63b3fc84f2000e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6776165dd5e4de6f45d7d874d3f1a96defd2cdf4de296ef428584b0d5fa67f8f690b6f077a4f29596aa23c3bb37ba71ab785b8f9c839186f6ab23a19f57bc62
|
7
|
+
data.tar.gz: 44d744cc82c2c262b54bcae688a793b304f074939ebeace8fa759a9b444f4c53d2d241231e153b906e623efbd265ccd464bf1e477e94be9cd8863651aeaae75d
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
#
|
1
|
+
# WorldPostalCodes [![Gem Version](https://badge.fury.io/rb/world_postal_codes.svg)](https://badge.fury.io/rb/world_postal_codes)
|
2
2
|
|
3
|
-
|
3
|
+
Simmple gemt to get city, state for given zip code. supported country is below
|
4
4
|
|
5
|
-
|
5
|
+
* Japan
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -22,7 +22,21 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
|
25
|
+
```
|
26
|
+
WorldPostalCodes.jp("00000")
|
27
|
+
# => {:prefecture=>"神奈川県", :prefecture_kana=>"カナガワケン", :city=>"相模原市南区", :city_kana=>"サガミハラシミナミク"}
|
28
|
+
```
|
29
|
+
|
30
|
+
laoding master file
|
31
|
+
```
|
32
|
+
# config/initializers/world_postal_codes.rb
|
33
|
+
WorldPostalCodes.load
|
34
|
+
```
|
35
|
+
|
36
|
+
Uplaod master file
|
37
|
+
```
|
38
|
+
bin/rake postal_codes:import_jp
|
39
|
+
```
|
26
40
|
|
27
41
|
## Development
|
28
42
|
|
@@ -31,9 +45,13 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
31
45
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
46
|
|
33
47
|
## Contributing
|
48
|
+
This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
34
49
|
|
35
|
-
|
36
|
-
|
50
|
+
Fork it
|
51
|
+
Create your feature branch (git checkout -b my-new-feature)
|
52
|
+
Commit your changes (git commit -am 'Add some feature')
|
53
|
+
Push to the branch (git push origin my-new-feature)
|
54
|
+
Create new Pull Request
|
37
55
|
|
38
56
|
## License
|
39
57
|
|
data/lib/world_postal_codes.rb
CHANGED
@@ -6,22 +6,5 @@ module WorldPostalCodes
|
|
6
6
|
DATA_DIR = File.dirname(__FILE__) + '/../data/japan.yml'
|
7
7
|
ZIP_URL = "http://www.post.japanpost.jp/zipcode/dl/kogaki/zip/ken_all.zip"
|
8
8
|
extend WorldPostalCodes::Identify
|
9
|
-
|
10
|
-
# class << self
|
11
|
-
# def identify(code)
|
12
|
-
# db[code] || {}
|
13
|
-
# end
|
14
|
-
|
15
|
-
# def db
|
16
|
-
# @db ||= begin
|
17
|
-
# YAML.load(File.open(DATA_DIR))
|
18
|
-
# end
|
19
|
-
# end
|
20
|
-
|
21
|
-
# def load
|
22
|
-
# db
|
23
|
-
# end
|
24
|
-
# end
|
25
|
-
|
26
9
|
end
|
27
10
|
require 'world_postal_codes/railtie' if defined?(Rails)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: world_postal_codes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kawasaki-atsushi
|
@@ -130,4 +130,3 @@ signing_key:
|
|
130
130
|
specification_version: 4
|
131
131
|
summary: Simple gem to get city for a given Japan postal codes.
|
132
132
|
test_files: []
|
133
|
-
has_rdoc:
|