mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
fix some warnings emitted by 'ruby -w'
- File.exists? is deprecated since 2.1.0 - tasks/mruby_build_commands.rake:268: ambiguous argument
This commit is contained in:
@@ -8,7 +8,7 @@ MRuby.each_target do
|
||||
g.print_gem_init_header(f)
|
||||
test_preload = [g.dir, MRUBY_ROOT].map {|dir|
|
||||
File.expand_path(g.test_preload, dir)
|
||||
}.find {|file| File.exists?(file) }
|
||||
}.find {|file| File.exist?(file) }
|
||||
|
||||
g.build.mrbc.run f, test_preload, "gem_test_irep_#{g.funcname}_preload"
|
||||
g.test_rbfiles.flatten.each_with_index do |rbfile, i|
|
||||
|
||||
@@ -106,7 +106,7 @@ module MRuby
|
||||
private
|
||||
def get_dependencies(file)
|
||||
file = file.ext('d') unless File.extname(file) == '.d'
|
||||
if File.exists?(file)
|
||||
if File.exist?(file)
|
||||
File.read(file).gsub("\\\n ", "").scan(/^\S+:\s+(.+)$/).flatten.map {|s| s.split(' ') }.flatten
|
||||
else
|
||||
[]
|
||||
@@ -265,7 +265,7 @@ module MRuby
|
||||
# if mrbc execution fail, drop the file
|
||||
unless $?.exitstatus
|
||||
File.delete(out.path)
|
||||
exit -1
|
||||
exit(-1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2,7 +2,7 @@ module MRuby
|
||||
module LoadGems
|
||||
def gembox(gemboxfile)
|
||||
gembox = File.expand_path("#{gemboxfile}.gembox", "#{MRUBY_ROOT}/mrbgems")
|
||||
fail "Can't find gembox '#{gembox}'" unless File.exists?(gembox)
|
||||
fail "Can't find gembox '#{gembox}'" unless File.exist?(gembox)
|
||||
|
||||
GemBox.config = self
|
||||
GemBox.path = gembox
|
||||
@@ -25,7 +25,7 @@ module MRuby
|
||||
|
||||
gemrake = File.join(gemdir, "mrbgem.rake")
|
||||
|
||||
fail "Can't find #{gemrake}" unless File.exists?(gemrake)
|
||||
fail "Can't find #{gemrake}" unless File.exist?(gemrake)
|
||||
Gem.current = nil
|
||||
load gemrake
|
||||
return nil unless Gem.current
|
||||
@@ -50,7 +50,7 @@ module MRuby
|
||||
url = params[:git]
|
||||
gemdir = "#{gem_clone_dir}/#{url.match(/([-\w]+)(\.[-\w]+|)$/).to_a[1]}"
|
||||
|
||||
if File.exists?(gemdir)
|
||||
if File.exist?(gemdir)
|
||||
if $pull_gems
|
||||
git.run_pull gemdir, url
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user