Skip to content

Instantly share code, notes, and snippets.

@raa0121
Last active August 29, 2015 13:56
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 raa0121/8973236 to your computer and use it in GitHub Desktop.
Save raa0121/8973236 to your computer and use it in GitHub Desktop.
VimAdvテスト用コード
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