Skip to content

Commit d2a3a49

Browse files
authored
Merge pull request #248 from rspec/avoid-picking-beta
Be able to generate doc for rspec-rails 4
2 parents 6202b76 + 6daf651 commit d2a3a49

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Rakefile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ require 'erb'
88

99
Projects = ['rspec', 'rspec-core', 'rspec-expectations', 'rspec-mocks', 'rspec-rails', 'rspec-support']
1010
UnDocumentedProjects = %w[ rspec rspec-support ]
11-
SemverUnlinkedProjects = ['rspec-rails']
1211
BaseRspecPath = Pathname.new(Dir.pwd)
1312
ReposPath = BaseRspecPath.join('repos')
1413

@@ -63,10 +62,16 @@ desc "Updates the rspec.github.io docs"
6362
task :update_docs, [:version, :branch, :website_path] do |t, args|
6463
abort "You must have ag installed to generate docs" if `which ag` == ""
6564
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}`
6873
doc_destination_path = "#{args[:website_path]}/source/documentation/#{args[:version]}/#{project}/"
69-
cmd = "bundle install && \
74+
cmd = "bundle update && \
7075
RUBYOPT='-I#{args[:website_path]}/lib' bundle exec yard \
7176
--yardopts .yardopts \
7277
--output-dir #{doc_destination_path}"

0 commit comments

Comments
 (0)