Sha256: 87d454ebac2cc4cdaf4de9de04472fc7f1b69b3b582b0b4740b8cb12e2dd348e

Contents?: true

Size: 549 Bytes

Versions: 25

Compression:

Stored size: 549 Bytes

Contents

# frozen_string_literal: true

#
# Copyright 2013 whiteleaf. All rights reserved.
#

module Device::Library
  module Mac
    def get_device_root_dir(volume_name)
      %w(/Volumes).each do |mount_root|
        path = File.join(mount_root, volume_name)
        if File.directory?(path)
          return path
        end
      end
      nil
    end

    def eject(volume_name)
      status, stdio, stderr = systemu("diskutil eject #{volume_name}")
      unless status.success?
        raise Device::CantEject, stderr.strip
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
narou-3.9.1 lib/device/library/mac.rb
narou-3.9.0 lib/device/library/mac.rb
narou-3.8.2 lib/device/library/mac.rb
narou-3.8.1 lib/device/library/mac.rb
narou-3.8.0 lib/device/library/mac.rb
narou-3.7.2 lib/device/library/mac.rb
narou-3.7.1 lib/device/library/mac.rb
narou-3.7.0 lib/device/library/mac.rb
narou-3.6.0 lib/device/library/mac.rb
narou-3.5.1 lib/device/library/mac.rb
narou-3.5.0.1 lib/device/library/mac.rb
narou-3.5.0 lib/device/library/mac.rb
narou-3.4.8 lib/device/library/mac.rb
narou-3.4.7.1 lib/device/library/mac.rb
narou-3.4.7 lib/device/library/mac.rb
narou-3.4.6.1 lib/device/library/mac.rb
narou-3.4.6 lib/device/library/mac.rb
narou-3.4.5 lib/device/library/mac.rb
narou-3.4.3 lib/device/library/mac.rb
narou-3.4.2 lib/device/library/mac.rb