Sha256: 342fed8f295147e84eeed4e06024987aff87c946cc90c2661ff1fc572a72f863

Contents?: true

Size: 678 Bytes

Versions: 1

Compression:

Stored size: 678 Bytes

Contents

desc "Compile SLIM"
task :compile_slim do
    require 'slim'
    view_dirs = ["fields", "scaffold", "search_fields", "modals", "panels"]
    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", "")
            "c.put('#{tpl_name}', \"#{slim}\");"
        end
    end

    open("app/templates.js", "wb") << <<-EOF
angular.module('Engine2').run(['$templateCache', function(c) {
#{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.9 Rakefile