Sha256: 087ead5e7cd710e247f1b70e8897d08f956191628c98fa9e5f5db6d82cef2814

Contents?: true

Size: 542 Bytes

Versions: 10

Compression:

Stored size: 542 Bytes

Contents

require 'pathname'

module Vagrant
  module Util
    class Directory
      # Check if directory has any new updates
      #
      # @param [Pathname, String] Path to directory
      # @param [Time] time to compare to eg. has any file in dir_path
      #               changed since this time
      # @return [Boolean]
      def self.directory_changed?(dir_path, threshold_time)
        Dir.glob(Pathname.new(dir_path).join("**", "*")).any? do |path|
          Pathname.new(path).mtime > threshold_time
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
vagrant-unbundled-2.3.6.0 lib/vagrant/util/directory.rb
tamtam-vagrant-reload-1.2.1 vendor/cache/vagrant-2092df529ae7/lib/vagrant/util/directory.rb
vagrant-unbundled-2.3.3.0 lib/vagrant/util/directory.rb
vagrant-unbundled-2.3.2.0 lib/vagrant/util/directory.rb
vagrant-unbundled-2.2.19.0 lib/vagrant/util/directory.rb
vagrant-unbundled-2.2.18.0 lib/vagrant/util/directory.rb
vagrant-unbundled-2.2.16.0 lib/vagrant/util/directory.rb
vagrant-unbundled-2.2.14.0 lib/vagrant/util/directory.rb
vagrant-aws-mkubenka-0.7.2.pre.24 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-22795b161bf6/lib/vagrant/util/directory.rb
vagrant-unbundled-2.2.10.0 lib/vagrant/util/directory.rb