require 'fileutils' module RCM class File attr_accessor :path, :owner, :group, :mode, :src_path, :changed def ==(other) return false unless other.is_a?(RCM::File) return false if @path.empty? || other.path.empty? ::FileUtils.compare_file(@path, other.path) && @owner == other.owner && @group == other.group && @mode == other.mode end def initialize(path, owner, group, mode, src_path) @path = path @owner = owner @group = group @mode = mode @src_path = src_path @changed = false end def to_s "Path = #{@path}\n" + "Owner = #{@owner}\n" + "Group = #{@group}\n" + "Mode = #{@mode}\n" + "Source Path = #{src_path}\n" + "Changed = #{@changed}" end end end