Sha256: d35ea916d5ff6bdcc003c7ef68fa5c10d83ccd5309edb7eb95c13a83a7f19634

Contents?: true

Size: 612 Bytes

Versions: 3

Compression:

Stored size: 612 Bytes

Contents

unless defined?(APP_FILE) && defined?(APP_CLASS)
  $stderr.write "Error: Please set APP_FILE and APP_CLASS before setting up AssetPack rake tasks.\n"
  $stderr.write "Example:\n"
  $stderr.write "    APP_FILE  = 'init.rb'\n"
  $stderr.write "    APP_CLASS = 'Application'\n"
  $stderr.write "    require 'sinatra/assetpack/rake'\n"
  $stderr.write "\n"
  exit
end

def app
  require File.expand_path(APP_FILE, Dir.pwd)
  Object.const_get(APP_CLASS.to_sym)
end

namespace :assetpack do
  desc "Build assets"
  task :build do
    app.assets.build! { |file|
      puts "+ #{file.gsub(Dir.pwd, '')}"
    }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sinatra-assetpack-0.0.8 lib/sinatra/assetpack/rake.rb
sinatra-assetpack-0.0.6 lib/sinatra/assetpack/rake.rb
sinatra-assetpack-0.0.5 lib/sinatra/assetpack/rake.rb