From 606341b93ea3cf170ee1ac6903852e7158ba4de9 Mon Sep 17 00:00:00 2001 From: yuzoiwasaki Date: Sat, 19 Sep 2015 16:48:11 +0900 Subject: [PATCH] refactoring --- scripts/change_directory.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/change_directory.rb b/scripts/change_directory.rb index 8ccd7543..053b4273 100644 --- a/scripts/change_directory.rb +++ b/scripts/change_directory.rb @@ -5,15 +5,13 @@ dirs = Dir.glob('*') dirs.each do |dir| - Dir.chdir('reports') year = dir[0..3] month = dir[4..5] day = dir[6..7] - FileUtils.mkdir_p("../attendees/#{year}/#{month}/#{day}/") + dest = "../attendees/#{year}/#{month}/#{day}/" + FileUtils.mkdir_p(dest) - # NOTE コピー元ファイルの中にディレクトリ名が入っている Dir.chdir(dir) - p Dir.glob("*") files = Dir.glob("*") #FileUtils.cp(files, dest) Dir.chdir('..')