Class: Paperwork::Tasks::Document
- Includes:
- Rake::DSL
- Defined in:
- lib/paperwork/tasks/document.rb
Overview
main task generator for building the document
Instance Attribute Summary collapse
-
#dir ⇒ Object
readonly
rubocop:disable Metrics/ClassLength.
-
#sources_map ⇒ Object
readonly
rubocop:disable Metrics/ClassLength.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(name, sources, *dependencies) ⇒ Document
constructor
A new instance of Document.
- #tasks ⇒ Object
Methods inherited from Base
#create_tasks, explain, #register, #registered?, #registered_tasks
Constructor Details
#initialize(name, sources, *dependencies) ⇒ Document
Returns a new instance of Document.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/paperwork/tasks/document.rb', line 18 def initialize(name, sources, *dependencies) @dir = Paperwork::Tasks::Template.new(name).dir @sources_map = {} sources.each do |src| dst = get_destination(File.join(self.dir, "source"), src) BuildFile.new(dst, src) sources_map[src] = dst dependencies << dst end dependencies << RootHelpers.new(@dir, sources.first).name super(name, *dependencies) end |
Instance Attribute Details
#dir ⇒ Object (readonly)
rubocop:disable Metrics/ClassLength
14 15 16 |
# File 'lib/paperwork/tasks/document.rb', line 14 def dir @dir end |
#sources_map ⇒ Object (readonly)
rubocop:disable Metrics/ClassLength
14 15 16 |
# File 'lib/paperwork/tasks/document.rb', line 14 def sources_map @sources_map end |
Instance Method Details
#tasks ⇒ Object
33 34 35 36 |
# File 'lib/paperwork/tasks/document.rb', line 33 def tasks tasks_build tasks_nested end |