Class: Muwu::ManifestTask::TextItem
- Inherits:
-
Object
- Object
- Muwu::ManifestTask::TextItem
show all
- Includes:
- Muwu
- Defined in:
- lib/muwu/manifest_task/text_item.rb
Constant Summary
Constants included
from Muwu
GEM_HOME_LIB, GEM_HOME_LIB_MUWU, VERSION
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Muwu
debug, read
Instance Attribute Details
#destination ⇒ Object
Returns the value of attribute destination.
9
10
11
|
# File 'lib/muwu/manifest_task/text_item.rb', line 9
def destination
@destination
end
|
#heading ⇒ Object
Returns the value of attribute heading.
9
10
11
|
# File 'lib/muwu/manifest_task/text_item.rb', line 9
def heading
@heading
end
|
#heading_origin ⇒ Object
Returns the value of attribute heading_origin.
9
10
11
|
# File 'lib/muwu/manifest_task/text_item.rb', line 9
def heading_origin
@heading_origin
end
|
#naming ⇒ Object
Returns the value of attribute naming.
9
10
11
|
# File 'lib/muwu/manifest_task/text_item.rb', line 9
def naming
@naming
end
|
#numbering ⇒ Object
Returns the value of attribute numbering.
9
10
11
|
# File 'lib/muwu/manifest_task/text_item.rb', line 9
def numbering
@numbering
end
|
#outline ⇒ Object
Returns the value of attribute outline.
9
10
11
|
# File 'lib/muwu/manifest_task/text_item.rb', line 9
def outline
@outline
end
|
#project ⇒ Object
Returns the value of attribute project.
9
10
11
|
# File 'lib/muwu/manifest_task/text_item.rb', line 9
def project
@project
end
|
#sections ⇒ Object
Returns the value of attribute sections.
9
10
11
|
# File 'lib/muwu/manifest_task/text_item.rb', line 9
def sections
@sections
end
|
#source_filename ⇒ Object
Returns the value of attribute source_filename.
9
10
11
|
# File 'lib/muwu/manifest_task/text_item.rb', line 9
def source_filename
@source_filename
end
|
Instance Method Details
#does_have_child_sections ⇒ Object
36
37
38
|
# File 'lib/muwu/manifest_task/text_item.rb', line 36
def does_have_child_sections
is_parent_heading && (@sections.length >= 1)
end
|
#inspect ⇒ Object
22
23
24
|
# File 'lib/muwu/manifest_task/text_item.rb', line 22
def inspect
["#{self.to_s}", "{", inspect_instance_variables, "}"].join(' ')
end
|
#inspect_instance_variables ⇒ Object
27
28
29
|
# File 'lib/muwu/manifest_task/text_item.rb', line 27
def inspect_instance_variables
self.instance_variables.map { |v| "#{v}=#<#{instance_variable_get(v).class}>" }.join(", ")
end
|
#is_not_parent_heading ⇒ Object
41
42
43
|
# File 'lib/muwu/manifest_task/text_item.rb', line 41
def is_not_parent_heading
is_parent_heading == false
end
|
#is_parent_heading ⇒ Object
46
47
48
|
# File 'lib/muwu/manifest_task/text_item.rb', line 46
def is_parent_heading
Array === @sections
end
|
#naming_downcase ⇒ Object
51
52
53
|
# File 'lib/muwu/manifest_task/text_item.rb', line 51
def naming_downcase
@naming.map {|n| n.downcase}
end
|
#naming_downcase_without_text_root ⇒ Object
56
57
58
|
# File 'lib/muwu/manifest_task/text_item.rb', line 56
def naming_downcase_without_text_root
naming_without_text_root.map {|n| n.downcase}
end
|
#naming_without_text_root ⇒ Object
61
62
63
|
# File 'lib/muwu/manifest_task/text_item.rb', line 61
def naming_without_text_root
@naming[1..-1]
end
|
#numbering_to_depth_max ⇒ Object
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
# File 'lib/muwu/manifest_task/text_item.rb', line 66
def numbering_to_depth_max
if @project.options.render_sections_distinctly_depth_max
index_min = 0
index_max = @project.options.render_sections_distinctly_depth_max - 1
if index_max >= index_min
@numbering[index_min..index_max]
else @numbering
end
else
@numbering
end
end
|
#project_directory ⇒ Object
82
83
84
|
# File 'lib/muwu/manifest_task/text_item.rb', line 82
def project_directory
@project.working_directory
end
|
#section_depth ⇒ Object
87
88
89
|
# File 'lib/muwu/manifest_task/text_item.rb', line 87
def section_depth
@numbering.length
end
|
#source ⇒ Object
92
93
94
|
# File 'lib/muwu/manifest_task/text_item.rb', line 92
def source
File.read(source_filename_absolute)
end
|
#source_file_does_exist ⇒ Object
97
98
99
|
# File 'lib/muwu/manifest_task/text_item.rb', line 97
def source_file_does_exist
File.exist?(source_filename_absolute) == true
end
|
#source_file_does_not_exist ⇒ Object
102
103
104
|
# File 'lib/muwu/manifest_task/text_item.rb', line 102
def source_file_does_not_exist
File.exist?(source_filename_absolute) == false
end
|
#source_filename_absolute ⇒ Object
107
108
109
|
# File 'lib/muwu/manifest_task/text_item.rb', line 107
def source_filename_absolute
File.absolute_path(File.join(project_directory, source_filename))
end
|
#source_filename_relative ⇒ Object
112
113
114
|
# File 'lib/muwu/manifest_task/text_item.rb', line 112
def source_filename_relative
source_filename
end
|
#text_root_name ⇒ Object
117
118
119
|
# File 'lib/muwu/manifest_task/text_item.rb', line 117
def text_root_name
@naming[0]
end
|