Skip to content

Commit

Permalink
Remove temporarily disable RuboCop rule (Style/HashConversion)
Browse files Browse the repository at this point in the history
  • Loading branch information
chocoby committed Mar 8, 2021
1 parent a8f4624 commit e70c20c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
4 changes: 0 additions & 4 deletions Rakefile
Expand Up @@ -52,11 +52,7 @@ task :create_zip_code_data do
prefectures_to_zip[code] << [r0, r1]
end

# rubocop:disable Style/HashConversion
# https://github.com/rubocop-hq/rubocop/issues/9526
prefectures_to_zip = Hash[*prefectures_to_zip.sort.flatten(1)]
# rubocop:enable Style/HashConversion

# save result
File.open('data/zip.yml', 'w') do |file|
file.write "# { prefecture_code: [[from_zip_1, to_zip_1], [from_zip_2, to_zip_2], ...], ... }\n"
Expand Down
4 changes: 0 additions & 4 deletions lib/jp_prefecture/zip_mapping.rb
Expand Up @@ -7,11 +7,7 @@ module JpPrefecture
module ZipMapping
filepath = File.join(File.dirname(__FILE__), '../../data/zip.yml')
@data = YAML.load_file(filepath)
# rubocop:disable Style/HashConversion
# https://github.com/rubocop-hq/rubocop/issues/9526
@data = Hash[*@data.collect { |code, arr| [code, arr.collect { |zip_from, zip_to| zip_from..zip_to }] }.flatten(1)]
# rubocop:enable Style/HashConversion

def self.data
JpPrefecture.config.zip_mapping_data || @data
end
Expand Down

0 comments on commit e70c20c

Please sign in to comment.