Created
July 28, 2014 01:37
-
-
Save tkfm-yamaguchi/c3c7f97f2cf087d2c712 to your computer and use it in GitHub Desktop.
usage of String#ext ( injected by rake )
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
# coding: utf-8 | |
require "pathname" | |
require "rake" | |
module DIR | |
ROOT = Pathname(__dir__) | |
ORG = ROOT.join("org") | |
OUT = ROOT.join("out") | |
end | |
task :default do | |
Pathname.glob(DIR::ORG.join("*.png")).each do |path| | |
size = path.basename.to_s.ext("") | |
out_path = DIR::OUT.join(size, "vim.png") | |
mkdir_p out_path.dirname | |
cp path, out_path | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment