rodjek/puppet-profiler — pull request #4 by sciurus (2012-05-22 21:15:48+00:00)
Title: Use regular expression instead of partititon and rpartition

I revised puppet-profiler to use a more complex regular expression instead of partititon and rpartition. This allows puppet-profiler to run on ruby 1.8.5, which does not have those methods. I've verified that it still runs correctly on Ruby 1.9.1.

While testing that my revision produced the same output as your implementation, I discovered that my regular expression fixes a bug handling info on recursive file resources. For some reason Puppet reports these twice, e.g.

info: /Stage[main]/Foo/File[/etc/httpd/conf/enabled_sites]: Evaluated in 0.00 seconds
info: /etc/httpd/conf/enabled_sites: Evaluated in 0.00 seconds

Without this revision, puppet-profiler outputs the second one as _0.0s - []_, since it matched the regular expression that sets _time_ but not the one that sets _type_ or _title_. With it, the second one is ignored.