lib/ruby-processing/exporters/creator.rb in ruby-processing-1.0.11 vs lib/ruby-processing/exporters/creator.rb in ruby-processing-2.4.1
- old
+ new
@@ -4,11 +4,11 @@
class Creator < BaseExporter
ALL_DIGITS = /\A\d+\Z/
# Create a blank sketch, given a path.
- def create!(path, args, bare)
+ 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")
if already_exists
@@ -26,16 +26,16 @@
@height && @height.match(ALL_DIGITS)
# Make the file
dir = File.dirname path
mkdir_p dir
- template_name = bare ? 'bare_sketch.rb.erb' : 'blank_sketch.rb.erb'
+ template_name = p3d ? 'p3d_sketch.rb.erb' : 'blank_sketch.rb.erb'
template = File.new("#{RP5_ROOT}/lib/templates/create/#{template_name}")
rendered = render_erb_from_string_with_binding(template.read, binding)
full_path = File.join(dir, "#{@file_name}.rb")
File.open(full_path, "w") {|f| f.print(rendered) }
- puts "Created Sketch \"#{@title}\" in #{full_path.sub(/\A\.\//, '')}"
+ puts "Created Sketch \"#{@name}\" in #{full_path.sub(/\A\.\//, '')}"
end
# Show the help/usage message for create.
def usage(predicate)
unless predicate
@@ -49,6 +49,6 @@
USAGE
exit
end
end
end
-end
\ No newline at end of file
+end