Replace `File.exists?` with `File.exist?`
`File.exists?` is deprecated method. See http://ruby-doc.org//core-2.2.0/File.html#exists-3F-method.
This commit is contained in:
parent
489da6784a
commit
7806f9ed52
|
@ -137,7 +137,7 @@ module Jekyll
|
||||||
config_files = override.delete('config')
|
config_files = override.delete('config')
|
||||||
if config_files.to_s.empty?
|
if config_files.to_s.empty?
|
||||||
default = %w[yml yaml].find(Proc.new { 'yml' }) do |ext|
|
default = %w[yml yaml].find(Proc.new { 'yml' }) do |ext|
|
||||||
File.exists? Jekyll.sanitized_path(source(override), "_config.#{ext}")
|
File.exist?(Jekyll.sanitized_path(source(override), "_config.#{ext}"))
|
||||||
end
|
end
|
||||||
config_files = Jekyll.sanitized_path(source(override), "_config.#{default}")
|
config_files = Jekyll.sanitized_path(source(override), "_config.#{default}")
|
||||||
@default_config_file = true
|
@default_config_file = true
|
||||||
|
|
|
@ -42,12 +42,12 @@ class TestConfiguration < JekyllUnitTest
|
||||||
assert_equal [source_dir("_config.yml")], @config.config_files(@no_override)
|
assert_equal [source_dir("_config.yml")], @config.config_files(@no_override)
|
||||||
end
|
end
|
||||||
should "return .yaml if it exists but .yml does not" do
|
should "return .yaml if it exists but .yml does not" do
|
||||||
mock(File).exists?(source_dir("_config.yml")) { false }
|
mock(File).exist?(source_dir("_config.yml")) { false }
|
||||||
mock(File).exists?(source_dir("_config.yaml")) { true }
|
mock(File).exist?(source_dir("_config.yaml")) { true }
|
||||||
assert_equal [source_dir("_config.yaml")], @config.config_files(@no_override)
|
assert_equal [source_dir("_config.yaml")], @config.config_files(@no_override)
|
||||||
end
|
end
|
||||||
should "return .yml if both .yml and .yaml exist" do
|
should "return .yml if both .yml and .yaml exist" do
|
||||||
mock(File).exists?(source_dir("_config.yml")) { true }
|
mock(File).exist?(source_dir("_config.yml")) { true }
|
||||||
assert_equal [source_dir("_config.yml")], @config.config_files(@no_override)
|
assert_equal [source_dir("_config.yml")], @config.config_files(@no_override)
|
||||||
end
|
end
|
||||||
should "return the config if given one config file" do
|
should "return the config if given one config file" do
|
||||||
|
|
|
@ -143,7 +143,7 @@ class TestSite < JekyllUnitTest
|
||||||
|
|
||||||
# simulate destination file deletion
|
# simulate destination file deletion
|
||||||
File.unlink dest
|
File.unlink dest
|
||||||
refute File.exists?(dest)
|
refute File.exist?(dest)
|
||||||
|
|
||||||
sleep 1
|
sleep 1
|
||||||
@site.process
|
@site.process
|
||||||
|
|
Loading…
Reference in New Issue