2015-08-13 01:48:17 +00:00
|
|
|
# encoding: utf-8
|
2015-09-04 07:59:30 +00:00
|
|
|
|
2015-08-13 02:07:01 +00:00
|
|
|
require 'utils/modulator'
|
2015-08-13 01:48:17 +00:00
|
|
|
|
|
|
|
module Vulcano
|
|
|
|
module Targets
|
2015-08-13 02:07:01 +00:00
|
|
|
extend Modulator
|
2015-08-13 01:48:17 +00:00
|
|
|
|
2015-08-13 03:47:02 +00:00
|
|
|
def self.__resolve(items)
|
2015-09-09 10:18:42 +00:00
|
|
|
items.map do |_|
|
|
|
|
# @TODO
|
2015-08-13 03:47:02 +00:00
|
|
|
end.flatten
|
|
|
|
end
|
|
|
|
|
2015-08-13 01:48:17 +00:00
|
|
|
def self.resolve(targets)
|
|
|
|
Array(targets).map do |target|
|
2015-09-05 14:07:54 +00:00
|
|
|
handler = modules.values.find { |m| m.handles?(target) }
|
2015-08-13 01:48:17 +00:00
|
|
|
if handler.nil?
|
2015-09-04 07:59:30 +00:00
|
|
|
fail "Don't know how to handle target: #{target}"
|
2015-08-13 01:48:17 +00:00
|
|
|
end
|
|
|
|
handler.resolve(target)
|
|
|
|
end.flatten
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|