ManageIQ/httpd_configmap_generator

View on GitHub
lib/httpd_configmap_generator/base/config_helper.rb

Summary

Maintainability
A
0 mins
Test Coverage
D
66%
require "active_support"
require "active_support/core_ext" # for Time.current

module HttpdConfigmapGenerator
  class Base
    module ConfigHelper
      def config_file_backup(path)
        if File.exist?(path)
          timestamp = Time.current.strftime(TIMESTAMP_FORMAT)
          FileUtils.copy(path, "#{path}.#{timestamp}")
        end
      end
    end
  end
end