Class: Palette::Cli

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

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Cli



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

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