Class: Palette::Cli

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

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Cli

Returns a new instance of Cli.



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/palette/cli.rb', line 3

def initialize(*args)
  if File.exist?(path = File.expand_path(args.first))
    begin
      puts Palette::Dsl.run {
        eval(IO.read(path), binding, path)
      }
    rescue Exception => e
      puts "Please check the syntax of your palette file\n  #{e}"
      exit 1
    end
  end
end