Sha256: e67b0c02be68ddd9a95f75878ddeedb93a5b88d0d643e100ba7f698d275c433a

Contents?: true

Size: 369 Bytes

Versions: 17

Compression:

Stored size: 369 Bytes

Contents

module MagLove
  module Tilt
    class YamlTemplate < ::Tilt::Template
      self.default_mime_type = 'application/json'

      def prepare
      end

      def evaluate(scope, locals, &block)
        @output ||= YAML.load(data).to_json
      end

      def allows_script?
        false
      end
    end
  end
end

Tilt.mappings["yml"] = [MagLove::Tilt::YamlTemplate]

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
maglove-1.1.5 lib/maglove/tilt/yaml_template.rb
maglove-1.1.4 lib/maglove/tilt/yaml_template.rb
maglove-1.1.3 lib/maglove/tilt/yaml_template.rb
maglove-2.0.4 lib/maglove/tilt/yaml_template.rb
maglove-2.0.2 lib/maglove/tilt/yaml_template.rb
maglove-2.0.1 lib/maglove/tilt/yaml_template.rb
maglove-1.1.2 lib/maglove/tilt/yaml_template.rb
maglove-2.0.0 lib/maglove/tilt/yaml_template.rb
maglove-1.1.1 lib/maglove/tilt/yaml_template.rb
maglove-1.1.0 lib/maglove/tilt/yaml_template.rb
maglove-1.0.9 lib/maglove/tilt/yaml_template.rb
maglove-1.0.8 lib/maglove/tilt/yaml_template.rb
maglove-1.0.7 lib/maglove/tilt/yaml_template.rb
maglove-1.0.5 lib/maglove/tilt/yaml_template.rb
maglove-1.0.4 lib/maglove/tilt/yaml_template.rb
maglove-1.0.3 lib/maglove/tilt/yaml_template.rb
maglove-1.0.2 lib/maglove/tilt/yaml_template.rb