Sha256: 6ed29f8e4658e683b48c2d1e196836d711ea287c3ec5cb8be59fd1d4e11e3462
Contents?: true
Size: 961 Bytes
Versions: 1
Compression:
Stored size: 961 Bytes
Contents
require 'shipitron' module Shipitron module Client class LoadTemplates include Metaractor required :ecs_task_def_dir required :ecs_service_dir def call context.ecs_task_def_templates = load_templates(ecs_task_def_dir) context.ecs_service_templates = load_templates(ecs_service_dir) end private def ecs_task_def_dir context.ecs_task_def_dir end def ecs_service_dir context.ecs_service_dir end def load_templates(dir) search_path = Pathname.new(dir) unless search_path.directory? fail_with_error!( message: "directory '#{dir}' does not exist" ) end templates = [] search_path.find do |path| next if path.directory? templates << path.read end Logger.debug "Templates loaded: #{templates.inspect}" templates end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
shipitron-0.2.0 | lib/shipitron/client/load_templates.rb |