Commit a90e8317 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #1631 from cremno/fix-ruby-warnings

fix some warnings emitted by 'ruby -w'
parents e8dd8180 4804b3f7
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment