Class: Faml::CLI

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

Instance Method Summary collapse

Instance Method Details

#compile(file) ⇒ Object



17
18
19
# File 'lib/faml/cli.rb', line 17

def compile(file)
  puts compile_file(file, format: options[:format].to_sym)
end

#render(file) ⇒ Object



10
11
12
13
# File 'lib/faml/cli.rb', line 10

def render(file)
  code = compile_file(file, format: options[:format].to_sym)
  puts instance_eval(code, file)
end

#temple(file) ⇒ Object



23
24
25
26
# File 'lib/faml/cli.rb', line 23

def temple(file)
  require 'pp'
  pp Faml::Compiler.new(filename: file, format: options[:format].to_sym).call(parse_file(file))
end

#version ⇒ Object



30
31
32
33
34
35
36
# File 'lib/faml/cli.rb', line 30

def version
  if options[:numeric]
    puts VERSION
  else
    puts "faml #{VERSION}"
  end
end