From 914ba22acedb8d73463ab498bad75209ef9cbe0d Mon Sep 17 00:00:00 2001 From: Rene Saarsoo Date: Fri, 14 Oct 2011 15:26:19 +0300 Subject: [PATCH] Remove full source paths from JsonP output files. --- lib/jsduck/exporter.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/jsduck/exporter.rb b/lib/jsduck/exporter.rb index 2e1954cc..28b12a40 100644 --- a/lib/jsduck/exporter.rb +++ b/lib/jsduck/exporter.rb @@ -29,6 +29,7 @@ module JsDuck cls.delete(:doc) cls[:members] = compact_members_group(cls[:members]) cls[:statics] = compact_members_group(cls[:statics]) + cls[:files] = compact_files(cls[:files]) cls end @@ -47,6 +48,16 @@ module JsDuck end m_copy end + + # Remove full path from filename for privacy considerations as the + # path can reveal information about the system where JSDuck was + # run. The docs app doesn't need to have this information. + def compact_files(files) + files.map do |f| + {:filename => File.basename(f[:filename]), :href => f[:href]} + end + end + end end -- GitLab