Class: DependencyCheck

Inherits:
Object
  • Object
show all
Defined in:
lib/ubnt/usg/restore/dependency_check.rb

Instance Method Summary collapse

Instance Method Details

#has_dependencies?Boolean

Returns:

  • (Boolean)


15
16
17
18
19
# File 'lib/ubnt/usg/restore/dependency_check.rb', line 15

def has_dependencies?
  [ :has_filesystem_utils?, :has_filesystem_utils? ].all do |check|
    self.public_send(check)
  end
end

#has_extraction_utils?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/ubnt/usg/restore/dependency_check.rb', line 11

def has_extraction_utils?
  `which unzip`
end

#has_filesystem_utils?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/ubnt/usg/restore/dependency_check.rb', line 7

def has_filesystem_utils?
  `which mke2fs`
end

#has_partition_utils?Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/ubnt/usg/restore/dependency_check.rb', line 3

def has_partition_utils?
  `which parted`.any?
end