Method: Cyborg::Assets::AssetType#watch

Defined in:
lib/cyborg/plugin/assets/asset.rb

#watchObject



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/cyborg/plugin/assets/asset.rb', line 110

def watch

  @throttle = 4
  @last_build = 0
  
  puts "Watching for changes to #{base.sub(plugin.root+'/', '')}...".colorize(:light_yellow)

  Thread.new {
    listener = Listen.to(base) do |modified, added, removed|
      change(modified, added, removed)
    end

    listener.start # not blocking
    sleep
  }
end