Class: Processing::Creator
- Inherits:
-
Object
- Object
- Processing::Creator
- Defined in:
- lib/ruby-processing/exporters/creator.rb
Overview
An abstract class providing common methods for real creators
Direct Known Subclasses
Constant Summary collapse
- ALL_DIGITS =
/\A\d+\Z/
Instance Method Summary collapse
- #already_exist(path) ⇒ Object
-
#usage ⇒ Object
Show the help/usage message for create.
Instance Method Details
#already_exist(path) ⇒ Object
71 72 73 74 75 76 |
# File 'lib/ruby-processing/exporters/creator.rb', line 71 def already_exist(path) new_file = "#{File.dirname(path)}/#{path.underscore}.rb" return if !File.exist?(path) && !File.exist?(new_file) puts 'That file already exists!' exit end |
#usage ⇒ Object
Show the help/usage message for create.
79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/ruby-processing/exporters/creator.rb', line 79 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 |