Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Commit

Permalink
Add :also_unhashed option for Assets.
Browse files Browse the repository at this point in the history
  • Loading branch information
razor-x committed Aug 10, 2014
1 parent c243930 commit 9147483
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/palimpsest/assets.rb
Expand Up @@ -16,7 +16,7 @@ module Palimpsest
# [% javascript inline tracking %] -> <compiled source of tracking.js asset>
#
# Disable some cops until they can be refactored in the rubocop branch.
# rubocop:disable Style/ClassLength, Style/MethodLength
# rubocop:disable Style/ClassLength, Style/MethodLength, Style/CyclomaticComplexity
class Assets
# Default {#options}.
DEFAULT_OPTIONS = {
Expand Down Expand Up @@ -47,6 +47,8 @@ class Assets
gzip: false,

# Include hash in asset name.
# Can be set to `:also_unhashed` to include a hash,
# but additionally write an unhased file.
hash: true,

# Opening and closing brackets for asset source tags.
Expand Down Expand Up @@ -137,6 +139,8 @@ def write(target, gzip: options[:gzip], hash: options[:hash])
path = name
path = File.join(directory, path) unless directory.nil?

write(target, gzip: gzip, hash: false) if hash == :also_unhashed

asset.write_to "#{path}.gz", compress: true if gzip
asset.write_to path
name
Expand Down

0 comments on commit 9147483

Please sign in to comment.