Class: Surak::FileWatcherWrapper
- Inherits:
-
Object
- Object
- Surak::FileWatcherWrapper
- Defined in:
- lib/surak.rb
Instance Attribute Summary collapse
-
#files_to_monitor ⇒ Object
Returns the value of attribute files_to_monitor.
Instance Method Summary collapse
- #grunt ⇒ Object
-
#initialize ⇒ FileWatcherWrapper
constructor
A new instance of FileWatcherWrapper.
- #start ⇒ Object
Constructor Details
#initialize ⇒ FileWatcherWrapper
Returns a new instance of FileWatcherWrapper.
40 41 42 43 44 45 46 |
# File 'lib/surak.rb', line 40 def initialize self.files_to_monitor = [ 'src', 'surak.json' ] self.grunt end |
Instance Attribute Details
#files_to_monitor ⇒ Object
Returns the value of attribute files_to_monitor.
39 40 41 |
# File 'lib/surak.rb', line 39 def files_to_monitor @files_to_monitor end |
Instance Method Details
#grunt ⇒ Object
48 49 50 51 |
# File 'lib/surak.rb', line 48 def grunt grunt_output = `grunt` puts "\n#{grunt_output}\n" end |
#start ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# 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 |