Class: Shaderize::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/shaderize.rb

Class Method Summary collapse

Class Method Details

.error(message = nil) ⇒ Object



26
27
28
29
30
31
# File 'lib/shaderize.rb', line 26

def self.error(message = nil)
  puts "Shaderize v#{VERSION}"
  puts "Usage: shaderize [shader_dir] [output_dir]\n"
  puts message unless message.nil?
  exit 1
end

.startObject



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/shaderize.rb', line 14

def self.start
  error unless ARGV.length == 2

  shader_dir = File.expand_path(ARGV[0])
  output_dir = File.expand_path(ARGV[1])

  error "Not a directory: '#{shader_dir}'" unless File.directory?(shader_dir)
  error "Not a directory: '#{output_dir}'" unless File.directory?(output_dir)

  Scaffold.scaffold(shader_dir, output_dir)
end