Skip to content

Instantly share code, notes, and snippets.

@siyo
Created March 8, 2010 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save siyo/325074 to your computer and use it in GitHub Desktop.
Save siyo/325074 to your computer and use it in GitHub Desktop.
!/usr/bin/env ruby
# -*- coding: utf-8 -*-
# これが何を意味するのかわかる人だけ使ってください
#--
time = Time.now
today = "%04d%02d%02d" % [time.year, time.month , time.day]
REJECT_EXTENTIONS = ["html","url"]
if not (FileTest.exist?(today) or FileTest.directory?(today))
mkdir = "mkdir %s" % today
puts mkdir
if not system(mkdir)
raise "fail #{mkdir}."
end
end
Dir.glob("./*.zip").each{|file|
unzip = "unzip -n -j #{file} -d ./#{today}/"
puts unzip
system(unzip)
}
REJECT_EXTENTIONS.each{|ext|
system("rm -f ./#{today}/*.#{ext}")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment