Sha256: 1651f701b5ed9a9c5d1f720442db2ec7229a4d3569dc711657cdad53230dfa76

Contents?: true

Size: 1.28 KB

Versions: 28

Compression:

Stored size: 1.28 KB

Contents

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

module Upjs
  module Assets
    MANIFESTS = %w(up.js up-bootstrap.js up.css up-bootstrap.css)
    SOURCES = %w(lib/assets/javascripts lib/assets/stylesheets)
    OUTPUT = 'dist'
  end
end

Sprockets::Standalone::RakeTask.new(:source_assets) do |task, sprockets|
  task.assets   = Upjs::Assets::MANIFESTS
  task.sources  = Upjs::Assets::SOURCES
  task.output   = Upjs::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   = Upjs::Assets::MANIFESTS
  task.sources  = Upjs::Assets::SOURCES
  task.output   = Upjs::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
    Upjs::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

28 entries across 28 versions & 1 rubygems

Version Path
upjs-rails-0.19.0 Rakefile
upjs-rails-0.18.1 Rakefile
upjs-rails-0.18.0 Rakefile
upjs-rails-0.17.0 Rakefile
upjs-rails-0.16.0 Rakefile
upjs-rails-0.15.1 Rakefile
upjs-rails-0.15.0 Rakefile
upjs-rails-0.14.1 Rakefile
upjs-rails-0.14.0 Rakefile
upjs-rails-0.13.0 Rakefile
upjs-rails-0.12.5 Rakefile
upjs-rails-0.12.4 Rakefile
upjs-rails-0.12.3 Rakefile
upjs-rails-0.12.2 Rakefile
upjs-rails-0.12.1 Rakefile
upjs-rails-0.12.0 Rakefile
upjs-rails-0.11.1 Rakefile
upjs-rails-0.11.0 Rakefile
upjs-rails-0.10.5 Rakefile
upjs-rails-0.10.4 Rakefile