class Muwu::Manifest

Attributes

documents[RW]
options[RW]
project[RW]

Public Class Methods

new() click to toggle source
# File lib/muwu/manifest/manifest.rb, line 15
def initialize
  @documents = []
end

Public Instance Methods

contents_block_by_name(text_root_name) click to toggle source
# File lib/muwu/manifest/manifest.rb, line 34
def contents_block_by_name(text_root_name)
  matching_contents = []
  documents_html.each do |document_html|
    matching_contents << document_html.contents_blocks_by_name(text_root_name)
  end
  matching_contents.flatten[0]
end
documents_count() click to toggle source
# File lib/muwu/manifest/manifest.rb, line 43
def documents_count
  @documents.length
end
documents_css() click to toggle source
# File lib/muwu/manifest/manifest.rb, line 48
def documents_css
  @documents.select { |d| ManifestTask::DocumentCss === d }
end
documents_css_count() click to toggle source
# File lib/muwu/manifest/manifest.rb, line 53
def documents_css_count
  documents_css.length
end
documents_html() click to toggle source
# File lib/muwu/manifest/manifest.rb, line 58
def documents_html
  @documents.select { |d| ManifestTask::DocumentHtml === d }    
end
documents_html_count() click to toggle source
# File lib/muwu/manifest/manifest.rb, line 63
def documents_html_count
  documents_html.length
end
documents_js() click to toggle source
# File lib/muwu/manifest/manifest.rb, line 68
def documents_js
  @documents.select { |d| ManifestTask::DocumentJs === d }
end
documents_js_count() click to toggle source
# File lib/muwu/manifest/manifest.rb, line 73
def documents_js_count
  documents_js.length
end
does_have_documents() click to toggle source
# File lib/muwu/manifest/manifest.rb, line 78
def does_have_documents
  documents_count > 0
end
does_have_documents_css() click to toggle source
# File lib/muwu/manifest/manifest.rb, line 83
def does_have_documents_css
  documents_css_count > 0
end
does_have_documents_html() click to toggle source
# File lib/muwu/manifest/manifest.rb, line 88
def does_have_documents_html
  documents_html_count > 0
end
does_have_documents_js() click to toggle source
# File lib/muwu/manifest/manifest.rb, line 93
def does_have_documents_js
  documents_js_count > 0
end
does_not_have_documents() click to toggle source
# File lib/muwu/manifest/manifest.rb, line 98
def does_not_have_documents
  documents_count == 0
end
find_document_html_by_index(index) click to toggle source
# File lib/muwu/manifest/manifest.rb, line 103
def find_document_html_by_index(index)
  documents_html.select { |document_html| document_html.index == index }[0]
end
inspect() click to toggle source
# File lib/muwu/manifest/manifest.rb, line 20
def inspect
  ["#{self.to_s}", "{", inspect_instance_variables, "}"].join(' ')
end
inspect_instance_variables() click to toggle source
# File lib/muwu/manifest/manifest.rb, line 25
def inspect_instance_variables
  self.instance_variables.map { |v| "#{v}=#<#{instance_variable_get(v).class}>" }.join(", ")
end
text_blocks() click to toggle source

def outline_has_more_than_one_text_block

outline_text_blocks_count > 1

end

def outline_has_only_one_text_block

outline_text_blocks_count = 1

end

def outline_text_blocks

text_sections = []
project_outline.flatten.select{ |step| Hash === step }.each do |step|
  if step.flatten[0] =~ REGEXP.outline_text
    text_sections << step
  end
end
text_sections

end

def outline_text_blocks_count

outline_text_blocks.count

end

def project_outline

@project.outline

end

# File lib/muwu/manifest/manifest.rb, line 139
def text_blocks
  text_blocks = []
  documents_html.each do |document_html|
    text_blocks.concat(document_html.text_blocks)
  end
  text_blocks.flatten
end
text_blocks_by_name(text_root_name) click to toggle source
# File lib/muwu/manifest/manifest.rb, line 148
def text_blocks_by_name(text_root_name)
  matching_text_blocks = []
  documents_html.each do |document_html|
    matching_text_blocks.concat(document_html.text_blocks_by_name(text_root_name))
  end
  matching_text_blocks.flatten
end