debian-mirror-gitlab/lib/tasks/gitlab/docs/compile_deprecations.rake

53 lines
1.9 KiB
Ruby
Raw Normal View History

2021-11-11 11:23:49 +05:30
# frozen_string_literal: true
namespace :gitlab do
namespace :docs do
desc "Generate deprecation list from individual files"
task :compile_deprecations do
2022-03-02 08:16:31 +05:30
require_relative '../../../../tooling/docs/deprecation_handling'
path = Rails.root.join("doc/update/deprecations.md")
File.write(path, Docs::DeprecationHandling.new('deprecation').render)
puts "Deprecations compiled to #{path}"
2021-11-11 11:23:49 +05:30
end
desc "Check that the deprecation doc is up to date"
task :check_deprecations do
2022-03-02 08:16:31 +05:30
require_relative '../../../../tooling/docs/deprecation_handling'
path = Rails.root.join("doc/update/deprecations.md")
2021-11-11 11:23:49 +05:30
2022-03-02 08:16:31 +05:30
contents = Docs::DeprecationHandling.new('deprecation').render
doc = File.read(path)
2021-11-11 11:23:49 +05:30
if doc == contents
puts "Deprecations doc is up to date."
else
2021-12-11 22:18:48 +05:30
format_output('Deprecations doc is outdated! You (or your technical writer) can update it by running `bin/rake gitlab:docs:compile_deprecations`.')
2021-11-11 11:23:49 +05:30
abort
end
end
2022-03-02 08:16:31 +05:30
desc "Generate removal list from individual files"
task :compile_removals do
require_relative '../../../../tooling/docs/deprecation_handling'
path = Rails.root.join("doc/update/removals.md")
File.write(path, Docs::DeprecationHandling.new('removal').render)
puts "Removals compiled to #{path}"
end
desc "Check that the removal doc is up to date"
task :check_removals do
require_relative '../../../../tooling/docs/deprecation_handling'
path = Rails.root.join("doc/update/removals.md")
contents = Docs::DeprecationHandling.new('removal').render
doc = File.read(path)
if doc == contents
puts "Removals doc is up to date."
else
format_output('Removals doc is outdated! You (or your technical writer) can update it by running `bin/rake gitlab:docs:compile_removals`.')
abort
end
end
2021-11-11 11:23:49 +05:30
end
end