File: rubyprof

package info (click to toggle)
jekyll 4.4.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,488 kB
  • sloc: ruby: 16,736; javascript: 1,455; sh: 216; xml: 29; makefile: 9
file content (23 lines) | stat: -rwxr-xr-x 649 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env ruby

require "ruby-prof"
require File.expand_path("../lib/jekyll", __dir__)

result = RubyProf.profile do
  Jekyll::Commands::Build.process({
    "source"      => File.expand_path("../docs", __dir__),
    "destination" => File.expand_path("../docs/_site", __dir__),
  })
end

puts "\nProcessing result.."

dir_path  = File.expand_path("../tmp", __dir__)
file_path = File.join(dir_path, "rubyprof-#{Time.now.strftime('%Y%m%d%H%M%S')}")

FileUtils.mkdir_p(dir_path) unless Dir.exist?(dir_path)
File.open(file_path, "wb") do |file|
  RubyProf::FlatPrinter.new(result).print(file)
end

puts "Profile result printed to #{file_path.cyan}"