Class: Eve::FileNotifierConnection

Inherits:
EventMachine::FileWatch
  • Object
show all
Defined in:
lib/eve/file_notifier_server.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#appObject

Returns the value of attribute app.



55
56
57
# File 'lib/eve/file_notifier_server.rb', line 55

def app
  @app
end

#serverObject

Returns the value of attribute server.



56
57
58
# File 'lib/eve/file_notifier_server.rb', line 56

def server
  @server
end

Class Method Details

.run(args) ⇒ Object



67
68
69
70
71
72
73
# File 'lib/eve/file_notifier_server.rb', line 67

def self.run(args)
  @@data = FileNotifierServer.handle_args(args)
  EM.kqueue = true if EM.kqueue? # file watching requires kqueue on OSX
  EM.run {
    EM.watch_file(@@data[:source], FileNotifierConnection)
  }
end

Instance Method Details

#file_modifiedObject



63
64
65
# File 'lib/eve/file_notifier_server.rb', line 63

def file_modified
  @server.file_modified
end

#post_initObject



58
59
60
61
# File 'lib/eve/file_notifier_server.rb', line 58

def post_init
  @server = FileNotifierServer.new(self,@@data)
  @server.post_init
end