Module: DockerSync::Dependencies::Fswatch

Defined in:
lib/docker-sync/dependencies/fswatch.rb

Constant Summary collapse

UNSUPPORTED =
'Fswatch is not expected to run on platforms other then MacOS'

Class Method Summary collapse

Class Method Details

.available?Boolean

Returns:

  • (Boolean)


6
7
8
9
10
# File 'lib/docker-sync/dependencies/fswatch.rb', line 6

def self.available?
  forbid! unless Environment.mac?
  return @available if defined? @available
  @available = find_executable0('fswatch')
end

.ensure!Object



12
13
14
15
16
17
18
# File 'lib/docker-sync/dependencies/fswatch.rb', line 12

def self.ensure!
  return if available?

  PackageManager.install_package('fswatch')
  puts "please restart docker sync so the installation of fswatch takes effect"
  exit(1)
end

.forbid!Object

Raises:



20
21
22
# File 'lib/docker-sync/dependencies/fswatch.rb', line 20

def self.forbid!
  raise UNSUPPORTED
end