~gandelman-a/ubuntu/precise/facter/merge922788

« back to all changes in this revision

Viewing changes to lib/facter/util/memory.rb

  • Committer: Package Import Robot
  • Author(s): Adam Gandelman
  • Date: 2011-10-18 10:32:42 UTC
  • mfrom: (1.3.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: package-import@ubuntu.com-20111018103242-ag8i8vejfp8v7b1b
Tags: upstream-1.6.1
ImportĀ upstreamĀ versionĀ 1.6.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
## memory.rb
2
2
## Support module for memory related facts
3
3
##
4
 
## This program is free software; you can redistribute it and/or
5
 
## modify it under the terms of the GNU General Public License
6
 
## as published by the Free Software Foundation (version 2 of the License)
7
 
## This program is distributed in the hope that it will be useful,
8
 
## but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
 
## GNU General Public License for more details.
11
 
## You should have received a copy of the GNU General Public License
12
 
## along with this program; if not, write to the Free Software
13
 
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston MA  02110-1301 USA
14
 
##
15
4
 
16
5
module Facter::Memory
17
6
    require 'thread'
75
64
        memspecfree = 0
76
65
 
77
66
        vmstats = Facter::Util::Resolution.exec('vm_stat')
78
 
        vmstats.each do |vmline|
 
67
        vmstats.each_line do |vmline|
79
68
          case
80
69
            when vmline =~ /page\ssize\sof\s(\d+)\sbytes/
81
70
              pagesize = $1.to_i
94
83
        end
95
84
    end
96
85
end
97