class SdocAll::MergeTask
Attributes
doc_path[R]
tasks[R]
title[R]
titles[R]
Public Class Methods
new(options = {})
click to toggle source
# File lib/sdoc_all/task.rb, line 118 def initialize(options = {}) @doc_path = options[:doc_path] @title = options[:title] @tasks = options[:tasks_options].map do |task_options| Task.new(task_options.merge( :doc_path => "#{parts_path}/#{task_options[:doc_path]}", :title => "#{title}: #{task_options[:title]}" )) end @titles = options[:tasks_options].map do |task_options| task_options[:title] end end
Public Instance Methods
clobber?()
click to toggle source
Calls superclass method
SdocAll::BaseTask#clobber?
# File lib/sdoc_all/task.rb, line 159 def clobber? return true if super tasks.any?(&:clobber?) end
for_hash()
click to toggle source
# File lib/sdoc_all/task.rb, line 155 def for_hash [doc_path.to_s, title, tasks.map(&:for_hash)] end
occupied_doc_pathes()
click to toggle source
# File lib/sdoc_all/task.rb, line 165 def occupied_doc_pathes [doc_path, parts_path] end
parts_path()
click to toggle source
# File lib/sdoc_all/task.rb, line 132 def parts_path "#{doc_path}_parts" end
run(options = {})
click to toggle source
# File lib/sdoc_all/task.rb, line 136 def run(options = {}) run_if_clobber do tasks.each do |task| Progress.start(task.title) do task.run(options) end end Base.chdir(Base.docs_path) do cmd = %w(sdoc-merge) cmd << '-o' << Base.docs_path + doc_path cmd << '-t' << title cmd << '-n' << titles.join(',') cmd << '-u' << tasks.map{ |task| "../#{task.doc_path}" }.join(' ') Base.system(*cmd + tasks.map(&:doc_path)) end end end