diff --git a/CHANGELOG.md b/CHANGELOG.md index 6366a4d92..9fe537843 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ **Master** +- Preserve caller paths when inserting a pipeline. [Oskar Eichler](https://github.com/OskarEichler) + Get upgrade notes from Sprockets 3.x to 4.x at https://github.com/rails/sprockets/blob/master/UPGRADING.md # 4.4.1 diff --git a/README.md b/README.md index 958b44cd4..d3ec0e2ee 100644 --- a/README.md +++ b/README.md @@ -714,3 +714,5 @@ Please see the [CHANGELOG](https://github.com/rails/sprockets/tree/master/CHANGE ## License Sprockets is released under the [MIT License](MIT-LICENSE). + +Inserting a pipeline leaves the caller path unchanged and accepts frozen paths. diff --git a/lib/sprockets/path_utils.rb b/lib/sprockets/path_utils.rb index 9248e39a3..8befcc0be 100644 --- a/lib/sprockets/path_utils.rb +++ b/lib/sprockets/path_utils.rb @@ -147,7 +147,7 @@ def join(base, path) # Returns string path with pipeline parsed in def set_pipeline(path, mime_exts, pipeline_exts, pipeline) extension, _ = match_path_extname(path, mime_exts) - path.chomp!(extension) + path = path.chomp(extension) pipeline_old, _ = match_path_extname(path, pipeline_exts) path.chomp!(pipeline_old)