Module: Index
- Defined in:
- lib/extensions/utils/index.rb
Class Method Summary collapse
Class Method Details
.includes ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/extensions/utils/index.rb', line 4 def self.includes # From the index, create an array of the main chapters @indexincludes = [] File.read('index.adoc').each_line do |line| @indexincludes.push(match_include(line).sub(/^\{find\}/, '')) if line[IncludeDirectiveRx] end @indexincludes end |
.match_include(line) ⇒ Object
13 14 15 |
# File 'lib/extensions/utils/index.rb', line 13 def self.match_include(line) line.match(/(?<=^include::).+?\.adoc(?=\[\])/).to_s end |