Class: PaletteTown::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/palettetown/cli.rb

Instance Method Summary collapse

Instance Method Details

#build(file) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/palettetown/cli.rb', line 7

def build file
  path = File.expand_path file
  if File.exist? path
    temp = Class.new PaletteTown::Scheme
    temp.instance_eval(IO.read(path))
    if options[:out]
      File.open(File.expand_path(options[:out]), 'w') do |f|
        f.write(temp.to_s)
      end
    else
      puts temp.to_s
    end
  end
end