Method: Puppet::Rails::Benchmark#write_benchmarks
- Defined in:
- lib/vendor/puppet/rails/benchmark.rb
#write_benchmarks ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/vendor/puppet/rails/benchmark.rb', line 48 def write_benchmarks return unless time_debug? branch = %x{git branch}.split("\n").find { |l| l =~ /^\*/ }.sub("* ", '') file = "/tmp/time_debugging.yaml" if FileTest.exist?(file) data = YAML.load_file(file) else data = {} end data[branch] = $benchmarks Puppet::Util.replace_file(file, 0644) { |f| f.print YAML.dump(data) } end |