2015-08-13 01:48:17 +00:00
|
|
|
# encoding: utf-8
|
|
|
|
|
2015-08-13 03:47:02 +00:00
|
|
|
module Vulcano::Targets
|
2015-08-13 05:34:24 +00:00
|
|
|
class FileHelper
|
2015-08-13 03:47:02 +00:00
|
|
|
def handles?(target)
|
2015-09-04 07:15:20 +00:00
|
|
|
File.file?(target) and target.end_with?('.rb')
|
2015-08-13 03:47:02 +00:00
|
|
|
end
|
2015-08-13 01:48:17 +00:00
|
|
|
|
2015-08-13 03:47:02 +00:00
|
|
|
def resolve(target)
|
|
|
|
{
|
2015-09-04 07:15:20 +00:00
|
|
|
content: File.read(target),
|
2015-08-13 03:47:02 +00:00
|
|
|
ref: target
|
|
|
|
}
|
|
|
|
end
|
2015-08-13 01:48:17 +00:00
|
|
|
end
|
|
|
|
|
2015-08-13 05:34:24 +00:00
|
|
|
Vulcano::Targets.add_module('file', FileHelper.new)
|
2015-08-13 03:47:02 +00:00
|
|
|
end
|