@@ -8,7 +8,6 @@ require 'erb'
8
8
9
9
Projects = [ 'rspec' , 'rspec-core' , 'rspec-expectations' , 'rspec-mocks' , 'rspec-rails' , 'rspec-support' ]
10
10
UnDocumentedProjects = %w[ rspec rspec-support ]
11
- SemverUnlinkedProjects = [ 'rspec-rails' ]
12
11
BaseRspecPath = Pathname . new ( Dir . pwd )
13
12
ReposPath = BaseRspecPath . join ( 'repos' )
14
13
@@ -63,10 +62,16 @@ desc "Updates the rspec.github.io docs"
63
62
task :update_docs , [ :version , :branch , :website_path ] do |t , args |
64
63
abort "You must have ag installed to generate docs" if `which ag` == ""
65
64
args . with_defaults ( :website_path => "../rspec.github.io" )
66
- run_command "git fetch --tags && git checkout `git tag | grep #{ args [ :version ] } | tail -1`"
67
- each_project :except => ( UnDocumentedProjects + SemverUnlinkedProjects ) do |project |
65
+ each_project :except => ( UnDocumentedProjects ) do |project |
66
+ latest_release = `git fetch --tags && git tag | grep '^v\\ \d .\\ \d .\\ \d $' | grep v#{ args [ :version ] } | tail -1`
67
+
68
+ if latest_release . empty?
69
+ next "No release found for #{ args [ :version ] } in #{ `pwd` } "
70
+ end
71
+
72
+ `git checkout #{ latest_release } `
68
73
doc_destination_path = "#{ args [ :website_path ] } /source/documentation/#{ args [ :version ] } /#{ project } /"
69
- cmd = "bundle install && \
74
+ cmd = "bundle update && \
70
75
RUBYOPT='-I#{ args [ :website_path ] } /lib' bundle exec yard \
71
76
--yardopts .yardopts \
72
77
--output-dir #{ doc_destination_path } "
0 commit comments