Skip to content

assets:clean task is not cleaning predigested assets with .digest in the name #140

@tsrivishnu

Description

@tsrivishnu

Whenever rake assets:clean is run, the assets in public/assets with .digest in their name are not cleaned at all. This causes assets to accumulate on production and drastic increase in disk usage over time.

I realised that this is because of the following:

def extract_path_and_digest(digested_path)
digest = digested_path.to_s[/-([0-9a-f]{7,128})\.(?!digested)[^.]+\z/, 1]
path = digest ? digested_path.sub("-#{digest}", "") : digested_path
[path, digest]
end

The regex ignores all files that have a . digest in them.

Is this on purpose? or is this a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions