Sha256: dd5516876d0b068cceeb2dc2c6ca20e3545f52dc19efe5383ae7036bdc4e66dc

Contents?: true

Size: 773 Bytes

Versions: 2

Compression:

Stored size: 773 Bytes

Contents

# Needed for pre-3.1.

require "fileutils"
require "find"

namespace :minable do
  desc "Move files to the Rails assets directory."
  task :install, [:sass_path] do |t, args|
    args.with_defaults(:sass_path => 'public/stylesheets/sass')
    source_root = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
    FileUtils.mkdir_p("#{Rails.root}/#{args.sass_path}/minable")
    FileUtils.cp_r("#{source_root}/app/assets/stylesheets/.", "#{Rails.root}/#{args.sass_path}/minable", { :preserve => true })
    Find.find("#{Rails.root}/#{args.sass_path}/minable") do |path|
      if path.end_with?(".css.scss")
        path_without_css_extension = path.gsub(/\.css\.scss$/, ".scss")
        FileUtils.mv(path, path_without_css_extension)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
minable-0.0.2 lib/tasks/install.rake
minable-0.0.1 lib/tasks/install.rake