Sha256: 79b322977b71085dab2ff2ead870d69fffcfd49b6cf0aa9e951f5ea0efa01182

Contents?: true

Size: 1.43 KB

Versions: 10

Compression:

Stored size: 1.43 KB

Contents

$:.unshift File.expand_path '../lib', __FILE__
require 'nutcracker/web'
require 'rake'
require 'rubygems/package_task'
require "rake/testtask"

desc "Compile assets"
task :compile do
  require 'logger'
  require 'pathname'
  require 'sprockets'
  require 'uglifier'
  require 'eco'

  rm_rf 'public'
  mkdir_p 'public/assets'
  build_dir = Pathname(File.dirname(__FILE__)).join("public/assets")
  
  environment = Nutcracker::Web::App.assets
  environment.logger = Logger.new STDOUT
  environment.js_compressor = Uglifier.new(mangle: true)
  
  %w( javascripts/application.js stylesheets/application.css ).each do |target|
    target = File.expand_path("../assets/#{target}",__FILE__)
    environment.logger.info "#{'#'*10} Building #{target} #{'#'*10} "
    asset = environment[target] or abort "Unknown target #{target.inspect}"
    prefix, basename = asset.pathname.to_s.split('/')[-2..-1]
    asset.write_to build_dir.join(basename)
  end
end

desc "Build new gem"
task :build => [:compile] do
  Gem::PackageTask.new(eval File.read 'nutcracker-web.gemspec') do |pkg|
    pkg.need_zip = false
    pkg.need_tar = false
  end
  Rake::Task["gem"].invoke
end

task :gem do
  abort "Please use rake build instead"
end

task :install => [:build] do
   sh "gem install pkg/nutcracker-web"
   Rake::Task['clobber_package'].execute
end

## Tests stuff
task :default => :test

Rake::TestTask.new(:test) do |t|
  t.libs << "tests"
  t.pattern = "tests/**/*_test.rb"
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
nutcracker-web-0.0.24 Rakefile
nutcracker-web-0.0.23 Rakefile
nutcracker-web-0.0.22 Rakefile
nutcracker-web-0.0.20 Rakefile
nutcracker-web-0.0.19 Rakefile
nutcracker-web-0.0.17 Rakefile
nutcracker-web-0.0.16 Rakefile
nutcracker-web-0.0.15 Rakefile
nutcracker-web-0.0.14 Rakefile
nutcracker-web-0.0.13 Rakefile