SaitoWu / linner

HTML5 Application Assembler
MIT License
275 stars 35 forks source link

Use File.exist? instead of deprecated File.exists?. #36

Closed JuanitoFatas closed 10 years ago

JuanitoFatas commented 10 years ago

This will fix the warning that introduced since Ruby 2.1.0 of File.exists?:

static VALUE
rb_file_exists_p(VALUE obj, VALUE fname)
{
    const char *s = "FileTest#";
    if (obj == rb_mFileTest) {
        s = "FileTest.";
    }
    else if (obj == rb_cFile ||
             (RB_TYPE_P(obj, T_CLASS) &&
              RTEST(rb_class_inherited_p(obj, rb_cFile)))) {
        s = "File.";
    }
    rb_warning("%sexists? is a deprecated name, use %sexist? instead", s, s);
    return rb_file_exist_p(obj, fname);
}

Ref. http://www.ruby-doc.org/core-2.1.0/File.html#method-c-exists-3F

SaitoWu commented 10 years ago

:+1: as always!