Class: GlubyTK::Listener
- Inherits:
-
Object
- Object
- GlubyTK::Listener
- Defined in:
- lib/gluby-tk/listener.rb
Instance Attribute Summary collapse
-
#listener ⇒ Object
Returns the value of attribute listener.
Instance Method Summary collapse
-
#initialize ⇒ Listener
constructor
A new instance of Listener.
Constructor Details
#initialize ⇒ Listener
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
#listener ⇒ Object
Returns the value of attribute listener.
4 5 6 |
# File 'lib/gluby-tk/listener.rb', line 4 def listener @listener end |