Sha256: 67cb25222b72552c801371832b99cddff611e6341470b0d16370a980f100addd
Contents?: true
Size: 701 Bytes
Versions: 1
Compression:
Stored size: 701 Bytes
Contents
desc "Compile SLIM" task :compile_slim do require 'slim' view_dirs = ["fields", "scaffold", "search_fields", "modals"] slims = view_dirs.each.map do |view_dir| Dir["views/#{view_dir}/*.slim"].map do |slim_file| slim = Slim::Template.new(slim_file).render.gsub('"', '\"') tpl_name = slim_file.sub("views/", "").sub(".slim", "") "$templateCache.put('#{tpl_name}', \"#{slim}\");" end end open("app/engine2templates.js", "wb") << <<-EOF angular.module('Engine2').run(['$templateCache', function($templateCache) { #{slims.join("\n")} }]); EOF end desc "Compile" task :compile => [:compile_slim] do end task :default => [:compile]
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
engine2-1.0.4 | Rakefile |