inspec/lib/vulcano/targets/file.rb

19 lines
319 B
Ruby
Raw Normal View History

# encoding: utf-8
module Vulcano::Targets
class FileHelper
def handles?(target)
2015-09-04 07:15:20 +00:00
File.file?(target) and target.end_with?('.rb')
end
def resolve(target)
{
2015-09-04 07:15:20 +00:00
content: File.read(target),
ref: target,
}
end
end
Vulcano::Targets.add_module('file', FileHelper.new)
end