lib/datasets/postal-code-japan.rb in red-datasets-0.1.4 vs lib/datasets/postal-code-japan.rb in red-datasets-0.1.5

- old
+ new

@@ -47,13 +47,11 @@ raise ArgumentError, message end @metadata.id = "postal-code-japan-#{@reading}" @metadata.name = "Postal code in Japan (#{@reading})" @metadata.url = "https://www.post.japanpost.jp/zipcode/download.html" - @metadata.licenses = [ - "CC0-1.0", - ] + @metadata.licenses = ["CC0-1.0"] @metadata.description = "Postal code in Japan (reading: #{@reading})" end def each(&block) return to_enum(__method__) unless block_given? @@ -114,12 +112,10 @@ data_url << "/oogaki/zip/ken_all.zip" when :romaji data_url << "/roman/ken_all_rome.zip" end data_path = cache_dir_path + "#{@reading}-ken-all.zip" - unless data_path.exist? - download(data_path, data_url) - end + download(data_path, data_url) Zip::File.open(data_path.to_s) do |zip_file| zip_file.each do |entry| next unless entry.file? entry.get_input_stream do |input|