HEX
Server: Apache
System: Linux sg241.singhost.net 2.6.32-896.16.1.lve1.4.51.el6.x86_64 #1 SMP Wed Jan 17 13:19:23 EST 2018 x86_64
User: honghock (909)
PHP: 8.0.30
Disabled: passthru,system,shell_exec,show_source,exec,popen,proc_open
Upload Files
File: //proc/self/root/usr/lib/ruby/site_ruby/1.8/facter/util/partitions.rb
require 'facter/util/partitions/linux'
require 'facter/util/partitions/openbsd'

module Facter::Util::Partitions
  IMPLEMENTATIONS = {
    'Linux'   => Linux,
    'OpenBSD' => OpenBSD,
  }

  module NoImplementation
    def self.list
      []
    end
  end

  def self.implementation
    IMPLEMENTATIONS[Facter.fact(:kernel).value] || NoImplementation
  end

  def self.list
    implementation.list
  end

  def self.uuid(partition)
    implementation.uuid(partition)
  end

  def self.size(partition)
    implementation.size(partition)
  end

  def self.mount(partition)
    implementation.mount(partition)
  end

  def self.filesystem(partition)
    implementation.filesystem(partition)
  end

  def self.label(partition)
    implementation.label(partition)
  end

  def self.available?
    !self.list.empty?
  end
end