-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #114 from holiday-jp/update_v0.x
v1.xから直接v0のymlを生成するように修正
- Loading branch information
Showing
9 changed files
with
124 additions
and
9,377 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.