Skip to content

Commit f5cc861

Browse files
committed
Copy files by hand to avoid copying .svn dirs
1 parent 820bc93 commit f5cc861

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

lib/rdoc/generator/darkfish.rb

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,27 @@ def gen_sub_directories
147147
@outputdir.mkpath
148148
end
149149

150-
### Copy over the stylesheet into the appropriate place in the
151-
### output directory.
150+
### Copy over the stylesheet into the appropriate place in the output
151+
### directory.
152152
def write_style_sheet
153-
debug_msg "Copying over static files"
154-
staticfiles = %w[rdoc.css js images]
155-
staticfiles.each do |path|
156-
FileUtils.cp_r( @template_dir + path, '.', :verbose => $DEBUG, :noop => $dryrun )
157-
end
158-
end
153+
debug_msg "Copying static files"
154+
options = { :verbose => $DEBUG_RDOC, :noop => $dryrun }
155+
156+
FileUtils.cp @template_dir + 'rdoc.css', '.', options
157+
158+
Dir[@template_dir + "{js,images}/**/*"].each do |path|
159+
next if File.directory? path
160+
next if path =~ /#{File::SEPARATOR}\./
159161

162+
dst = Pathname.new(path).relative_path_from @template_dir
160163

164+
# I suck at glob
165+
dst_dir = dst.dirname
166+
FileUtils.mkdir_p dst_dir, options unless File.exist? dst_dir
167+
168+
FileUtils.cp @template_dir + path, dst, options
169+
end
170+
end
161171

162172
### Build the initial indices and output objects
163173
### based on an array of TopLevel objects containing

0 commit comments

Comments
 (0)