inspec/lib/vulcano/plugins/backend.rb

28 lines
615 B
Ruby
Raw Normal View History

# encoding: utf-8
require 'digest'
module Vulcano::Plugins
class Backend
autoload :FileCommon, 'vulcano/plugins/backend_file_common'
autoload :LinuxFile, 'vulcano/plugins/backend_linux_file'
2015-09-05 14:07:54 +00:00
def self.name(name)
Vulcano::Plugins::Backend.__register(name, self)
end
# raise errors for all missing methods
%w{ file run_command os }.each do |m|
define_method(m.to_sym) do |*args|
fail NotImplementedError.new("Backend must implement the #{m}() method.")
end
end
def self.__register(id, obj)
Vulcano::Backend.registry[id] = obj
end
end
end