Skip to content

Remove rspec-doc-template yard plugin + remove empty lines from HTML doc #245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def run_command(command, opts={})
FileUtils.cd(path) do
puts "#{'='*3} #{dir} #{'='*(40 - dir.length)}"
begin
Bundler.clean_system(command)
Bundler.unbundled_system(command)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm theres a reason we were using clean_system but I've forgotten what it is

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my case, I just followed the deprecation warning.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah then I think its a bundler 1 vs 2 issue

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a blocker for this PR?

On another project we added an helper method that check if unbundled_system was defined, if not, fallback to clean_system. But I think we can keep it like this.

I didn't try all the rake commands and I lack history on the subject so feel free to tell me Jon.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it's our dev tools, we can always revert.

rescue Exception => e
puts e.backtrace
end
Expand Down Expand Up @@ -65,22 +65,23 @@ task :update_docs, [:version, :branch, :website_path] do |t, args|
args.with_defaults(:website_path => "../rspec.github.io")
run_command "git checkout #{args[:branch]} && git pull --rebase"
each_project :except => (UnDocumentedProjects + SemverUnlinkedProjects) do |project|
doc_destination_path = "#{args[:website_path]}/source/documentation/#{args[:version]}/#{project}/"
cmd = "bundle install && \
RUBYOPT='-I#{args[:website_path]}/lib' bundle exec yard \
--yardopts .yardopts \
--plugin rspec-docs-template \
--output-dir #{args[:website_path]}/source/documentation/#{args[:version]}/#{project}/"
--output-dir #{doc_destination_path}"
puts cmd
Bundler.clean_system(cmd)
Bundler.unbundled_system(cmd)
in_place =
if RUBY_PLATFORM =~ /darwin/ # if this is os x then we must modify sed
"-i ''"
else
"-i''"
end

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}
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}
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/' {}}
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/' {}}
Bundler.unbundled_system %Q{ag --html -l . #{doc_destination_path} | xargs -I{} sed #{in_place} /^[[:space:]]*$/d {}}
end
end

Expand Down