Class: GlubyTK::Listener

Inherits:
Object
  • Object
show all
Defined in:
lib/gluby-tk/listener.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeListener

Returns a new instance of Listener.



6
7
8
9
10
11
12
13
# File 'lib/gluby-tk/listener.rb', line 6

def initialize
  GlubyTK.gputs "Starting listener..."
  @listener = Listen.to(Dir.pwd) do |modified, added, removed|
    GlubyTK::Generator.rebuild if (modified + added + removed).map{|path| File.extname(path)}.select{|extension| extension == '.glade'}.any?
  end
  @listener.start
  sleep
end

Instance Attribute Details

#listenerObject

Returns the value of attribute listener.



4
5
6
# File 'lib/gluby-tk/listener.rb', line 4

def listener
  @listener
end