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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3524bca9cdb88daacd1f053247ee11406cd2f17b
4
- data.tar.gz: 443ff9193fb193f70ea0ad3bde73964b0fe06c57
3
+ metadata.gz: 4e5c6c8c300555f29f42911d56da550040b8cd4b
4
+ data.tar.gz: f25856f9cf6efd7c60c9468c4e2980424a95475b
5
5
  SHA512:
6
- metadata.gz: 3aeebe5cbf4017997fd2c0f2f9373419ce4516288bc8998d57972c273a35937c8ed4f0ad05d867323d5ed3a7bb23d71c3e51607e1f26942a789151f140b2a39e
7
- data.tar.gz: f5eb9d87aecf55f4b14d3088c68fdd7722c7bfe4fb31fcee98861c7e2b6f7ca3b3e683170ea61a229c98161ddca5f7eb532d9ac4e18ed8cfc84e163adbeb4a13
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
- - 2.1.4
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('data/pref_code.yaml'))
34
+ YAML.load(File.open("#{File.dirname(__FILE__)}/../data/pref_code.yaml"))
35
35
  end
36
36
 
37
37
  def self.update
@@ -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
@@ -1,3 +1,3 @@
1
1
  module JpZipCode
2
- VERSION = '0.1.3'.freeze
2
+ VERSION = '0.1.4'.freeze
3
3
  end
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.3
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 00:00:00.000000000 Z
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.2.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)