Sha256: 6aaf32b01be4f447c1cf1e7343d4c385af1bcdf10cdf72341afe27ac471421ed

Contents?: true

Size: 694 Bytes

Versions: 4

Compression:

Stored size: 694 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/templates.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

4 entries across 4 versions & 1 rubygems

Version Path
engine2-1.0.8 Rakefile
engine2-1.0.7 Rakefile
engine2-1.0.6 Rakefile
engine2-1.0.5 Rakefile