Sha256: c8007c0bd9af64f079e58397a2969ac89bb54f2dae5fbe3c9a78b943854fbe1d

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

require 'locomotive/mounter'

module Locomotive
  module Mounter
    module Models
      class Page

        def render(context)
          self.parse(context).render(context)
        end

        protected

        def parse(context)
          options =  {
            page:           self,
            mounting_point: context.registers[:mounting_point],
            error_mode:     :strict,
            count_lines:    true
          }

          begin
            template = ::Liquid::Template.parse(self.source, options)
          rescue Liquid::SyntaxError => e
            # do it again on the raw source instead so that the error line matches
            # the source file.
            ::Liquid::Template.parse(self.template.raw_source, options)
          end
        end

      end
    end

    module Reader
      module FileSystem
        class Runner

          def new_mounting_point(host)
            self.mounting_point
          end

        end
      end
    end

    class MountingPoint

      def assets_path
        File.join(self.path, 'public')
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
locomotivecms_steam-0.1.1 lib/locomotive/steam/monkey_patches/mounter.rb