我正在尝试使用 ruby 的 SVN 绑定来获取文件的提交日期。下面的代码有效。但是,我不满足于我需要使用一个块来从 status 方法中获取结果。有没有更好的办法 ?
ctx = Svn::Client::Context.new()
ctx.add_simple_prompt_provider(2) do |cred, realm, user_name, may_save|
cred.username = "sorin"
cred.password = "realyniftypassword"
end
svndate = nil
ctx.status(path, "HEAD", true, true) do |path, status|
break if status.entry.nil?
svndate = status.entry.cmt_date
end
next if svndate.nil?
我正在寻找类似的东西:
svndate = ctx.status(path, "HEAD", true, true)[0].entry.cmt_date
但 ctx.status 返回一个整数。
有没有更合适的方法?
我使用 Ubuntu deb 包 libsvn-ruby1.8,除了网上的一些示例外,我找不到任何文档。