Sha256: 064ef98cd61013d7459c32be1f8279880aff04fbfd2e83a14d5ae3a06235b138
Contents?: true
Size: 679 Bytes
Versions: 3
Compression:
Stored size: 679 Bytes
Contents
require 'digest/md5' require 'ruby-wmi' class DriveInfo def self.md5sum_disk(dir) digest = Digest::MD5.new() files = Dir[dir + "VIDEO_TS/*.IFO"] files.sort.each{|f| digest << File.binread(f) } raise 'drive might not yet have disc in it? ' + dir unless files.length > 0 digest.hexdigest end def self.get_dvd_drives_as_win32ole disks = WMI::Win32_LogicalDisk.find(:all) disks.select{|d| d.Description =~ /CD-ROM/} # hope this works... end def self.get_drive_with_most_space_with_slash disks = WMI::Win32_LogicalDisk.find(:all) most_space = disks.sort_by{|d| d.FreeSpace.to_i}[-1] most_space.Name + "\\" end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
sensible-cinema-0.17.0 | lib/drive_info.rb |
sensible-cinema-0.16.7 | lib/drive_info.rb |
sensible-cinema-0.16.5 | lib/drive_info.rb |