Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

replace deprecated exists? with exist?

  • Loading branch information...
commit d12f2736c35ff1e42d16e87a852c5fc9e335c3a3 1 parent b25942b
@monkstone monkstone authored
View
4 lib/ruby-processing/exporters/application_exporter.rb
@@ -17,7 +17,7 @@ class ApplicationExporter < BaseExporter
def export!(sketch)
# Check to make sure that the main file exists
@main_file_path, @main_file, @main_folder = *get_main_file(sketch)
- usage( @main_file_path && File.exists?(@main_file_path) )
+ usage( @main_file_path && File.exist?(@main_file_path) )
extract_information
@@ -47,7 +47,7 @@ def copy_over_necessary_files
@necessary_files += @real_requires
NECESSARY_FOLDERS.each do |folder|
resource_path = File.join(@main_folder, folder)
- @necessary_files << resource_path if File.exists?(resource_path)
+ @necessary_files << resource_path if File.exist?(resource_path)
end
@necessary_files.uniq!
cp_r(@necessary_files, File.join(@dest, @prefix))
View
2  lib/ruby-processing/exporters/base_exporter.rb
@@ -115,7 +115,7 @@ def hash_to_ivars(hash)
end
def wipe_and_recreate_destination
- remove_entry_secure @dest if File.exists?(@dest)
+ remove_entry_secure @dest if File.exist?(@dest)
mkdir_p @dest
end
View
2  lib/ruby-processing/exporters/creator.rb
@@ -10,7 +10,7 @@ def create!(path, args, p3d)
usage path
main_file = File.basename(path, ".rb")
# Check to make sure that the main file exists
- already_exists = File.exists?(path) || File.exists?("#{File.dirname(path)}/#{main_file.underscore}.rb")
+ already_exists = File.exist?(path) || File.exist?("#{File.dirname(path)}/#{main_file.underscore}.rb")
if already_exists
puts "That sketch already exists."
exit
View
2  lib/ruby-processing/library_loader.rb
@@ -113,7 +113,7 @@ def get_library_directory_path(library_name, extension = nil)
"#{@sketchbook_library_path}/#{library_name}/library",
"#{@sketchbook_library_path}/#{library_name}"
].each do |path|
- if File.exists?(path) && !Dir.glob(path + "/*.#{ext}").empty?
+ if File.exist?(path) && !Dir.glob(path + "/*.#{ext}").empty?
return path
end
end
View
6 lib/ruby-processing/runner.rb
@@ -161,7 +161,7 @@ def discover_java_args(sketch)
arg_file = "#{File.dirname(sketch)}/data/java_args.txt"
args = []
args += dock_icon
- if File.exists?(arg_file)
+ if File.exist?(arg_file)
args += File.read(arg_file).split(/\s+/)
elsif Processing::CONFIG["java_args"]
args += Processing::CONFIG["java_args"].split(/\s+/)
@@ -171,12 +171,12 @@ def discover_java_args(sketch)
end
def ensure_exists(sketch)
- puts "Couldn't find: #{sketch}" and exit unless File.exists?(sketch)
+ puts "Couldn't find: #{sketch}" and exit unless File.exist?(sketch)
end
def jruby_complete
rcomplete = File.join(RP5_ROOT, 'lib/ruby/jruby-complete.jar')
- if File.exists?(rcomplete)
+ if File.exist?(rcomplete)
return rcomplete
else
warn "#{rcomplete} does not exist\nTry running `install_jruby_complete`"
View
2  lib/ruby-processing/runners/watch.rb
@@ -19,7 +19,7 @@ def initialize
def start_watching
start_runner
loop do
- if @files.detect { |file| File.exists?(file) && File.stat(file).mtime > @time }
+ if @files.detect { |file| File.exist?(file) && File.stat(file).mtime > @time }
puts "reloading sketch..."
$app && $app.close
@time = Time.now
View
2  samples/processing_app/topics/file_io/save_frames.rb
@@ -15,7 +15,7 @@ def setup
smooth
@recording = false
directory = "output"
- Dir::mkdir(directory) unless File.exists?(directory)
+ Dir::mkdir(directory) unless File.exist?(directory)
end
def draw
View
2  test/rp5_test.rb
@@ -32,7 +32,7 @@ def test_p2d
def test_proc_root
require 'psych'
path = File.expand_path("~/.rp5rc")
- config = File.exists?(path)? Psych.load_file(path) : {}
+ config = File.exist?(path)? Psych.load_file(path) : {}
root = config.empty? ? '' : config['PROCESSING_ROOT']
assert root =~ /processing/, "You need to set your PROCESSING_ROOT in .rp5rc"
end
Please sign in to comment.
Something went wrong with that request. Please try again.