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.
@@ -1,5 +1,5 @@
1
1
  module CdnSumoSprockets
2
2
  module Rails2
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -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
- manifest = Sprockets::Manifest.new(Rails.asset_pipeline , Rails.root.join("public", "assets", "manifest.json"))
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cdn_sumo_sprockets_rails2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: