Sha256: 564408dab39309c352be3cf39856f5b571fc8bc2f2e973263401baccf7885ee9

Contents?: true

Size: 876 Bytes

Versions: 13

Compression:

Stored size: 876 Bytes

Contents

require "bundler/setup"

Bundler.require

desc "Compile assets into statics folder"
task :assets1 do
  require 'sprockets'
  #require "rake/sprocketstask"

  assets = Sprockets::Environment.new
  assets.append_path "src/assets/javascripts"
  assets.append_path "src/assets/stylesheets"

  #Susanoo::Assets.path = ""
  LOOSE_APP_ASSETS = lambda do |path, filename|
    filename !~ %r~assets~  && !%w[.js .css].include?(File.extname(path))
  end
  precompile = [LOOSE_APP_ASSETS, /(?:\/|\\|\A)application\.(css|js)$/]
  assets.each_logical_path(*precompile).each {|path|
    dir = ''
    case File.extname(path)
    when '.js'
      dir = 'javascripts'
    when '.css'
      dir = 'stylesheets'
    end
    assets[path].write_to "www/assets/#{dir}/#{path}"
  }

  #system  "cp www/assets/images www/statics/images -rv"
  #system  "cp www/assets/fonts www/statics/fonts -rv"
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
susanoo-0.14.0 lib/susanoo/tasks/assets.rake
susanoo-0.13.2 lib/susanoo/tasks/assets.rake
susanoo-0.13.1 lib/susanoo/tasks/assets.rake
susanoo-0.13.0 lib/susanoo/tasks/assets.rake
susanoo-0.12.3 lib/susanoo/tasks/assets.rake
susanoo-0.12.2 lib/susanoo/tasks/assets.rake
susanoo-0.12.1 lib/susanoo/tasks/assets.rake
susanoo-0.12.0 lib/susanoo/tasks/assets.rake
susanoo-0.11.1 lib/susanoo/tasks/assets.rake
susanoo-0.10.0 lib/susanoo/tasks/assets.rake
susanoo-0.8.0 lib/susanoo/tasks/assets.rake
susanoo-0.7.4 lib/susanoo/tasks/assets.rake
susanoo-0.7.2 lib/susanoo/tasks/assets.rake