mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Allow profiling templates from any directory
This commit is contained in:
parent
a2f616a81d
commit
447813aac5
1 changed files with 3 additions and 3 deletions
6
Rakefile
6
Rakefile
|
@ -81,13 +81,13 @@ Profile Haml.
|
|||
END
|
||||
task :profile do
|
||||
times = (ENV['TIMES'] || '1000').to_i
|
||||
file = ENV['FILE']
|
||||
file = ENV['FILE'] || 'test/templates/standard.haml'
|
||||
|
||||
require 'bundler/setup'
|
||||
require 'ruby-prof'
|
||||
require 'haml'
|
||||
|
||||
file = File.read(File.expand_path("../test/templates/#{file || 'standard'}.haml", __FILE__))
|
||||
default =
|
||||
file = File.read(File.expand_path("../#{file}", __FILE__))
|
||||
obj = Object.new
|
||||
Haml::Engine.new(file, :ugly => true).def_method(obj, :render)
|
||||
result = RubyProf.profile { times.times { obj.render } }
|
||||
|
|
Loading…
Add table
Reference in a new issue