From 311c046c651cbaedd976da57d845584f42d48ca1 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Sat, 31 Dec 2016 14:43:21 +0900 Subject: [PATCH] Drop bin/lineprof Related to: https://github.com/k0kubun/hamlit/commit/8bf074a67ba911684a4ebec177e4876ee219d756 I don't use this anymore. --- bin/lineprof | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) delete mode 100755 bin/lineprof diff --git a/bin/lineprof b/bin/lineprof deleted file mode 100755 index e127f0b5..00000000 --- a/bin/lineprof +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env ruby - -require 'bundler/setup' -require 'hamlit' -require 'lineprof' -require 'tempfile' -require 'thor' - -class CLI < Thor - desc 'render HAML', 'Benchmark render' - def render(file) - haml = File.read(file) - compiled = Hamlit::Engine.new.call(haml) - code = [ - 'require "lineprof"', - 'require "hamlit"', - - 'Lineprof.profile(/./) do', - '100.times do', - compiled, - 'end', - 'end', - ].join("\n") - - file = Tempfile.create('compiled') - file.write(code) - file.close - - system("bundle exec ruby #{file.path}") - end - - 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 - render(args.first.to_s) - end -end - -CLI.start