Skip to content

Fix warnings on Ruby 2.1.2 #157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

nishidayuya
Copy link
Contributor

This PR suppresses following warnings.

% bundle exec rake
Loaded suite /home/yuya/.rvm/gems/ruby-2.1.2/bin/rake
Started
/home/yuya/github/ruby-git/lib/git/path.rb:10: warning: File.exists? is a deprecated name, use File.exist? instead
/home/yuya/github/ruby-git/lib/git/path.rb:10: warning: File.exists? is a deprecated name, use File.exist? instead
/home/yuya/github/ruby-git/tests/units/test_archive.rb:18: warning: File.exists? is a deprecated name, use File.exist? instead
...

We can replace File.exists? to File.exist? since Ruby 1.8.7.

% ruby -ve 'p File.exist?("/tmp")'
ruby 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux]
true

In 33f100f , ruby-git already uses File.exist? 1 line.
But 29 lines uses File.exists? yet.
This PR fixes it.

% git grep -n File.exist?
lib/git/lib.rb:484:      if File.exist?(filename)
% git grep -n File.exists? | wc -l
29
% git grep -n File.exists?
lib/git/base.rb:449:      if File.exists?(file)
lib/git/base.rb:455:      self.lib.apply_mail(file) if File.exists?(file)
...

@robertodecurnex
Copy link
Contributor

Cool, ty! Waiting for Tevis to finish the build process.

robertodecurnex added a commit that referenced this pull request Jul 8, 2014
@robertodecurnex robertodecurnex merged commit 2f8bf94 into ruby-git:master Jul 8, 2014
@nishidayuya
Copy link
Contributor Author

Wow, thanks!

@nishidayuya nishidayuya deleted the fix_warnings_on_ruby_2.1.2 branch July 8, 2014 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants