@@ -26,7 +26,7 @@ def run_command(command, opts={})
2626 FileUtils . cd ( path ) do
2727 puts "#{ '=' *3 } #{ dir } #{ '=' *( 40 - dir . length ) } "
2828 begin
29- Bundler . clean_system ( command )
29+ Bundler . unbundled_system ( command )
3030 rescue Exception => e
3131 puts e . backtrace
3232 end
@@ -65,22 +65,23 @@ task :update_docs, [:version, :branch, :website_path] do |t, args|
6565 args . with_defaults ( :website_path => "../rspec.github.io" )
6666 run_command "git checkout #{ args [ :branch ] } && git pull --rebase"
6767 each_project :except => ( UnDocumentedProjects + SemverUnlinkedProjects ) do |project |
68+ doc_destination_path = "#{ args [ :website_path ] } /source/documentation/#{ args [ :version ] } /#{ project } /"
6869 cmd = "bundle install && \
6970 RUBYOPT='-I#{ args [ :website_path ] } /lib' bundle exec yard \
7071 --yardopts .yardopts \
71- --plugin rspec-docs-template \
72- --output-dir #{ args [ :website_path ] } /source/documentation/#{ args [ :version ] } /#{ project } /"
72+ --output-dir #{ doc_destination_path } "
7373 puts cmd
74- Bundler . clean_system ( cmd )
74+ Bundler . unbundled_system ( cmd )
7575 in_place =
7676 if RUBY_PLATFORM =~ /darwin/ # if this is os x then we must modify sed
7777 "-i ''"
7878 else
7979 "-i''"
8080 end
8181
82- Bundler . clean_system %Q{pushd #{ args [ :website_path ] } ; ag -l src=\\ "\\ \( ?:..\/ \\ \) *js | xargs -I{} sed #{ in_place } 's/src="\\ \( ..\\ \/ \\ \) *js/src="\\ \/ documentation\\ \/ #{ args [ :version ] } \\ \/ #{ project } \\ \/ js/' {}; popd}
83- Bundler . clean_system %Q{pushd #{ args [ :website_path ] } ; ag -l href=\\ "\\ \( ?:..\/ \\ \) *css | xargs -I{} sed #{ in_place } 's/href="\\ \( ..\\ \/ \\ \) *css/href="\\ \/ documentation\\ \/ #{ args [ :version ] } \\ \/ #{ project } \\ \/ css/' {}; popd}
82+ Bundler . unbundled_system %Q{ag -l src=\\ "\\ \( ?:..\/ \\ \) *js #{ doc_destination_path } | xargs -I{} sed #{ in_place } 's/src="\\ \( ..\\ \/ \\ \) *js/src="\\ \/ documentation\\ \/ #{ args [ :version ] } \\ \/ #{ project } \\ \/ js/' {}}
83+ Bundler . unbundled_system %Q{ag -l href=\\ "\\ \( ?:..\/ \\ \) *css #{ doc_destination_path } | xargs -I{} sed #{ in_place } 's/href="\\ \( ..\\ \/ \\ \) *css/href="\\ \/ documentation\\ \/ #{ args [ :version ] } \\ \/ #{ project } \\ \/ css/' {}}
84+ Bundler . unbundled_system %Q{ag --html -l . #{ doc_destination_path } | xargs -I{} sed #{ in_place } /^[[:space:]]*$/d {}}
8485 end
8586end
8687
0 commit comments