Sha256: a5b76815aa3438af7fda6e1f959cab20449297ef9430ff96bc5655dcb17ca275

Contents?: true

Size: 460 Bytes

Versions: 20

Compression:

Stored size: 460 Bytes

Contents

# frozen_string_literal: true
class Puppet::Util::FileWatcher
  include Enumerable

  def each(&blk)
    @files.keys.each(&blk)
  end

  def initialize
    @files = {}
  end

  def changed?
    @files.values.any?(&:changed?)
  end

  def watch(filename)
    return if watching?(filename)
    @files[filename] = Puppet::Util::WatchedFile.new(filename)
  end

  def watching?(filename)
    @files.has_key?(filename)
  end

  def clear
    @files.clear
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
puppet-8.3.0 lib/puppet/util/file_watcher.rb
puppet-8.3.0-x86-mingw32 lib/puppet/util/file_watcher.rb
puppet-8.3.0-x64-mingw32 lib/puppet/util/file_watcher.rb
puppet-8.3.0-universal-darwin lib/puppet/util/file_watcher.rb
puppet-8.3.1 lib/puppet/util/file_watcher.rb
puppet-8.3.1-x86-mingw32 lib/puppet/util/file_watcher.rb
puppet-8.3.1-x64-mingw32 lib/puppet/util/file_watcher.rb
puppet-8.3.1-universal-darwin lib/puppet/util/file_watcher.rb
puppet-8.2.0 lib/puppet/util/file_watcher.rb
puppet-8.2.0-x86-mingw32 lib/puppet/util/file_watcher.rb
puppet-8.2.0-x64-mingw32 lib/puppet/util/file_watcher.rb
puppet-8.2.0-universal-darwin lib/puppet/util/file_watcher.rb
puppet-8.1.0 lib/puppet/util/file_watcher.rb
puppet-8.1.0-x86-mingw32 lib/puppet/util/file_watcher.rb
puppet-8.1.0-x64-mingw32 lib/puppet/util/file_watcher.rb
puppet-8.1.0-universal-darwin lib/puppet/util/file_watcher.rb
puppet-8.0.1 lib/puppet/util/file_watcher.rb
puppet-8.0.1-x86-mingw32 lib/puppet/util/file_watcher.rb
puppet-8.0.1-x64-mingw32 lib/puppet/util/file_watcher.rb
puppet-8.0.1-universal-darwin lib/puppet/util/file_watcher.rb