Class: Slimi::Cli
- Inherits:
-
Thor
- Object
- Thor
- Slimi::Cli
- Defined in:
- lib/slimi/cli.rb
Overview
Provide CLI features.
Instance Method Summary collapse
Instance Method Details
#compile ⇒ Object
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 |
#erb ⇒ Object
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 |
#parse ⇒ Object
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 |
#render ⇒ Object
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 |