Skip to content
This repository

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

Nathan Broadbent Ryan Garver David Rice
Nathan Broadbent

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!

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

Compatibility with asset_sync gem #4

Nathan Broadbent

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

Ryan Garver

:+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.

David Rice
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 :)

Nathan Broadbent

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!

David Rice
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 1 changed file with 4 additions and 2 deletions. Show diff stats Hide diff stats

  1. +4 2 lib/asset_sync/storage.rb
6 lib/asset_sync/storage.rb
@@ -60,9 +60,11 @@ def always_upload_files
60 60 def get_local_files
61 61 if self.config.manifest
62 62 if File.exists?(self.config.manifest_path)
63   - yml = YAML.load(IO.read(self.config.manifest_path))
  63 + yml = YAML.load_file(self.config.manifest_path)
64 64 log "Using: Manifest #{self.config.manifest_path}"
65   - return yml.values.map { |f| File.join(self.config.assets_prefix, f) }
  65 + # Support for new manifest format used by turbo-sprockets-rails3
  66 + files = yml[:digest_files] ? yml[:digest_files] : yml
  67 + return files.values.map { |f| File.join(self.config.assets_prefix, f) }
66 68 else
67 69 log "Warning: manifest.yml not found at #{self.config.manifest_path}"
68 70 end

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.