Skip to content

Commit 8a2d406

Browse files
authored
Merge pull request #2 from rubyatscale/optimize-files_with_relative_path
2 parents e0de0cf + 1c9edf4 commit 8a2d406

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

lib/code_manifest/manifest.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,13 @@ def exclusion_rules
5656
end
5757

5858
def files_with_relative_path(files)
59-
files.map do |file|
60-
pathname = Pathname.new(file)
61-
next if pathname.directory?
59+
prefix = File.join(CodeManifest.root, "/")
6260

63-
pathname.relative_path_from(CodeManifest.root).to_s
64-
end.compact
61+
files.filter_map do |file|
62+
next if File.directory?(file)
63+
64+
file.delete_prefix(prefix)
65+
end
6566
end
6667
end
6768
end

0 commit comments

Comments
 (0)