Sha256: 11cc3a862fb94e63f19ec7ff4d6501f4257a8b18e092d9b5a405e69c07266ff9

Contents?: true

Size: 676 Bytes

Versions: 9

Compression:

Stored size: 676 Bytes

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/core_ext'
require 'avm/files/appendable/resource_base'

module Avm
  module Files
    module Appendable
      class TemplatizedDirectory < ::Avm::Files::Appendable::ResourceBase
        attr_reader :source_path

        def initialize(appender, source_path)
          super(appender)
          @source_path = source_path
        end

        def write_on(target_dir)
          raise 'Variables source not set' if appender.variables_source.blank?

          ::EacTemplates::Directory.new(source_path).apply(
            appender.variables_source,
            target_dir
          )
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
avm-tools-0.103.1 lib/avm/files/appendable/templatized_directory.rb
avm-tools-0.103.0 lib/avm/files/appendable/templatized_directory.rb
avm-tools-0.102.2 lib/avm/files/appendable/templatized_directory.rb
avm-tools-0.102.1 lib/avm/files/appendable/templatized_directory.rb
avm-tools-0.102.0 lib/avm/files/appendable/templatized_directory.rb
avm-tools-0.101.0 lib/avm/files/appendable/templatized_directory.rb
avm-tools-0.100.0 lib/avm/files/appendable/templatized_directory.rb
avm-tools-0.99.1 lib/avm/files/appendable/templatized_directory.rb
avm-tools-0.99.0 lib/avm/files/appendable/templatized_directory.rb