Created
September 28, 2013 14:40
-
-
Save wcp1231/6742738 to your computer and use it in GitHub Desktop.
修改静态文件路径版本的单行的ruby脚本,作用同之前的python脚本。直接在shell里执行即可
This file contains hidden or 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
# 已知的bug是,如果一个元素分成几行就不会被匹配上 | |
ruby -i.bak -rdate -pe '$_.gsub!(/(<(script|link|img)[^@%>]*=["][^"]*\.(js|css|png|jpg))/) {%Q|#{$1}?#{DateTime.now.strftime "%Y%m%d%H"}|}' ./**/*.jsp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment