Sha256: 75abcec68e847160b5c7db5bb2d04ec6c759caef308a18213141e8c3602b767a
Contents?: true
Size: 920 Bytes
Versions: 22
Compression:
Stored size: 920 Bytes
Contents
module Ufo::Cfn::Stack::Builder::Resources::IamRoles class Base < Ufo::Cfn::Stack::Builder::Base def build return unless self.class.build? # important because it runs DSL#evaluate Ufo::IamRole::Builder.new(self.class.role_type).build end class << self def role_type self.name.to_s.split("::").last.underscore end def build? path = lookup_path return unless path.nil? || File.exist?(path) Ufo::IamRole::DSL.new(path).evaluate # runs the role.rb and registers items Ufo::IamRole::Builder.new(role_type).build? end def lookup_path iam_roles = "#{Ufo.root}/.ufo/resources/iam_roles" paths = ["#{Ufo.app}/#{role_type}", "#{role_type}"] paths.map! do |path| "#{iam_roles}/#{path}.rb" end paths.find do |path| File.exist?(path) end end end end end
Version data entries
22 entries across 22 versions & 1 rubygems