Class: Tasks::Gitlab::AuditEventTypes::CompileDocsTask
- Inherits:
-
Object
- Object
- Tasks::Gitlab::AuditEventTypes::CompileDocsTask
- Defined in:
- lib/tasks/gitlab/audit_event_types/compile_docs_task.rb
Instance Method Summary collapse
-
#initialize(docs_dir, docs_path, template_erb_path) ⇒ CompileDocsTask
constructor
A new instance of CompileDocsTask.
- #run ⇒ Object
Constructor Details
#initialize(docs_dir, docs_path, template_erb_path) ⇒ CompileDocsTask
Returns a new instance of CompileDocsTask.
7 8 9 10 11 |
# File 'lib/tasks/gitlab/audit_event_types/compile_docs_task.rb', line 7 def initialize(docs_dir, docs_path, template_erb_path) @event_types_dir = docs_dir @audit_event_types_doc_file = docs_path @event_type_erb_template = ERB.new(File.read(template_erb_path), trim_mode: '<>') end |
Instance Method Details
#run ⇒ Object
13 14 15 16 17 18 |
# File 'lib/tasks/gitlab/audit_event_types/compile_docs_task.rb', line 13 def run FileUtils.mkdir_p(@event_types_dir) File.write(@audit_event_types_doc_file, @event_type_erb_template.result) puts "Documentation compiled." end |