Skip to content

Commit

Permalink
Merge pull request #114 from holiday-jp/update_v0.x
Browse files Browse the repository at this point in the history
v1.xから直接v0のymlを生成するように修正
  • Loading branch information
k1LoW authored Dec 5, 2020
2 parents 836ea43 + 2e62e24 commit f381e41
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 9,377 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: test

on: push

jobs:
job-test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Set up Ruby
uses: actions/setup-ruby@v1
with:
go-version: '2.7'

- name: Check out source code
uses: actions/checkout@v2

- name: Setup
run: bundle install

- name: Run test
run: bundle exec rake spec
env:
# No OAuth2 Client ID / IP range limited
GOOGLE_CALENDAR_API_KEY: AIzaSyBua5ystvigElyCGBeJQ-lvXnLAal5k_jw
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

20 changes: 20 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
require 'rake'
require 'rspec/core/rake_task'
require 'yaml'
require 'open-uri'
require 'uri'

RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = 'spec/*_spec.rb'
end

namespace :holidays do
desc 'v1のYAMLからのv0の生成'
task :convert_from_v1 do
data = YAML.load(URI.open('https://raw.githubusercontent.com/holiday-jp/holiday_jp/master/holidays.yml'))
data = data.map do |v|
v[1].match(/振替休日/) ? [v[0], '振替休日'] : v
end.to_h
YAML.dump(data, File.open('holidays.yml', 'w'))

data = YAML.load(URI.open('https://raw.githubusercontent.com/holiday-jp/holiday_jp/master/holidays_detailed.yml'))
data = data.map do |v|
v[1]['name'] = '振替休日' if v[1]['name'].match(/振替休日/)
v
end.to_h
YAML.dump(data, File.open('holidays_detailed.yml', 'w'))
end
end
Loading

0 comments on commit f381e41

Please sign in to comment.