mirror of
https://github.com/edgecase/ruby_koans.git
synced 2026-04-15 07:23:19 -04:00
Merge pull request #38 from wolfsblu/master
Replace deprecated exists call
This commit is contained in:
@@ -218,7 +218,7 @@ module Neo
|
|||||||
|
|
||||||
def add_progress(prog)
|
def add_progress(prog)
|
||||||
@_contents = nil
|
@_contents = nil
|
||||||
exists = File.exists?(PROGRESS_FILE_NAME)
|
exists = File.exist?(PROGRESS_FILE_NAME)
|
||||||
File.open(PROGRESS_FILE_NAME,'a+') do |f|
|
File.open(PROGRESS_FILE_NAME,'a+') do |f|
|
||||||
f.print "#{',' if exists}#{prog}"
|
f.print "#{',' if exists}#{prog}"
|
||||||
end
|
end
|
||||||
@@ -226,7 +226,7 @@ module Neo
|
|||||||
|
|
||||||
def progress
|
def progress
|
||||||
if @_contents.nil?
|
if @_contents.nil?
|
||||||
if File.exists?(PROGRESS_FILE_NAME)
|
if File.exist?(PROGRESS_FILE_NAME)
|
||||||
File.open(PROGRESS_FILE_NAME,'r') do |f|
|
File.open(PROGRESS_FILE_NAME,'r') do |f|
|
||||||
@_contents = f.read.to_s.gsub(/\s/,'').split(',')
|
@_contents = f.read.to_s.gsub(/\s/,'').split(',')
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user