Module: Footman::Watcher

Extended by:
Watcher
Included in:
Watcher
Defined in:
lib/footman/watcher.rb

Instance Method Summary collapse

Instance Method Details

#buildObject



7
8
9
10
11
12
13
# File 'lib/footman/watcher.rb', line 7

def build
  ::Listen::Listener.new(config.directory, relative_paths: false) do |_modified, added, _removed|
    added.each do |file|
      package(file).process
    end
  end
end

#configObject



19
20
21
# File 'lib/footman/watcher.rb', line 19

def config
  Footman.config
end

#package(file) ⇒ Object



23
24
25
# File 'lib/footman/watcher.rb', line 23

def package(file)
  Package.factory(file)
end

#startObject



15
16
17
# File 'lib/footman/watcher.rb', line 15

def start
  build.start
end