class Processing::Creator

An abstract class providing common methods for real creators

Constants

ALL_DIGITS

Public Instance Methods

already_exist(path) click to toggle source
# File lib/ruby-processing/exporters/creator.rb, line 74
def already_exist(path)
  underscore = StringExtra.new(path).underscore
  new_file = "#{File.dirname(path)}/#{underscore}.rb"
  return if !FileTest.exist?(path) && !FileTest.exist?(new_file)
  puts 'That file already exists!'
  exit
end
usage() click to toggle source

Show the help/usage message for create.

# File lib/ruby-processing/exporters/creator.rb, line 83
    def usage
      puts <<-USAGE

      Usage: rp5 create <sketch_to_generate> <width> <height> <mode>
      mode can be P2D / P3D.
      Use    --wrap for a sketch wrapped as a class
      Use    --inner to generated a ruby version of 'java' Inner class
      Examples: rp5 create app 800 600
      rp5 create app 800 600 p3d --wrap
      rp5 create inner_class --inner

      USAGE
    end