Skip to content

Commit

Permalink
Merge pull request #52 from chocoby/scheduled-build
Browse files Browse the repository at this point in the history
毎週月曜日の 09:00 (JST) にテストを実行する
  • Loading branch information
chocoby committed Feb 24, 2021
2 parents a37bf19 + 748f1f6 commit 41cb50c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
- master
pull_request:
types: [opened, synchronize, reopened]
schedule:
- cron: '0 0 * * 1'

jobs:
lint:
Expand Down
3 changes: 3 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ 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|
Expand Down
3 changes: 3 additions & 0 deletions lib/jp_prefecture/zip_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ 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
Expand Down

0 comments on commit 41cb50c

Please sign in to comment.