Sha256: 8b7291e988d729b44ef846bc458d46845962bc10364eeb159482c36610e301fd

Contents?: true

Size: 620 Bytes

Versions: 14

Compression:

Stored size: 620 Bytes

Contents

module PKGWizard
  module Utils
    def self.filesystem_status
      fs = {}
      `df -P`.each_line do |line|
        case line
        when /^Filesystem\s+1024-blocks/
          next
        when /^(.+?)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+\%)\s+(.+)$/
          next if %{none tmpfs usbfs debugfs}.include? $1
          filesystem = $1
          fs[filesystem] = {}
          fs[filesystem][:kb_size] = $2
          fs[filesystem][:kb_used] = $3
          fs[filesystem][:kb_available] = $4
          fs[filesystem][:percent_used] = $5
          fs[filesystem][:mount] = $6
        end
      end
      fs
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
pkg-wizard-0.1.29 lib/pkg-wizard/utils.rb
pkg-wizard-0.1.28 lib/pkg-wizard/utils.rb
pkg-wizard-0.1.27 lib/pkg-wizard/utils.rb
pkg-wizard-0.1.26 lib/pkg-wizard/utils.rb
pkg-wizard-0.1.25 lib/pkg-wizard/utils.rb
pkg-wizard-0.1.24 lib/pkg-wizard/utils.rb
pkg-wizard-0.1.23 lib/pkg-wizard/utils.rb
pkg-wizard-0.1.22 lib/pkg-wizard/utils.rb
pkg-wizard-0.1.21 lib/pkg-wizard/utils.rb
pkg-wizard-0.1.19 lib/pkg-wizard/utils.rb
pkg-wizard-0.1.18 lib/pkg-wizard/utils.rb
pkg-wizard-0.1.17 lib/pkg-wizard/utils.rb
pkg-wizard-0.1.16 lib/pkg-wizard/utils.rb
pkg-wizard-0.1.15 lib/pkg-wizard/utils.rb