Sha256: 9c0b48a2b4aa7599b705fe7fdd040217668a3080df9c69173957383b30916d18

Contents?: true

Size: 1023 Bytes

Versions: 22

Compression:

Stored size: 1023 Bytes

Contents

#          Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com
# All files in this distribution are subject to the terms of the Ruby license.

require 'remarkably/engines/html'

module Ramaze
  module Template

    # Is responsible for compiling a template using the Remarkably templating engine.
    # Can be found at: http://rubyforge.org/projects/remarkably

    class Remarkably < Template
      ENGINES[self] = %w[ rem ]

      class << self

        # Entry point for Action#render

        def transform action
          result, file = result_and_file(action)

          result = transform_string(file, action) if file
          result.to_s
        end

        # Takes a string and action, sets args to action.args and then proceeds
        # to instance_eval the string inside the action.instance

        def transform_string(string, action)
          action.instance.instance_eval do
            args = action.params
            instance_eval(string)
          end
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 5 rubygems

Version Path
Pistos-ramaze-2008.09 lib/ramaze/template/remarkably.rb
Pistos-ramaze-2008.12 lib/ramaze/template/remarkably.rb
Pistos-ramaze-2009.01 lib/ramaze/template/remarkably.rb
Pistos-ramaze-2009.02 lib/ramaze/template/remarkably.rb
clivecrous-ramaze-0.3.9.5 lib/ramaze/template/remarkably.rb
manveru-ramaze-2008.07 lib/ramaze/template/remarkably.rb
manveru-ramaze-2008.08 lib/ramaze/template/remarkably.rb
manveru-ramaze-2008.09 lib/ramaze/template/remarkably.rb
manveru-ramaze-2008.10 lib/ramaze/template/remarkably.rb
manveru-ramaze-2008.12 lib/ramaze/template/remarkably.rb
manveru-ramaze-2009.01 lib/ramaze/template/remarkably.rb
ptomato-ramaze-2009.02.1 lib/ramaze/template/remarkably.rb
ptomato-ramaze-2009.02 lib/ramaze/template/remarkably.rb
ramaze-0.3.0 lib/ramaze/template/remarkably.rb
ramaze-0.3.5 lib/ramaze/template/remarkably.rb
ramaze-0.3.9.1 lib/ramaze/template/remarkably.rb
ramaze-2008.06 lib/ramaze/template/remarkably.rb
ramaze-0.3.9 lib/ramaze/template/remarkably.rb
ramaze-2009.01 lib/ramaze/template/remarkably.rb
ramaze-2008.11 lib/ramaze/template/remarkably.rb