Class: Adocsite::ContentLoader
- Inherits:
-
Object
- Object
- Adocsite::ContentLoader
- Defined in:
- lib/adocsite/content_loader.rb
Instance Attribute Summary collapse
-
#articles ⇒ Object
readonly
Returns the value of attribute articles.
-
#files ⇒ Object
readonly
Returns the value of attribute files.
-
#images ⇒ Object
readonly
Returns the value of attribute images.
-
#pages ⇒ Object
readonly
Returns the value of attribute pages.
-
#scripts ⇒ Object
readonly
Returns the value of attribute scripts.
-
#styles ⇒ Object
readonly
Returns the value of attribute styles.
Instance Method Summary collapse
-
#initialize ⇒ ContentLoader
constructor
A new instance of ContentLoader.
- #load_assets ⇒ Object
Constructor Details
#initialize ⇒ ContentLoader
Returns a new instance of ContentLoader.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/adocsite/content_loader.rb', line 4 def initialize @adoc_options = {:attributes => { "imagesdir" => Adocsite::config[:IMAGES_FOLDER], "stylesdir" => Adocsite::config[:STYLES_FOLDER], "iconsdir" => Adocsite::config[:IMAGES_FOLDER] + "/icons" }} # files to copy @styles = Array.new @scripts = Array.new @images = Array.new @files = Array.new #content @pages = Hash.new @articles = Hash.new end |
Instance Attribute Details
#articles ⇒ Object (readonly)
Returns the value of attribute articles.
3 4 5 |
# File 'lib/adocsite/content_loader.rb', line 3 def articles @articles end |
#files ⇒ Object (readonly)
Returns the value of attribute files.
3 4 5 |
# File 'lib/adocsite/content_loader.rb', line 3 def files @files end |
#images ⇒ Object (readonly)
Returns the value of attribute images.
3 4 5 |
# File 'lib/adocsite/content_loader.rb', line 3 def images @images end |
#pages ⇒ Object (readonly)
Returns the value of attribute pages.
3 4 5 |
# File 'lib/adocsite/content_loader.rb', line 3 def pages @pages end |
#scripts ⇒ Object (readonly)
Returns the value of attribute scripts.
3 4 5 |
# File 'lib/adocsite/content_loader.rb', line 3 def scripts @scripts end |
#styles ⇒ Object (readonly)
Returns the value of attribute styles.
3 4 5 |
# File 'lib/adocsite/content_loader.rb', line 3 def styles @styles end |
Instance Method Details
#load_assets ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/adocsite/content_loader.rb', line 30 def load_assets all_files = find_all_files @content = all_files.select {|path| path.end_with?(*Adocsite::config[:DOCUMENTS])} @styles = all_files.select {|path| path.end_with?(*Adocsite::config[:STYLES])} @scripts = all_files.select {|path| path.end_with?(*Adocsite::config[:SCRIPTS])} @images = all_files.select {|path| path.end_with?(*Adocsite::config[:IMAGES])} @files = all_files - @images - @scripts - @styles - @content build_pages_and_articles end |