install.rake 773 B

1234567891011121314151617181920
  1. # Needed for pre-3.1.
  2. require "fileutils"
  3. require "find"
  4. namespace :bourbon do
  5. desc "Move files to the Rails assets directory."
  6. task :install, [:sass_path] do |t, args|
  7. args.with_defaults(:sass_path => 'public/stylesheets/sass')
  8. source_root = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
  9. FileUtils.mkdir_p("#{Rails.root}/#{args.sass_path}/bourbon")
  10. FileUtils.cp_r("#{source_root}/app/assets/stylesheets/.", "#{Rails.root}/#{args.sass_path}/bourbon", { :preserve => true })
  11. Find.find("#{Rails.root}/#{args.sass_path}/bourbon") do |path|
  12. if path.end_with?(".css.scss")
  13. path_without_css_extension = path.gsub(/\.css\.scss$/, ".scss")
  14. FileUtils.mv(path, path_without_css_extension)
  15. end
  16. end
  17. end
  18. end