Class: VagrantReflect::Reflector

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-reflect/util/reflector.rb

Overview

Reflector instance

Constant Summary collapse

SIGNALS =
%w(TERM INT).freeze

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Reflector

Returns a new instance of Reflector.



12
13
14
# File 'lib/vagrant-reflect/util/reflector.rb', line 12

def initialize(path)
  @path = Pathname.new(File.expand_path(path))
end

Instance Method Details

#runObject



16
17
18
19
20
21
22
23
24
25
# File 'lib/vagrant-reflect/util/reflector.rb', line 16

def run
  setup_signals
  start

  @thread = Thread.current
  Thread.stop
rescue ShutdownSignal
  stop
  shutdown_signals
end