Skip to content
This repository
Chris Wanstrath March 11, 2010
file 17 lines (12 sloc) 0.388 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
$LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
require 'mustache'

Mustache.template_file = File.dirname(__FILE__) + '/simple.mustache'
view = Mustache.new

print "Your name: "
view[:name] = gets
view[:value] = value = rand(10_000)
print "Are you in CA? [y/n] "

if view[:in_ca] = gets.to_s.downcase[0].chr == 'y'
  view[:taxed_value] = value - (value * 0.4)
end

puts view.render
Something went wrong with that request. Please try again.