/usr/lib/ruby/vendor_ruby/temple/templates/rails.rb is in ruby-temple 0.6.7-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | unless defined?(ActionView)
raise "Rails is not loaded - Temple::Templates::Rails cannot be used"
end
if ::ActionPack::VERSION::MAJOR < 3
raise "Temple supports only Rails 3.x and greater, your Rails version is #{::ActionPack::VERSION::STRING}"
end
module Temple
module Templates
if ::ActionPack::VERSION::MAJOR == 3 && ::ActionPack::VERSION::MINOR < 1
class Rails < ActionView::TemplateHandler
include ActionView::TemplateHandlers::Compilable
extend Mixins::Template
def compile(template)
# Overwrite option: No streaming support in Rails < 3.1
opts = {}.update(self.class.default_options).update(:file => template.identifier, :streaming => false)
self.class.compile(template.source, opts)
end
def self.register_as(*names)
names.each do |name|
ActionView::Template.register_template_handler name.to_sym, self
end
end
end
else
class Rails
extend Mixins::Template
def call(template)
opts = {}.update(self.class.default_options).update(:file => template.identifier)
self.class.compile(template.source, opts)
end
def supports_streaming?
self.class.default_options[:streaming]
end
def self.register_as(*names)
names.each do |name|
ActionView::Template.register_template_handler name.to_sym, new
end
end
end
end
end
end
|