Class: Space::Source::Watch
- Inherits:
-
Object
- Object
- Space::Source::Watch
- Defined in:
- lib/space/source/watch.rb
Constant Summary collapse
- LATENCY =
0.1
- NO_DEFER =
FALSE
Instance Attribute Summary collapse
-
#callback ⇒ Object
readonly
Returns the value of attribute callback.
-
#fsevent ⇒ Object
readonly
Returns the value of attribute fsevent.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path, &block) ⇒ Watch
constructor
A new instance of Watch.
- #run ⇒ Object
Constructor Details
#initialize(path, &block) ⇒ Watch
Returns a new instance of Watch.
11 12 13 14 15 |
# File 'lib/space/source/watch.rb', line 11 def initialize(path, &block) @path = File.(path) @callback = block @fsevent = FSEvent.new end |
Instance Attribute Details
#callback ⇒ Object (readonly)
Returns the value of attribute callback.
9 10 11 |
# File 'lib/space/source/watch.rb', line 9 def callback @callback end |
#fsevent ⇒ Object (readonly)
Returns the value of attribute fsevent.
9 10 11 |
# File 'lib/space/source/watch.rb', line 9 def fsevent @fsevent end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
9 10 11 |
# File 'lib/space/source/watch.rb', line 9 def path @path end |
Instance Method Details
#run ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/space/source/watch.rb', line 17 def run @thread = Thread.new do log "WATCHING #{path}" watch end self end |