diff options
author | Max Martin <max@puppetlabs.com> | 2011-04-07 11:29:54 -0700 |
---|---|---|
committer | Max Martin <max@puppetlabs.com> | 2011-04-07 11:29:54 -0700 |
commit | da4457be4dedaed5368bacf81a08f0429e21cd45 (patch) | |
tree | 5c6149ed872d33f1f6711bac8a5b43f6dbd71a4a /lib/puppet/util | |
parent | 1e4968e82a65b21ad5d075015830ef3f54efee05 (diff) | |
parent | f7c6db9409e479ec1b54cfa85daa1ee51e5a7ad0 (diff) | |
download | puppet-da4457be4dedaed5368bacf81a08f0429e21cd45.tar.gz puppet-da4457be4dedaed5368bacf81a08f0429e21cd45.tar.xz puppet-da4457be4dedaed5368bacf81a08f0429e21cd45.zip |
Merge branch '2.6.next' into 2.6.x
* 2.6.next:
Fix #4339 - Locally save the last report to $lastrunreport
Fix #4339 - Save a last run report summary to $statedir/last_run_summary.yaml
Fixed #3127 - removed legacy debug code
Fixed #3127 - Fixed gem selection regex
(#5437) Invalidate cached TypeCollection when there was an error parsing
(#6937) Adjust formatting of recurse's desc
(#6937) Document the recurse parameter of File type.
(#6893) Document the cron type in the case of specials.
(#5670) Don't trigger refresh from a failed resource
Fixed #6554 - Missing $haveftool if/else conditional in install.rb breaking Ruby 1.9
Diffstat (limited to 'lib/puppet/util')
-rw-r--r-- | lib/puppet/util/metric.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/puppet/util/metric.rb b/lib/puppet/util/metric.rb index 09bbb6137..835e1d610 100644 --- a/lib/puppet/util/metric.rb +++ b/lib/puppet/util/metric.rb @@ -122,7 +122,7 @@ class Puppet::Util::Metric def initialize(name,label = nil) @name = name.to_s - @label = label || labelize(name) + @label = label || self.class.labelize(name) @values = [] end @@ -133,7 +133,7 @@ class Puppet::Util::Metric def newvalue(name,value,label = nil) raise ArgumentError.new("metric name #{name.inspect} is not a string") unless name.is_a? String - label ||= labelize(name) + label ||= self.class.labelize(name) @values.push [name,label,value] end @@ -174,10 +174,8 @@ class Puppet::Util::Metric @values.sort { |a, b| a[1] <=> b[1] } end - private - # Convert a name into a label. - def labelize(name) + def self.labelize(name) name.to_s.capitalize.gsub("_", " ") end end |