class Surak::FileWatcherWrapper

Attributes

files_to_monitor[RW]

Public Class Methods

new() click to toggle source
# File lib/surak.rb, line 40
def initialize
  self.files_to_monitor = [
    'src',
    'surak.json'
  ]
  self.grunt
end

Public Instance Methods

grunt() click to toggle source
# File lib/surak.rb, line 48
def grunt
  grunt_output = `grunt`
  puts "\n#{grunt_output}\n"
end
start() click to toggle source
# File lib/surak.rb, line 53
def start
  FileWatcher.new(self.files_to_monitor).watch() do |filename, event|
    if(event == :changed)
      puts "File updated: " + filename
    end
    if(event == :delete)
      puts "File deleted: " + filename
    end
    if(event == :new)
      puts "Added file: " + filename
    end
    self.grunt
  end
end