Sha256: 0e743ac1c9077a69ecf11fa79df54f0d39718b3cd94bbd1edcdf1b171c04ddc6

Contents?: true

Size: 1.32 KB

Versions: 23

Compression:

Stored size: 1.32 KB

Contents

require "bundler/gem_tasks"
require 'sass/util'
require 'sass/script'
require 'sprockets/standalone'

module Unpoly
  module Assets
    MANIFESTS = %w(unpoly.js unpoly-bootstrap3.js unpoly.css unpoly-bootstrap3.css)
    SOURCES = %w(lib/assets/javascripts lib/assets/stylesheets)
    OUTPUT = 'dist'
  end
end

Sprockets::Standalone::RakeTask.new(:source_assets) do |task, sprockets|
  task.assets   = Unpoly::Assets::MANIFESTS
  task.sources  = Unpoly::Assets::SOURCES
  task.output   = Unpoly::Assets::OUTPUT
  task.compress = false
  task.digest   = false
  sprockets.js_compressor  = nil
  sprockets.css_compressor = nil
end

Sprockets::Standalone::RakeTask.new(:minified_assets) do |task, sprockets|
  task.assets   = Unpoly::Assets::MANIFESTS
  task.sources  = Unpoly::Assets::SOURCES
  task.output   = Unpoly::Assets::OUTPUT
  task.compress = false
  task.digest   = false
  sprockets.js_compressor  = :uglifier
  sprockets.css_compressor = :sass
end

namespace :assets do
  desc 'Compile assets for Bower and manual download'
  task :compile do
    Rake::Task['minified_assets:compile'].invoke
    Unpoly::Assets::MANIFESTS.each do |manifest|
      source = "dist/#{manifest}"
      target = "dist/#{manifest.sub(/\.([^\.]+)$/, '.min.\\1')}"
      File.rename(source, target)
    end
    Rake::Task['source_assets:compile'].invoke
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
unpoly-rails-0.31.0 Rakefile
unpoly-rails-0.30.1 Rakefile
unpoly-rails-0.30.0 Rakefile
unpoly-rails-0.29.0 Rakefile
unpoly-rails-0.28.1 Rakefile
unpoly-rails-0.28.0 Rakefile
unpoly-rails-0.27.3 Rakefile
unpoly-rails-0.27.2 Rakefile
unpoly-rails-0.27.1 Rakefile
unpoly-rails-0.27.0 Rakefile
unpoly-rails-0.26.2 Rakefile
unpoly-rails-0.26.1 Rakefile
unpoly-rails-0.26.0 Rakefile
unpoly-rails-0.25.2 Rakefile
unpoly-rails-0.25.1 Rakefile
unpoly-rails-0.25.0 Rakefile
unpoly-rails-0.24.1 Rakefile
unpoly-rails-0.24.0 Rakefile
unpoly-rails-0.23.0 Rakefile
unpoly-rails-0.22.1 Rakefile