class Puppet::ModuleTool::Applications::Checksummer

Public Instance Methods

run() click to toggle source
# File lib/puppet/module_tool/applications/checksummer.rb, line 13
def run
  changes = []
  sums = Puppet::ModuleTool::Checksums.new(@path)
  checksums.each do |child_path, canonical_checksum|

    # Avoid checksumming the checksums.json file
    next if File.basename(child_path) == "checksums.json"

    path = @path + child_path
    unless path.exist? && canonical_checksum == sums.checksum(path)
      changes << child_path
    end
  end

  # Return an Array of strings representing file paths of files that have
  # been modified since this module was installed. All paths are relative
  # to the installed module directory. This return value is used by the
  # module_tool face changes action, and displayed on the console.
  #
  # Example return value:
  #
  #   [ "REVISION", "manifests/init.pp"]
  #
  changes
end

Public Class Methods

new(path, options = {}) click to toggle source
# File lib/puppet/module_tool/applications/checksummer.rb, line 8
def initialize(path, options = {})
  @path = Pathname.new(path)
  super(options)
end