Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed incorrect path generation for sprites in Rails 4 #190

Merged
merged 1 commit into from
Dec 30, 2014

Conversation

dmeremyanin
Copy link
Contributor

Before:

if subdirectory.nil?
  bust_cache_path = generated_images_path
else
  bust_cache_path = generated_images_path + "/" + subdirectory
end

subdirectory will never be nil? there.
It will be . in case path is icons-sXXXXXXXXXX.png and bust_cache_path becomes app/assets/images/.

Moving the sprited images into a deeper subfolder works around the problem, subdirectory becomes folder_name instead of ..

Fixes #94, #162, #187, #188

@dmeremyanin
Copy link
Contributor Author

@scottdavis could you take a look please?

@dmeremyanin dmeremyanin changed the title Fixed cache busting for Rails 4 Fixed incorrect path generation for sprites in Rails 4 Dec 15, 2014
@salimane
Copy link
Contributor

+1 @scottdavis

craigmcnamara added a commit that referenced this pull request Dec 30, 2014
Fixed incorrect path generation for sprites in Rails 4
@craigmcnamara craigmcnamara merged commit ad4ad93 into Compass:master Dec 30, 2014
@braindeaf
Copy link

I'm seeing signs that the cache busting no longer works. I'm stuck in Rails 4 upgrade hell with this particular issue going on for a week now. It appears that the sprockets_entries for those keys don't get deleted, even though that's crazy because they're just two hashes.

      entry = generated_images_dir.join(dir).to_s
      sprockets_entries.delete(entry)

      stat = generated_images_dir.join(path).to_s
      sprockets_stats.delete(stat)

I'm using compass 1.0.3, compass-rails 3.0.2, Rails 4.0.13, sprockets 3.7.0, sprockets-rails 2.3.3. Any thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Only first sprite is compiled on initial asset compilation in Rails 4
4 participants