Sha256: b220fcee3862a8c29fecba6facf07c6a0648a14069302c947229f64c88e19ed0

Contents?: true

Size: 462 Bytes

Versions: 32

Compression:

Stored size: 462 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

32 entries across 32 versions & 1 rubygems

Version Path
puppet-8.10.0 lib/puppet/util/file_watcher.rb
puppet-8.10.0-x86-mingw32 lib/puppet/util/file_watcher.rb
puppet-8.10.0-x64-mingw32 lib/puppet/util/file_watcher.rb
puppet-8.10.0-universal-darwin lib/puppet/util/file_watcher.rb
puppet-8.9.0 lib/puppet/util/file_watcher.rb
puppet-8.9.0-x86-mingw32 lib/puppet/util/file_watcher.rb
puppet-8.9.0-x64-mingw32 lib/puppet/util/file_watcher.rb
puppet-8.9.0-universal-darwin lib/puppet/util/file_watcher.rb
puppet-8.8.1 lib/puppet/util/file_watcher.rb
puppet-8.8.1-x86-mingw32 lib/puppet/util/file_watcher.rb
puppet-8.8.1-x64-mingw32 lib/puppet/util/file_watcher.rb
puppet-8.8.1-universal-darwin lib/puppet/util/file_watcher.rb
puppet-8.7.0 lib/puppet/util/file_watcher.rb
puppet-8.7.0-x86-mingw32 lib/puppet/util/file_watcher.rb
puppet-8.7.0-x64-mingw32 lib/puppet/util/file_watcher.rb
puppet-8.7.0-universal-darwin lib/puppet/util/file_watcher.rb
puppet-8.6.0 lib/puppet/util/file_watcher.rb
puppet-8.6.0-x86-mingw32 lib/puppet/util/file_watcher.rb
puppet-8.6.0-x64-mingw32 lib/puppet/util/file_watcher.rb
puppet-8.6.0-universal-darwin lib/puppet/util/file_watcher.rb