1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

VCS#revision_header: Make arguments optional

This commit is contained in:
Nobuyoshi Nakada 2022-09-01 19:54:46 +09:00
parent f67ab7f30c
commit 462a8be511
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
3 changed files with 5 additions and 5 deletions

View file

@ -76,7 +76,7 @@ exit unless vcs
}
when :revision_h
Proc.new {|last, changed, modified, branch, title|
vcs.revision_header(last, changed, modified, branch, title, limit: @limit)
vcs.revision_header(last, modified, branch, title, limit: @limit)
}
when :doxygen
Proc.new {|last, changed|

View file

@ -204,7 +204,7 @@ class VCS
revision_handler(rev).short_revision(rev)
end
def revision_header(last, changed, modified, branch, title, limit: 20, time: true)
def revision_header(last, modified = nil, branch = nil, title = nil, limit: 20)
short = short_revision(last)
if /[^\x00-\x7f]/ =~ title and title.respond_to?(:force_encoding)
title = title.dup.force_encoding("US-ASCII")
@ -225,7 +225,7 @@ class VCS
title = title.dump.sub(/\\#/, '#')
code << "#define RUBY_LAST_COMMIT_TITLE #{title}"
end
if modified and time
if modified
t = modified.utc
code << t.strftime('#define RUBY_RELEASE_DATETIME "%FT%TZ"')
end

View file

@ -309,7 +309,7 @@ def package(vcs, rev, destdir, tmp = nil)
warn "#{$0}: #{rev} not found"
return
end
revision = (info = vcs.get_revisions(url))[1]
revision = vcs.get_revisions(url)[1]
end
v = "ruby"
@ -346,7 +346,7 @@ def package(vcs, rev, destdir, tmp = nil)
end
File.open("#{v}/revision.h", "wb") {|f|
f.puts vcs.revision_header(*info, time: false)
f.puts vcs.revision_header(revision)
}
version ||= (versionhdr = IO.read("#{v}/version.h"))[RUBY_VERSION_PATTERN, 1]
version ||=