Sha256: ab303ff0df7500af77a0b664c865fae0f9f1f391f57c3f6b84159ede49bf4bd8

Contents?: true

Size: 821 Bytes

Versions: 91

Compression:

Stored size: 821 Bytes

Contents

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

Version data entries

91 entries across 91 versions & 2 rubygems

Version Path
facter-2.5.7 lib/facter/util/partitions.rb
facter-2.5.7-x86-mingw32 lib/facter/util/partitions.rb
facter-2.5.7-x64-mingw32 lib/facter/util/partitions.rb
facter-2.5.7-universal-darwin lib/facter/util/partitions.rb
facter-2.5.6-x86-mingw32 lib/facter/util/partitions.rb
facter-2.5.6-x64-mingw32 lib/facter/util/partitions.rb
facter-2.5.6-universal-darwin lib/facter/util/partitions.rb
facter-2.5.6 lib/facter/util/partitions.rb
facter-2.5.5-x86-mingw32 lib/facter/util/partitions.rb
facter-2.5.5-x64-mingw32 lib/facter/util/partitions.rb
facter-2.5.5-universal-darwin lib/facter/util/partitions.rb
facter-2.5.5 lib/facter/util/partitions.rb
facter-2.5.4-x86-mingw32 lib/facter/util/partitions.rb
facter-2.5.4-x64-mingw32 lib/facter/util/partitions.rb
facter-2.5.4-universal-darwin lib/facter/util/partitions.rb
facter-2.5.4 lib/facter/util/partitions.rb
bolt-0.24.0 vendored/facter/lib/facter/util/partitions.rb
bolt-0.23.0 vendored/facter/lib/facter/util/partitions.rb
bolt-0.22.0 vendored/facter/lib/facter/util/partitions.rb
bolt-0.21.8 vendored/facter/lib/facter/util/partitions.rb