Sha256: a1f34c1210fbf53056ea5928e16cf1b7449ca3150253320972e1c55877dbdcbc

Contents?: true

Size: 730 Bytes

Versions: 18

Compression:

Stored size: 730 Bytes

Contents

require 'fileutils'

module LinuxAdmin
  class Partition
    include Mountable

    attr_accessor :id
    attr_accessor :partition_type
    attr_accessor :start_sector
    attr_accessor :end_sector
    attr_accessor :size
    attr_accessor :disk

    def initialize(args={})
      @id      = args[:id]
      @size    = args[:size]
      @disk    = args[:disk]
      @fs_type = args[:fs_type]
      @start_sector   = args[:start_sector]
      @end_sector     = args[:end_sector]
      @partition_type = args[:partition_type]
    end

    def path
      "#{disk.path}#{id}"
    end

    def mount(mount_point=nil)
      mount_point ||= "/mnt/#{disk.path.split(File::SEPARATOR).last}#{id}"
      super(mount_point)
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
linux_admin-1.2.2 lib/linux_admin/partition.rb
linux_admin-1.2.1 lib/linux_admin/partition.rb
linux_admin-1.0.1 lib/linux_admin/partition.rb
linux_admin-1.2.0 lib/linux_admin/partition.rb
linux_admin-1.1.0 lib/linux_admin/partition.rb
linux_admin-1.0.0 lib/linux_admin/partition.rb
linux_admin-0.20.2 lib/linux_admin/partition.rb
linux_admin-0.20.1 lib/linux_admin/partition.rb
linux_admin-0.20.0 lib/linux_admin/partition.rb
linux_admin-0.19.0 lib/linux_admin/partition.rb
linux_admin-0.18.0 lib/linux_admin/partition.rb
linux_admin-0.17.0 lib/linux_admin/partition.rb
linux_admin-0.16.0 lib/linux_admin/partition.rb
linux_admin-0.15.0 lib/linux_admin/partition.rb
linux_admin-0.14.0 lib/linux_admin/partition.rb
linux_admin-0.13.0 lib/linux_admin/partition.rb
linux_admin-0.12.1 lib/linux_admin/partition.rb
linux_admin-0.12.0 lib/linux_admin/partition.rb