Module: LiquidAssets
- Extended by:
- Config
- Defined in:
- lib/liquid_assets.rb,
lib/liquid_assets/eval.rb,
lib/liquid_assets/config.rb,
lib/liquid_assets/engine.rb,
lib/liquid_assets/filters.rb,
lib/liquid_assets/version.rb,
lib/liquid_assets/resolver.rb,
lib/liquid_assets/template.rb,
lib/liquid_assets/tiny_liquid.rb,
lib/liquid_assets/template_handler.rb,
lib/liquid_assets/liquid_file_system.rb,
lib/liquid_assets/pipeline_template_engine.rb
Defined Under Namespace
Modules: Config, Filters Classes: Engine, LiquidFileSystem, LiquidWrapper, PipelineTemplateEngine, Resolver, Template, TemplateHandler, TinyLiquid
Constant Summary collapse
- VERSION =
"0.4.4"
Instance Attribute Summary
Attributes included from Config
#content_provider, #env, #filters, #globals, #namespace, #path_prefix
Class Method Summary collapse
Methods included from Config
configure, load_yml!, root_path, template_root_path, yml, yml_exists?
Class Method Details
.parse(source) ⇒ Object
14 15 16 |
# File 'lib/liquid_assets/eval.rb', line 14 def self.parse( source ) LiquidWrapper.new( ::Liquid::Template.parse( source ) ) end |
.template(path) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/liquid_assets/eval.rb', line 18 def self.template( path ) tmpl = Config.content_provider.call( path ) if tmpl && tmpl.present? source = tmpl.source else full_path = Config.template_root_path.join( "#{path}.liquid" ) if full_path.exist? source = File.read( full_path ) else raise Liquid::FileSystemError, "No such template '#{path}' #{full_path}" end end LiquidWrapper.new( ::Liquid::Template.parse( source ) ) end |