提交 c4cfa367 编写于 作者: M Mislav Marohnić

Remove deprecated calls to `File.exists?`

They emit Ruby warnings on Ruby 2.1.0
上级 f60fb892
......@@ -998,7 +998,7 @@ help
# included after the __END__ of the file so we can grab it using
# DATA.
def hub_raw_manpage
if File.exists? file = File.dirname(__FILE__) + '/../../man/hub.1'
if File.exist? file = File.dirname(__FILE__) + '/../../man/hub.1'
File.read(file)
else
DATA.read
......@@ -1085,7 +1085,7 @@ help
# the pullrequest_editmsg_file, which newer hub would pick up and
# misinterpret as a message which should be reused after a failed PR.
def valid_editmsg_file?(message_file)
File.exists?(message_file) &&
File.exist?(message_file) &&
File.mtime(message_file) > File.mtime(__FILE__)
end
......
......@@ -7,15 +7,15 @@ class StandaloneTest < Minitest::Test
include FileUtils
def setup
rm "hub" if File.exists? 'hub'
rm_rf "/tmp/_hub_private" if File.exists? '/tmp/_hub_private'
rm "hub" if File.exist? 'hub'
rm_rf "/tmp/_hub_private" if File.exist? '/tmp/_hub_private'
mkdir "/tmp/_hub_private"
chmod 0400, "/tmp/_hub_private"
end
def teardown
rm "hub" if File.exists? 'hub'
rm_rf "/tmp/_hub_private" if File.exists? "/tmp/_hub_private"
rm "hub" if File.exist? 'hub'
rm_rf "/tmp/_hub_private" if File.exist? "/tmp/_hub_private"
end
def test_standalone
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册