Permalink
Browse files

fix in case the unit is not uppercase (kB for kilobytes is an example)

  • Loading branch information...
1 parent abbe888 commit a53edb355dfe7ef026f92b30c6f3977cbcf2f072 @patcoll committed Jan 8, 2013
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/ohai/plugins/darwin/memory.rb
@@ -24,10 +24,10 @@
stdin.close
stdout.each do |line|
if line =~ /PhysMem:/
- memory[:total] = "#{$1}#{$2}B" if line =~ /(\d+)([A-Z]{1})\s+used/
- memory[:free] = "#{$1}#{$2}B" if line =~ /(\d+)([A-Z]{1})\s+free/
- memory[:active] = "#{$1}#{$2}B" if line =~ /(\d+)([A-Z]{1})\s+active/
- memory[:inactive] = "#{$1}#{$2}B" if line =~ /(\d+)([A-Z]{1})\s+inactive/
+ memory[:total] = "#{$1}#{$2}B" if line =~ /(\d+)([a-z]{1})\s+used/i
+ memory[:free] = "#{$1}#{$2}B" if line =~ /(\d+)([a-z]{1})\s+free/i
+ memory[:active] = "#{$1}#{$2}B" if line =~ /(\d+)([a-z]{1})\s+active/i
+ memory[:inactive] = "#{$1}#{$2}B" if line =~ /(\d+)([a-z]{1})\s+inactive/i
end
end
end

0 comments on commit a53edb3

Please sign in to comment.