Sha256: 99b513c8d82229330b3744a950ed4016258dc60f3db3e0653e6550704392ee66

Contents?: true

Size: 1021 Bytes

Versions: 2

Compression:

Stored size: 1021 Bytes

Contents

require 'fileutils'

def copy_files(source_path, destination_path, directory)
  source, destination = File.join(directory, source_path), File.join(Rails.root, destination_path)
  FileUtils.mkdir_p(destination, :verbose => true) unless File.exist?(destination)
  FileUtils.cp_r(source, destination, :verbose => true)
end

directory = File.dirname(__FILE__)

namespace :flutie do
  desc 'install flutie stylesheets into public/ directory'
  task :install => :environment do
    if Rails.application.config.respond_to?(:assets) && Rails.application.config.assets.enabled
      # No copy is needed when asset pipelining is enabled
      puts "Flutie stylesheets are provided via asset pipelining."
    else
      # Copy the flutie stylesheets into rails_root/public/flutie
      copy_files("../../public/stylesheets", "/public/flutie", directory)

      # Copy the flutie sass stylesheets into rails_root/public/sass/flutie
      copy_files("../../app/assets/stylesheets", "/public/sass/flutie", directory)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
flutie-1.3.1 lib/tasks/flutie.rake
flutie-1.3.0 lib/tasks/flutie.rake