jp_zip_code 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -1
- data/lib/jp_zip_code.rb +2 -2
- data/lib/jp_zip_code/updater.rb +1 -3
- data/lib/jp_zip_code/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e5c6c8c300555f29f42911d56da550040b8cd4b
|
4
|
+
data.tar.gz: f25856f9cf6efd7c60c9468c4e2980424a95475b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e0b619b9f195ab543501d9d6039001ffc8ae656385afcece34d33b5579372a22e8d2e81e3990cbae87467244ac0b223435dc8544858aa90d13c1ad178a97d23
|
7
|
+
data.tar.gz: 8d1c8529a1b8a2a2e20503738acacf1d6b2f42885549d3aa229fac49ebe7f6459be2c92539c912a2e5a0063c96114824c83355e75f645cf4a7bced50e023e129
|
data/.travis.yml
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
|
3
|
+
- 2.1.4
|
4
4
|
before_install: gem install bundler -v 1.11.2
|
5
5
|
script: bundle exec rspec
|
6
6
|
addons:
|
7
7
|
code_climate:
|
8
8
|
repo_token: 5594e3f1541606356c57f9e1921f18506f63696bf118fbc3a5f57d630fe7affe
|
9
|
+
notifications:
|
10
|
+
email: false
|
11
|
+
slack:
|
12
|
+
secure: EI+tiNEm2V0TmNBOmGVV40thHdFcxGhCO0hHL8skt3k6r2g+pgaeV6Zc7o25w7Vkb2ArpaqBJ/7QpIA76lkARZUgmLcaKJszo0rmQL5Od3PVPVhhNXYF4zbwTlCuLOm845iyg0FlWaHWUNuhkCcmk4F0M2lgGhgDhp/GVaQohe5vtPG8wBADppJRvIeeVtSWmu46erR7wySZu9nE05AVkBM3vnHifcSY1r9/YLJ12qm3lcJ2yzkdXmpfR1W2Y20iTLOy6nveoIt8GxMoMbWUrDIMsilFQrqqh8cVdVl4PGbsTlgmQP8ktcp75V8TllZYCIrZxRSeLHtwBNCS1ojjjs9R4gv9JOaHvwC7K30s6MLBLNpXGES8X9bYYuXt8D5U/6cTnSouz7dsAEVlb1Sgk6COFSFqLhAxAH/tLqSCn5tgIw+QON9ZknIvdNlj55ZqmZNgZ0/CWGNy32QmhIpjckofjwB6H1bxXXNsl7m8Ko+YKo/titdUZzCHbInkRZPWTR3cSuWhICSWjCj97KxCNIcN8wMPkxvjaRmX0CS4UPigvd8rsNGx4aSdxK9AtRxGDtww4lvpHryt+WzqiW1zIr1cjJWce5M9l7WvI48PG/ajNRe+9HQGO2gias6ZjjoCxboBfCJ9V0YZjY7EWZd6JFTDmbYTkTMbVJHwLxuaQ0c=
|
data/lib/jp_zip_code.rb
CHANGED
@@ -9,7 +9,7 @@ module JpZipCode
|
|
9
9
|
zip_code = zip_code.to_s.delete('-')
|
10
10
|
return nil unless zip_code =~ /^\d{7}$/
|
11
11
|
|
12
|
-
json_file = "data/zip_code/#{zip_code[0, 4]}.json"
|
12
|
+
json_file = "#{File.dirname(__FILE__)}/../data/zip_code/#{zip_code[0, 4]}.json"
|
13
13
|
if File.exist?(json_file)
|
14
14
|
data = File.open(json_file) { |json| JSON.load(json) }
|
15
15
|
Hashie::Rash.new(convert(data[zip_code]))
|
@@ -31,7 +31,7 @@ module JpZipCode
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def self.pref_codes
|
34
|
-
YAML.load(File.open(
|
34
|
+
YAML.load(File.open("#{File.dirname(__FILE__)}/../data/pref_code.yaml"))
|
35
35
|
end
|
36
36
|
|
37
37
|
def self.update
|
data/lib/jp_zip_code/updater.rb
CHANGED
@@ -31,15 +31,13 @@ module JpZipCode
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def update_file(zip_code_data)
|
34
|
-
Dir.mkdir('data/zip_code') unless Dir.exist?('data/zip_code')
|
35
|
-
|
36
34
|
unless @dry_run
|
37
35
|
(0..9999).each do |index|
|
38
36
|
top_four = format('%04d', index)
|
39
37
|
d = zip_code_data.select { |data| data.start_with?(top_four) }
|
40
38
|
|
41
39
|
unless d.empty?
|
42
|
-
File.open("data/zip_code/#{top_four}.json", 'w') do |file|
|
40
|
+
File.open("#{File.dirname(__FILE__)}/../../data/zip_code/#{top_four}.json", 'w') do |file|
|
43
41
|
file.puts JSON.generate(d)
|
44
42
|
end
|
45
43
|
end
|
data/lib/jp_zip_code/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jp_zip_code
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kimromi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|
@@ -1749,7 +1749,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1749
1749
|
version: '0'
|
1750
1750
|
requirements: []
|
1751
1751
|
rubyforge_project:
|
1752
|
-
rubygems_version: 2.
|
1752
|
+
rubygems_version: 2.4.8
|
1753
1753
|
signing_key:
|
1754
1754
|
specification_version: 4
|
1755
1755
|
summary: convert from zip-code to japan address (include Roman address)
|