@@ -26,7 +26,7 @@ def run_command(command, opts={})
26
26
FileUtils . cd ( path ) do
27
27
puts "#{ '=' *3 } #{ dir } #{ '=' *( 40 - dir . length ) } "
28
28
begin
29
- Bundler . clean_system ( command )
29
+ Bundler . unbundled_system ( command )
30
30
rescue Exception => e
31
31
puts e . backtrace
32
32
end
@@ -65,22 +65,23 @@ task :update_docs, [:version, :branch, :website_path] do |t, args|
65
65
args . with_defaults ( :website_path => "../rspec.github.io" )
66
66
run_command "git checkout #{ args [ :branch ] } && git pull --rebase"
67
67
each_project :except => ( UnDocumentedProjects + SemverUnlinkedProjects ) do |project |
68
+ doc_destination_path = "#{ args [ :website_path ] } /source/documentation/#{ args [ :version ] } /#{ project } /"
68
69
cmd = "bundle install && \
69
70
RUBYOPT='-I#{ args [ :website_path ] } /lib' bundle exec yard \
70
71
--yardopts .yardopts \
71
- --plugin rspec-docs-template \
72
- --output-dir #{ args [ :website_path ] } /source/documentation/#{ args [ :version ] } /#{ project } /"
72
+ --output-dir #{ doc_destination_path } "
73
73
puts cmd
74
- Bundler . clean_system ( cmd )
74
+ Bundler . unbundled_system ( cmd )
75
75
in_place =
76
76
if RUBY_PLATFORM =~ /darwin/ # if this is os x then we must modify sed
77
77
"-i ''"
78
78
else
79
79
"-i''"
80
80
end
81
81
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 {}}
84
85
end
85
86
end
86
87
0 commit comments