Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-08-31 21:10:24 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-31 21:10:24 +0300
commit34d6e7c91beed4420759ce5a8e1e9607db8f9c45 (patch)
tree409b751ac0ce132ab89b80c4ab6c559a87af0c2f /tooling
parentd7918f34666a538be467cb9db04630960e3659d3 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'tooling')
-rw-r--r--tooling/deprecations/docs/renderer.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/tooling/deprecations/docs/renderer.rb b/tooling/deprecations/docs/renderer.rb
new file mode 100644
index 00000000000..832c4ce99d1
--- /dev/null
+++ b/tooling/deprecations/docs/renderer.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+require 'erb'
+
+module Deprecations
+ module Docs
+ module Renderer
+ module_function
+
+ def render(**variables)
+ template = File.expand_path("data/deprecations/templates/_deprecation_template.md.erb", "#{__dir__}/../../..")
+
+ load_template(template).result_with_hash(variables)
+ end
+
+ def load_template(filename)
+ ERB.new(File.read(filename), trim_mode: '-')
+ end
+ end
+ end
+end