Sha256: 5f82fefb74b139fdf1f87db2f9029d8bf10169a9dc6f8c8240dce6d54011b97d

Contents?: true

Size: 582 Bytes

Versions: 20

Compression:

Stored size: 582 Bytes

Contents

require 'shipitron'
require 'yaml'
require 'mustache'

module Shipitron
  module Server
    class ParseTemplates
      include Metaractor

      required :templates
      required :template_context

      def call
        parsed = []
        templates.each do |template|
          parsed << Smash.new(YAML.load(Mustache.render(template, template_context)))
        end

        context.parsed_templates = parsed
      end

      private
      def templates
        context.templates
      end

      def template_context
        context.template_context
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
shipitron-1.4.1 lib/shipitron/parse_templates.rb
shipitron-1.4.0 lib/shipitron/parse_templates.rb
shipitron-1.3.2 lib/shipitron/parse_templates.rb
shipitron-1.3.1 lib/shipitron/parse_templates.rb
shipitron-1.3.0 lib/shipitron/parse_templates.rb
shipitron-1.2.1 lib/shipitron/parse_templates.rb
shipitron-1.2.0 lib/shipitron/parse_templates.rb
shipitron-1.1.0 lib/shipitron/parse_templates.rb
shipitron-1.0.1 lib/shipitron/parse_templates.rb
shipitron-1.0.0 lib/shipitron/parse_templates.rb
shipitron-0.4.1 lib/shipitron/parse_templates.rb
shipitron-0.4.0 lib/shipitron/parse_templates.rb
shipitron-0.3.5 lib/shipitron/parse_templates.rb
shipitron-0.3.4 lib/shipitron/parse_templates.rb
shipitron-0.3.3 lib/shipitron/parse_templates.rb
shipitron-0.3.1 lib/shipitron/parse_templates.rb
shipitron-0.3.0 lib/shipitron/parse_templates.rb
shipitron-0.2.2 lib/shipitron/parse_templates.rb
shipitron-0.2.1 lib/shipitron/parse_templates.rb
shipitron-0.2.0 lib/shipitron/parse_templates.rb