Class: Slimi::Cli

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

Overview

Provide CLI features.

Instance Method Summary collapse

Instance Method Details

#compileObject



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

def compile
  slim = $stdin.read
  ruby = Engine.new.call(slim)
  puts ruby
end

#erbObject



16
17
18
19
20
# File 'lib/slimi/cli.rb', line 16

def erb
  slim = $stdin.read
  expression = ErbConverter.new.call(slim)
  puts expression
end

#parseObject



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

def parse
  slim = $stdin.read
  expression = Parser.new.call(slim)
  pp expression
end

#renderObject



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

def render
  slim = $stdin.read
  ruby = Engine.new.call(slim)
  result = eval(ruby)
  puts result
end