lib/susanoo/controllers/assets.rb in susanoo-0.7.0 vs lib/susanoo/controllers/assets.rb in susanoo-0.7.1
- old
+ new
@@ -1,6 +1,8 @@
require 'rack'
+require 'uglifier'
+require 'yui/compressor'
class Susanoo::Application
# This controller is responsible for serving/building assets files
class Assets < Susanoo::Controller
@@ -14,15 +16,10 @@
assets.append_path File.join(project_root,
'src/assets/javascripts')
assets.append_path File.join(project_root,
'src/assets/stylesheets')
- require 'rake/sprocketstask'
- require 'uglifier'
- require 'yui/compressor'
- require "#{project_root}/config/routes"
-
func = lambda do |path, filename|
filename !~ %r~assets~ && !%w[.js .css].include?(File.extname(path))
end
precompile = [func, /(?:\/|\\|\A)application\.(css|js)$/]
@@ -37,16 +34,16 @@
}
if File.exist? File.join(project_root,
'src/assets/images')
generator.say_status 'copy', 'src/assets/images'
- `cp #{project_root}/src/assets/images #{project_root}/www/assets/images`
+ `cp #{project_root}/src/assets/images #{project_root}/www/assets/images -r`
end
if File.exist? File.join(project_root,
'src/assets/fonts')
generator.say_status 'copy', 'src/assets/fonts'
- `cp #{project_root}/src/assets/fonts #{project_root}/www/assets/fonts`
+ `cp #{project_root}/src/assets/fonts #{project_root}/www/assets/fonts -rv`
end
end
end
end