cdn_sumo_sprockets_rails2 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -39,9 +39,19 @@ namespace :assets do
|
|
39
39
|
# Ensure that action view is loaded and the appropriate
|
40
40
|
# sprockets hooks get executed
|
41
41
|
_ = ActionView::Base
|
42
|
-
|
43
|
-
|
42
|
+
base_dir = Rails.root.join("public", "assets")
|
43
|
+
manifest_file = base_dir.join("manifest.json")
|
44
|
+
sprockets = Rails.asset_pipeline
|
45
|
+
manifest = Sprockets::Manifest.new(sprockets, manifest_file)
|
44
46
|
manifest.compile
|
47
|
+
|
48
|
+
manifest.files.each do |digest_file, details|
|
49
|
+
# digest_file: "ronin-422cb196418b3a97077b03d3e1744beb.gif"
|
50
|
+
# details: {"digest"=>"422cb196418b3a97077b03d3e1744beb", "mtime"=>"2013-02-02T13:29:30-06:00", "size"=>27840, "logical_path"=>"ronin.gif"}
|
51
|
+
digest_path = File.join(base_dir, digest_file)
|
52
|
+
non_digest_path = File.join(base_dir, details["logical_path"])
|
53
|
+
FileUtils.cp(digest_path, non_digest_path)
|
54
|
+
end
|
45
55
|
end
|
46
56
|
|
47
57
|
task :all do
|