Sha256: 3e788977311d8d6e15e261a7f9b2d69bb360fe6ff583100cf023aea770d8bfed

Contents?: true

Size: 871 Bytes

Versions: 37

Compression:

Stored size: 871 Bytes

Contents

module Temple
  module Templates
    class Rails
      extend Mixins::Template

      def call(template)
        opts = {}.update(self.class.options).update(file: template.identifier)
        self.class.compile(template.source, opts)
      end

      def supports_streaming?
        self.class.options[:streaming]
      end

      def self.register_as(*names)
        raise 'Rails is not loaded - Temple::Templates::Rails cannot be used' unless defined?(::ActionView)
        if ::ActiveSupport::VERSION::MAJOR < 3 || ::ActiveSupport::VERSION::MAJOR == 3 && ::ActiveSupport::VERSION::MINOR < 1
          raise "Temple supports only Rails 3.1 and greater, your Rails version is #{::ActiveSupport::VERSION::STRING}"
        end
        names.each do |name|
          ::ActionView::Template.register_template_handler name.to_sym, new
        end
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 4 rubygems

Version Path
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/temple-0.8.0/lib/temple/templates/rails.rb
brakeman-4.4.0 bundle/ruby/2.5.0/gems/temple-0.8.0/lib/temple/templates/rails.rb
brakeman-4.3.1 bundle/ruby/2.5.0/gems/temple-0.7.7/lib/temple/templates/rails.rb
brakeman-4.3.0 bundle/ruby/2.5.0/gems/temple-0.7.7/lib/temple/templates/rails.rb
brakeman-4.2.1 bundle/ruby/2.5.0/gems/temple-0.7.7/lib/temple/templates/rails.rb
brakeman-4.2.0 bundle/ruby/2.3.0/gems/temple-0.7.7/lib/temple/templates/rails.rb
brakeman-4.1.1 bundle/ruby/2.3.0/gems/temple-0.7.7/lib/temple/templates/rails.rb
brakeman-4.1.0 bundle/ruby/2.3.0/gems/temple-0.7.7/lib/temple/templates/rails.rb
brakeman-4.0.1 bundle/ruby/2.3.0/gems/temple-0.7.7/lib/temple/templates/rails.rb
brakeman-4.0.1.pre1 bundle/ruby/2.3.0/gems/temple-0.7.7/lib/temple/templates/rails.rb
brakeman-4.0.0 bundle/ruby/2.3.0/gems/temple-0.7.7/lib/temple/templates/rails.rb
brakeman-3.7.2 bundle/ruby/2.3.0/gems/temple-0.7.7/lib/temple/templates/rails.rb
brakeman-3.7.1 bundle/ruby/2.3.0/gems/temple-0.7.7/lib/temple/templates/rails.rb
brakeman-3.7.0 bundle/ruby/2.3.0/gems/temple-0.7.7/lib/temple/templates/rails.rb
brakeman-3.6.2 bundle/ruby/2.3.0/gems/temple-0.7.7/lib/temple/templates/rails.rb
brakeman-3.6.1 bundle/ruby/2.3.0/gems/temple-0.7.7/lib/temple/templates/rails.rb
brakeman-3.6.0 bundle/ruby/2.3.0/gems/temple-0.7.7/lib/temple/templates/rails.rb
temple-0.8.0 lib/temple/templates/rails.rb
brakeman-3.5.0 bundle/ruby/2.3.0/gems/temple-0.7.7/lib/temple/templates/rails.rb
brakeman-3.4.1 bundle/ruby/2.3.0/gems/temple-0.7.7/lib/temple/templates/rails.rb