Skip to content

Commit 45f2077

Browse files
committed
include patches for 8.0 to patch list sub command
1 parent 3a25e9b commit 45f2077

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

scripts/vimmagazinetools.rb

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
require 'date'
1010

1111

12-
VIMPATCH_URL = "http://ftp.vim.org/pub/vim/patches/7.4/%s"
13-
VIMPATCH_README_URL = "http://ftp.vim.org/pub/vim/patches/7.4/README"
12+
VIMPATCH_README_URL = "http://ftp.vim.org/pub/vim/patches/%s/README"
1413
VIMSCRIPT_URL = "http://www.vim.org/scripts/script.php?script_id=%s"
1514
VIMSCRIPT_LIST_URL = "http://www.vim.org/scripts/script_search_results.php?&show_me=99999"
1615
VIM_GITHUB_COMMIT_URL = "https://github.com/vim/vim/commit/%s"
@@ -85,9 +84,18 @@ def mdescape(s)
8584

8685

8786
def vimpatch_all()
87+
[].tap do |patches|
88+
patches.concat vimpatch('7.4')
89+
patches.concat vimpatch('8.0')
90+
end
91+
end
92+
93+
# vimpatch fetches info of patches for Vim x.x (ver)
94+
def vimpatch(ver)
8895
items = []
8996
tag2sha = github_git_tags("vim", "vim")
90-
readme = httpget(VIMPATCH_README_URL).entity.force_encoding("UTF-8")
97+
url = sprintf(VIMPATCH_README_URL, ver)
98+
readme = httpget(url).entity.force_encoding("UTF-8")
9199
for line in readme.split(/\r\n|\r|\n/)
92100
m = line.match(/^\s*(?#size)(\d+) (?#version)(\d\.\d\.\d{3,4}) (?#summary)(.*)$/)
93101
if !m
@@ -97,7 +105,6 @@ def vimpatch_all()
97105
e["size"] = m[1].to_i
98106
e["version"] = m[2]
99107
e["summary"] = m[3]
100-
# e["url"] = sprintf(VIMPATCH_URL, e["version"])
101108
major, minor, patchlevel = e["version"].split(".")
102109
tag = "v#{major}.#{minor}.#{patchlevel}"
103110
e["tag"] = tag

0 commit comments

Comments
 (0)