Last active
August 29, 2015 13:56
-
-
Save raa0121/8973236 to your computer and use it in GitHub Desktop.
VimAdvテスト用コード
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
require 'open-uri' | |
data = {} | |
search = [] | |
command = ["!vac", "vim"] | |
VAC12=open("https://raw.github.com/osyo-manga/vim_advent_calendar2012/master/README.md").read | |
descript = VAC12.split("\n") | |
descript.map{|m| m.match(/\|(.*)\|(.*)\|(.*)\|(?:"(.*)":(.*))?\|/) {|m| | |
data[m[1]] = {"count" => m[1], "date" => m[2], "author" => m[3], "title" => m[4], "url" => m[5]} | |
}} | |
data = data.sort | |
data.map {|v| | |
if /#{command[1]}/i =~ v[-1]["title"] | |
search << "%s %s %s %s" % (%w[count date author title].map{|k| v[-1][k]}) | |
end | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment