Sha256: 91328bdf1edf8ff3eae1f23831720310d526c20a73ded56d89c068e74d36866d

Contents?: true

Size: 863 Bytes

Versions: 1

Compression:

Stored size: 863 Bytes

Contents

# Handles the read and write of the runt file
require 'filewatcher'
module Runter

  class Application
     def initialize
       @name      = "runter"
       @runtFile  = Runter::Runtfile.new
     end

     def run
       puts "Runter started..."
       start_watch()
     end

     def start_watch() 
       filesToWatch = []
       @runtFile.get_watchers().each{|watcher| 
         filesToWatch.push(*watcher.get_watch_files())
       }
       FileWatcher.new(filesToWatch).watch() do |filename, event|
         handle_change(filename)  
       end 
     end

     def handle_change(file)
       @runtFile.get_watchers().each{|watcher|
         watcher.handle_change(file)
       }
     end
  end
 
  class << self
    def application
      @application ||= Runter::Application.new
    end
    def application=(app)
      @application = app
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
runter-0.1.0 lib/runter/application.rb