Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Added support for new manifest format used by turbo-sprockets-rails3, and possibly Rails #110

Closed
wants to merge 1 commit into from

3 participants

@ndbroadbent

Hi there,

I've recently developed a gem that speeds up the asset compilation task, called turbo-sprockets-rails3.
In order for it to do its magic, it needs to alter the manifest.yml format to include both :source_digests and :digest_files, instead of a flat digest files hash.

This pull request simply looks for the presence of the :digest_files key in manifest.yml, and falls back to the old format it it's not found, so it should be 100% backwards compatible.

Note that I'm also trying to get the patch merged into Rails 4.0.0, and possibly Rails 3.2.9 (see rails/sprockets-rails#21). Even if it's not merged into Rails for some reason, I would really appreciate it if you could support the users of the turbo-sprockets-rails3 gem.

Thanks for your time!

@ndbroadbent ndbroadbent referenced this pull request in ndbroadbent/turbo-sprockets-rails3
Closed

Compatibility with asset_sync gem #4

@ndbroadbent

(you might want to add jruby-head to your list of 'Allowed Failures' on Travis)

@rgarver

:+1: Would love to see this pulled in. Lots of small JS files is slowing my deploys and cukes and this is the last piece to making the new turbo-sprockets system play nice with my dependencies.

@davidjrice
Owner

Hey, so I've started pulling this in and testing it.

Started branch in rumblelabs/asset_sync#turbosprockets

Just had a first successful deployment of one app. Will run a few more tests and get this out this week :)

@ndbroadbent

Hi there, I got some good advice from Jeremy Kemper, which was to keep the manifest.yml file the same, and add a new sources_manifest.yml file for source digests. I've done that now, so this pull request is no longer needed (manifest.yml is now unchanged.)

I've released this change in version 0.2.0. Sorry about the noise!

@davidjrice
Owner

@ndbroadbent cool, no worries.

I've opened another issue then, #118 to discuss some documentation improvements regarding turbosprockets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/asset_sync/storage.rb
View
6 lib/asset_sync/storage.rb
@@ -60,9 +60,11 @@ def always_upload_files
def get_local_files
if self.config.manifest
if File.exists?(self.config.manifest_path)
- yml = YAML.load(IO.read(self.config.manifest_path))
+ yml = YAML.load_file(self.config.manifest_path)
log "Using: Manifest #{self.config.manifest_path}"
- return yml.values.map { |f| File.join(self.config.assets_prefix, f) }
+ # Support for new manifest format used by turbo-sprockets-rails3
+ files = yml[:digest_files] ? yml[:digest_files] : yml
+ return files.values.map { |f| File.join(self.config.assets_prefix, f) }
else
log "Warning: manifest.yml not found at #{self.config.manifest_path}"
end
Something went wrong with that request. Please try again.