Sha256: 7997bf3ed093ec4a1d2ffb9ccf77cf2cc2744560da718d78a37d6a36b06ef855

Contents?: true

Size: 751 Bytes

Versions: 3

Compression:

Stored size: 751 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}', { preserve: true })
    Find.find('#{Rails.root}/#{args.sass_path}') 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

3 entries across 3 versions & 1 rubygems

Version Path
minable-0.1.3 lib/tasks/install.rake
minable-0.1.2 lib/tasks/install.rake
minable-0.1.1 lib/tasks/install.rake