1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00
haml--haml/bin/lineprof
2015-10-31 12:16:56 +09:00

26 lines
442 B
Ruby
Executable file

#!/usr/bin/env ruby
require 'bundler/setup'
require 'hamlit'
require 'lineprof'
require 'tempfile'
require 'thor'
class CLI < Thor
desc 'compile HAML', 'Benchmark compile'
def compile(file)
haml = File.read(file)
Lineprof.profile(/./) do
100.times { Hamlit::Engine.new.call(haml) }
end
end
private
def method_missing(*args)
return super if args.length > 1
compile(args.first.to_s)
end
end
CLI.start